Skip to content

Commit 82d9b8c

Browse files
MiaoheLinakpm00
authored andcommitted
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]>
1 parent 3d0745e commit 82d9b8c

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
@@ -459,7 +459,7 @@ void set_pageblock_migratetype(struct page *page, int migratetype)
459459
#ifdef CONFIG_DEBUG_VM
460460
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
461461
{
462-
int ret = 0;
462+
int ret;
463463
unsigned seq;
464464
unsigned long pfn = page_to_pfn(page);
465465
unsigned long sp, start_pfn;
@@ -468,8 +468,7 @@ static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
468468
seq = zone_span_seqbegin(zone);
469469
start_pfn = zone->zone_start_pfn;
470470
sp = zone->spanned_pages;
471-
if (!zone_spans_pfn(zone, pfn))
472-
ret = 1;
471+
ret = !zone_spans_pfn(zone, pfn);
473472
} while (zone_span_seqretry(zone, seq));
474473

475474
if (ret)

0 commit comments

Comments
 (0)