From patchwork Mon May 8 07:11:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13234121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D772C7EE2E for ; Mon, 8 May 2023 06:54:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D47A0900003; Mon, 8 May 2023 02:54:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CCF94900002; Mon, 8 May 2023 02:54:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFAD1900003; Mon, 8 May 2023 02:54:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 97D7E900002 for ; Mon, 8 May 2023 02:54:55 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 62F72140117 for ; Mon, 8 May 2023 06:54:55 +0000 (UTC) X-FDA: 80766175350.18.069F242 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id 341E48000C for ; Mon, 8 May 2023 06:54:52 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683528893; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sX3uf84v7hRsSzXIqnpJar5yw/3DQjbScfyQsyU6IN0=; b=N3kLeFAG2q801gQfC05YTPJxOBiLAiDkMk1r/PAh3IMRKIDciwtkzXV/7CGfcdxhECirqR 9qDf9Cfn6iNCint4JEv0y+LIIZ/mUgniKOz5TX8+QfZXHXnAYVJCQgCWdb5i4Dnmz/HM+R /BK9GvrP84Q574m4ddeeP5XxoxS3UY8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683528893; a=rsa-sha256; cv=none; b=40Oc4/YSe9V86b7VZfhY35ULWDpZAVOkVUdC6CtTp+YVSYWHEGauNXwjo2Ihpij/Qr9SxM soNdTKQq4zksbI9aMtvUouRZuYrrwxjFF0R62onOTl6EhA7dIEZurMfTIUz9QKb/via61n Xl3re3Gq01YRqkO+za7NobydQFCYi6g= Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QFBkm4VF5zpTx3; Mon, 8 May 2023 14:50:40 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Mon, 8 May 2023 14:54:48 +0800 From: Kefeng Wang To: Andrew Morton , Mike Rapoport , CC: David Hildenbrand , Oscar Salvador , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Luis Chamberlain , Kees Cook , Iurii Zaikin , , , , Kefeng Wang Subject: [PATCH 05/12] mm: page_alloc: squash page_is_consistent() Date: Mon, 8 May 2023 15:11:53 +0800 Message-ID: <20230508071200.123962-6-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230508071200.123962-1-wangkefeng.wang@huawei.com> References: <20230508071200.123962-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Stat-Signature: ws6x43fzf8z6gz5d9aid6tpnaz1s7snt X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 341E48000C X-Rspam-User: X-HE-Tag: 1683528892-337983 X-HE-Meta: U2FsdGVkX1/3Mu0kmHBTLGiLgNWYhEr+p5HDGNA3lOCK+qrs9SGuB9WwvJAob3kiTZTmpF+XhcrsppYenjD+GmGtJeHTGxLrfFUsdbTfu6LbJZHtuswihf6mOja/b0Fuj4LkGxYEdgjfojYlI/Vv2MvWHEKbXhXWo8fHLzQ7OZnLipr6R6Ioc5zhu+HhJKmIuteIM0AJELabaKO6vLD725R9nah+U9wENbjJNNLnQlwUl0v1/bPI5/cqPMzYlQrwMyTdQ89UDmYroJhfPseENz1Ps6N1YKqCI8MhhWwf2T5RxW6GWTL91iXnRrVqWCTuGvbJsl0TA9ElGvPFlLKdLkH+HrZDCJ/611mDUmBaml4enQ1ivmW3FHntGhP+t8YTtqr2eURD7SEiPzEO37JY4mr3qAFi3ouBuV8B3zvlUg9mIfbkMFblYXR4Jmh3AcNzEZWbXNGZ9MOan96l+ASWJNHqUZfVV0ptZmXNby3i8TvfVlv/eb5O1isIi+LQq7onBLsbs5zB4HAqtAkjX9fGEKVQCTPYn5LJSjkTZyGnnX+K6dWg5HBaY+DKwYBj2K8bDrNDscbGOzZm6xZAMFlioDgMhSu2BuXUVz2AGR917nG+lnWI+YrO7fnJlEKoC6Rp/pzlOvmbzgu/aPsj4mnFCBg03IxnRrQq2OlaQPwYQxheNSXch/UI5LOYmNgmH+zVQ3bYODTeVPJLPEPzok/p1EQ/mmGbMAqCJKBF0qg/PoagFV7o97iHrwCOxxc2/NmCYIDgvhrwRiFJ9NNtdTANfYP7kpFDtkn3mHUWgcIJamiTzM4917rEbdESA3FUoiQro7GywXtZ6znJfZ7Tp3PiTH8/O/Jp0FQ84kcarrzpo6cpj947WWgo6Zht+Z4Cbj/kG8UInzH68OVhReN68cH76n/zrvOKCHi+BTXbZwDdB9FFVqOgX5DUj+GdKwc/A0gzjIWw5Qt8bq2D+Qa5APB 75/G8d4s lrooMxf5kic2icmixpklnJtl7i0rCygnkSrd4hD0M/dZevnWJiywMD6AwnQYl2fCKuJRSGfXWBx/YWAoY/nrzUDYwmDG+OfAS+0ObmiO1PKj0tErBSnofy2gyvRLnilgrXHruBDQ5CZH9/5s4U+F6WXUESMpiuE+vppOERAMuPRn/vVTW64wbi67gbVGlUvM+MTDo X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Squash the page_is_consistent() into bad_range() as there is only one caller. Signed-off-by: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) --- mm/page_alloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9a85238f1140..348dcbaca757 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -517,13 +517,6 @@ static int page_outside_zone_boundaries(struct zone *zone, struct page *page) return ret; } -static int page_is_consistent(struct zone *zone, struct page *page) -{ - if (zone != page_zone(page)) - return 0; - - return 1; -} /* * Temporary debugging check for pages not lying within a given zone. */ @@ -531,7 +524,7 @@ static int __maybe_unused bad_range(struct zone *zone, struct page *page) { if (page_outside_zone_boundaries(zone, page)) return 1; - if (!page_is_consistent(zone, page)) + if (zone != page_zone(page)) return 1; return 0;