From nobody Sun Feb 8 09:37:45 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 293B7EB64D9 for ; Tue, 4 Jul 2023 11:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbjGDLTX (ORCPT ); Tue, 4 Jul 2023 07:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbjGDLTU (ORCPT ); Tue, 4 Jul 2023 07:19:20 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34FF919A4 for ; Tue, 4 Jul 2023 04:18:54 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 m= igratetype) #ifdef CONFIG_DEBUG_VM static int page_outside_zone_boundaries(struct zone *zone, struct page *pa= ge) { - int ret =3D 0; + int ret; unsigned seq; unsigned long pfn =3D page_to_pfn(page); unsigned long sp, start_pfn; @@ -470,6 +470,8 @@ static int page_outside_zone_boundaries(struct zone *zo= ne, struct page *page) sp =3D zone->spanned_pages; if (!zone_spans_pfn(zone, pfn)) ret =3D 1; + else + ret =3D 0; } while (zone_span_seqretry(zone, seq)); =20 if (ret) --=20 2.33.0