From patchwork Tue Jul 4 11:18:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13301003 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 9B271EB64D9 for ; Tue, 4 Jul 2023 11:18:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20D8C280071; Tue, 4 Jul 2023 07:18:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1951C90000D; Tue, 4 Jul 2023 07:18:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05D23280071; Tue, 4 Jul 2023 07:18:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E689790000D for ; Tue, 4 Jul 2023 07:18:12 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A19EE1409FA for ; Tue, 4 Jul 2023 11:18:12 +0000 (UTC) X-FDA: 80973680424.08.EB09136 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf17.hostedemail.com (Postfix) with ESMTP id BA2734001E for ; Tue, 4 Jul 2023 11:18:08 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@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=1688469490; 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: references; bh=4PkSoJiG9MPa0AmTrsShgG7oKRkad5jcuz48t7grpJM=; b=H8IOWusy1TuV12kNioAvcBWlUXlI6G1fqZz3j61uIQRhDgKsi+s3pnF3stIJlyWLnhsCSn V8GUgOStSXquqIqgtQzAYNGnEPhygo7/c+W2MtR9E4NMIpf9nfH1O19C0gEerEZ1i6avyL Evq/5VKNjo1we5kmnuYE5rWmUU3bV/E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688469490; a=rsa-sha256; cv=none; b=YAJyNHGk/6/IBegLqL/12G/7Wb9KsWvUliXkCYSXDQNwuMuRMQvSwBY7nmohac0vZdtT22 s/VyuQ8zcGCu35wE7Px1uoRwMqVUuZoiQkvYXNpVSQrKN4ZoQYxHzKnTPzwNa1pxIrVNnb FJ+D2yEpIOqSOnE0TPt7NC+RqkFra4U= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QwKxq1tptzTm0q; Tue, 4 Jul 2023 19:17:03 +0800 (CST) Received: from huawei.com (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 4 Jul 2023 19:18:04 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm: page_alloc: avoid false page outside zone error info Date: Tue, 4 Jul 2023 19:18:23 +0800 Message-ID: <20230704111823.940331-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Stat-Signature: 7ctbe48yqtor5xu6q4fpwdcefj893kde X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BA2734001E X-Rspam-User: X-HE-Tag: 1688469488-316329 X-HE-Meta: U2FsdGVkX1+JxSklnPMoT/l0D68CRq+GWsGoZ/XpOmTuVm1H8E0Vc4N93UFxTtOoObJ4aUhnnlY1s/lLRPFSIT+fJk+hBJ8Fje4IF8VQqEVrAMe0ZVi7u5ET01ChKNGfr2JWGrOyhoNaw/FeKB3gBlRgK8ffHVw/XFyztLi1oMIeG4ws4b7xJD/C+djkKurWVb+dWh0dd2ADiJdZ8AzX4PvQC067g7LI/ek6jHA+SyaJOPrt7tPbwiXAvDfnVh0ZAH05LwjmUBOkr41jBKMWlS4HEFLQoPd5bjJ7WF4UpYRRHlTPYyOUgiSIG7qIRbK37m6A3B/E+mEURl2XcZJbHJOAu9idp+sIYHzfEwdWRZbL8ISOI3LLMSn3ifX1L5zZ+nMGUDnVh+09JA0yxeZ54XiA9Kvsc8zkaQ5gteRW14IIWLcjirFnb3y8VHBfh3qn0bmfPLa19voAA8JEf2BFjGdwWmlpsGN9Yks++BsOEtkKhSuCferNCxudH/CNsHMw30ynV2B7pJRuTBGDTG70vJ8QMc2dUHEGUUaRsYafxQvDA0/HCg3FpuDBpvNPuxNOp8Bn/0J/IF4ua0KdNJR6crQguSmvUflUoDdZoYXXlKS5rzRZSN/9iYUehdTv11ZHrZRPiEAHkogtV/1Exn7Pkl4ho/HIr0mN5PT/2fr59B1yYJiZ8PvpiUmoR2IvUYjiSNbWAw3ORxBRUraoEPfhrQmziFO3J864JkoDDB8ajSHcCtPcpc6BWRIBBRfcQOXj0RF4JVNvSzGapQL361AFhVBUKLUki1ClaUSBruiePtuweNpq7Rvmjbto17ABZYxdydvM6Rlh7RQJLjRd1k2net3FQtBRt349UQoKF/xTxIlZBseV/Ubs7TgObdg9mob37QotNEV/fmPsLDq3MJ7XDA3PVqaShbb32YIZEVrSvaHBA80EXDz8F07tApVkjHVPLuzLzau8xz5RPr6O/nf VcKMHX5s bkrpOCpcy+jk2wuIUbQnUuy55dYfZkaSfvszfCNjYVTd0UvP9sUlvr9yevY0WWIi3Y0yOJq8/j/esIW/fKhqXZGyVrK5D+4kYEPc+ftgFfpvItKoE/1P784flLN7G6e6oyX4tNAs2iCz8202bxK+EeXGHG+Y/uCB9d9rGuQtJK7KX3JRHdCFc/9hqzFhwpqmxHmBS 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: If pfn is outside zone boundaries in the first round, ret will be set to 1. But if pfn is changed to inside the zone boundaries in zone span seqretry path, ret is still set to 1 leading to false page outside zone error info. Signed-off-by: Miaohe Lin --- mm/page_alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7d3460c7a480..40a9f3ed25e9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -459,7 +459,7 @@ void set_pageblock_migratetype(struct page *page, int migratetype) #ifdef CONFIG_DEBUG_VM static int page_outside_zone_boundaries(struct zone *zone, struct page *page) { - int ret = 0; + int ret; unsigned seq; unsigned long pfn = page_to_pfn(page); unsigned long sp, start_pfn; @@ -470,6 +470,8 @@ static int page_outside_zone_boundaries(struct zone *zone, struct page *page) sp = zone->spanned_pages; if (!zone_spans_pfn(zone, pfn)) ret = 1; + else + ret = 0; } while (zone_span_seqretry(zone, seq)); if (ret)