Skip to content

Commit 2492503

Browse files
author
Rafael Aquini
committed
mm: page_alloc: avoid false page outside zone error info
JIRA: https://issues.redhat.com/browse/RHEL-27743 This patch is a backport of the following upstream commit: commit 82d9b8c Author: Miaohe Lin <[email protected]> Date: Tue Jul 4 19:18:23 2023 +0800 mm: page_alloc: avoid false page outside zone error info 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. This is from code inspection. The race window should be really small thus hard to trigger in real world. [[email protected]: code simplification, per Matthew] Link: https://lkml.kernel.org/r/[email protected] Fixes: bdc8cb9 ("[PATCH] memory hotplug locking: zone span seqlock") Signed-off-by: Miaohe Lin <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Rafael Aquini <[email protected]>
1 parent 89c9367 commit 2492503

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mm/page_alloc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void set_pageblock_migratetype(struct page *page, int migratetype)
460460
#ifdef CONFIG_DEBUG_VM
461461
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
462462
{
463-
int ret = 0;
463+
int ret;
464464
unsigned seq;
465465
unsigned long pfn = page_to_pfn(page);
466466
unsigned long sp, start_pfn;
@@ -469,8 +469,7 @@ static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
469469
seq = zone_span_seqbegin(zone);
470470
start_pfn = zone->zone_start_pfn;
471471
sp = zone->spanned_pages;
472-
if (!zone_spans_pfn(zone, pfn))
473-
ret = 1;
472+
ret = !zone_spans_pfn(zone, pfn);
474473
} while (zone_span_seqretry(zone, seq));
475474

476475
if (ret)

0 commit comments

Comments
 (0)