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: 90959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1958370vqo; Sun, 7 May 2023 23:56:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fs+tpT+xdTbB1GavGf810hD9kjNKknJrOXEfXIYKKe9q/axd8ukU7FssCWf0qColveik+ X-Received: by 2002:a05:6a00:2448:b0:63d:3789:733f with SMTP id d8-20020a056a00244800b0063d3789733fmr12117162pfj.15.1683528983051; Sun, 07 May 2023 23:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683528983; cv=none; d=google.com; s=arc-20160816; b=bPwINju3VNoG3R8kkP86sM7/Reb9WBiosuJaY31FE1G3G8v7sPeHZQhlWjNjNfW5yu qma3lwLN1NK02+l/xjJQVCbrz69ORLIAtvySdgaUNA6Oey/GcNSwdqhruQqODPpJAsF/ lTCZ3gTCoe2aOktRNXCtaSiKTboBEQWoAGj+tsuk5ug2ZDShB73JIIGlFfh7O+YZIJ+6 nBXuMq6VT2UMKqSVQ69DxyhNMhUX2ogFChV3Yeln5Ge/nZUhxWI28FB6Wh17NOGYCnDx Ktl3sw2N/D934S1jNBcF7W27cICYTP8eCA2cbYFOJCHyduFW2uxF6zFb99OAOLo+O9et FCJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sX3uf84v7hRsSzXIqnpJar5yw/3DQjbScfyQsyU6IN0=; b=JmQ/pAwehqhAXTjk3+j8mGH7tMgeEiRLMPTbmxPOtDM2WBbl/F9QZpVlDd814Zw0t1 foTGlu7ngHRKLLg6xt/Qt2r0DLg3MtFbfS2LacoaJrKScqqWMlYY3jxD6VorD+384IGI MEnpqAsSDjaV8UEosDNmcVv08qPcktEwRjHf3fdeGN6ZatM9ogLXVcoadzxcbRD0k8SH O2o1RZ88BVDHrOkU9e83QOkmub00pFstd4knyzZIg8PyEj0pp0yMk2xWQaCW5oRcu894 aS5wp5Mnz2fLzri51dw9VXTipiqSUrVYzf/67viVD3E/3PXuhPvhNEwOE6kvAPJ+YSns 0G/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p65-20020a622944000000b0063b716685fasi7713623pfp.235.2023.05.07.23.56.10; Sun, 07 May 2023 23:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232717AbjEHGzQ (ORCPT + 99 others); Mon, 8 May 2023 02:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232956AbjEHGyw (ORCPT ); Mon, 8 May 2023 02:54:52 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D2FAD03; Sun, 7 May 2023 23:54:50 -0700 (PDT) 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765308086836077931?= X-GMAIL-MSGID: =?utf-8?q?1765308086836077931?= 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;