From patchwork Tue May 16 06:38:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13242578 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 93C69C7EE2E for ; Tue, 16 May 2023 06:21:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32942280006; Tue, 16 May 2023 02:21:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D9E0280005; Tue, 16 May 2023 02:21:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F4207280006; Tue, 16 May 2023 02:21:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D31DC280004 for ; Tue, 16 May 2023 02:21:40 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 96A71A1479 for ; Tue, 16 May 2023 06:21:40 +0000 (UTC) X-FDA: 80795121960.30.CD9FF0E Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf21.hostedemail.com (Postfix) with ESMTP id 44FC71C000C for ; Tue, 16 May 2023 06:21:37 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 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=1684218098; 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=583j3fsviF54SiM/q72kdov29+3Gn5DDJT2PVj0/et8=; b=DzrDjz3wduDlqhkRtvHFyJm0INBk4MhYLNhUVoxVcYgpmp1Zmj5SYLgNVhtDypiNQXM12s K9ukjhJJJd+6cyIKVyuCNXg8ZMX1Pi/Mun8Olo/AHYSUCy/g6OGM3GvrOwpmxLka7DHcPe /cH+nD0SyiVwyBnVwltSK74orutcOpE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684218098; a=rsa-sha256; cv=none; b=dHBf59EP642NwFblPVvcL20n4uX+oWr0tcWWgPbD3mQfFnD6LdCDHzVienJ/uEKJnqdVWF PWdCQO3sFhsRm+V77zgtFKyCSJx3U1fXeiPD0aHWIm+ZjXh9Ip7S2OyKT+BPNbP2EID7Uk t9PPFRXzLgYL6TfqTAFX9VvJ40ZpaPs= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QL5gx2DsrzLmDK; Tue, 16 May 2023 14:20:13 +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; Tue, 16 May 2023 14:21:32 +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 v2 05/13] mm: page_alloc: squash page_is_consistent() Date: Tue, 16 May 2023 14:38:13 +0800 Message-ID: <20230516063821.121844-6-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230516063821.121844-1-wangkefeng.wang@huawei.com> References: <20230516063821.121844-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 44FC71C000C X-Stat-Signature: ofdh18xem3najzse3zbqzqyd9zicpx1g X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1684218097-305019 X-HE-Meta: U2FsdGVkX1/OZzndoyxtL6OksCBYz/H0FFATySngI/XZ9nLxTZBc+mdAkFVlLUO8Qt68q2xeG9M8XwkXWzS7EDBAZ7Awwiwj+VhWq87sUmY/+yCW2aQ4/BphscITdrDtx8mngD0ZXjIV+cffZGaM6vE3IaKFAzyQqW+bYbPMhdTskY0/q6xmmWin04IPgJkVdnqadDhjV60Z4t+kEC41WE7+oopv1PJ5nl40KWNWUu57L3ZAVeBWDPqpYtyfJFH8UKdE9recU+H6qlvuXg6GloAE2WbOOrVw3G9SK+Wi5fYlTOwTkIcgS8L766cNuNs51RQQ5QA7L7nbfpJ89inCMesfFnaOulQl3HwANu2ITUfjKl85kqn/rn7qayrg8gK4Pct4A6fqUaFxIycTTIsJRjpV8EIfzRhQuBD8ihEbNrAD4+LolMmhL9T9J0CjGM+/x+dlj8w2oQ2YNfzn7GRX2Ynfx/Y9uz6zAwx93L70rJf7HD9nRN6WvjiiUkaA7W0h1cyyLd/B9xcCp18WEYdIjUJ62lXQFwOFR8fVjmoI0CivVXtHGcRLVlIyO0bsiliDp072gndvuWHdPHkMWfEOCAv7AOdgeQemWAjgfGigDUJbyH+ITaIIltL61YxzlF4wTj3u0SXrhsmo9RiK7E+Z9VjV53PFBqJ5V6LHiqibTVOBhPtZLDFcQvsyamkjnoReVH09YK2xvypt/MOynODcayARMa6iuh5NohUNlZtwWIoGQSYgelpScKY9N/SrB2KJWLMLfjv62Yg55ISJskm/14ledu8a1oUpXwXJMtgfvfhn9BFCFKO7qyo6nn4CwWoRPdHHAoVSJfS29PUI6RdSVtS6KzU5tR8QIntcjVPaOqYVWlssKylgIcNpKa1gKUGfJwpdATEGg5PaRonAk1v5GuQ3W/QOlZ4Q44I3/nsU5UAwqYWOveNikKzUsYEJmW/6zViDKSFEkkCwadNaEl8 XfRYWde/ bqzkWZLgZvN1yQhl+Tm3nPlLLug/lYFtuZ4WsnC3N0PN7riFYFW6DN21dZruI8SylCr5Tt+5h+7it0XRQVhTUxAYuRLz/qam6BplGm3HGJwW3tYDS+FmqdahnnZURntLc11yN1kdIUsU7iLPDMUcpGN7xS0z/b5bgy6rcMx9g0YKRSimwoeHoBwPD2baQLZLSbtdw496s6FYYIbAPDDKxIQjAjUly/HCN453174e3MjrHGn+tEjL5cHp4HMCbK1PJNx8A 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. Reviewed-by: Mike Rapoport (IBM) Signed-off-by: Kefeng Wang --- 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 84ba6cca3b3a..1bd8b7832d40 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;