Message ID | 20191211163201.17179-2-david@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mm: fix max_pfn not falling on section boundary | expand |
Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: f7f99100d8d9 ("mm: stop zeroing memory during allocation in vmemmap"). The bot has tested the following trees: v5.4.2, v5.3.15, v4.19.88. v5.4.2: Build OK! v5.3.15: Build OK! v4.19.88: Failed to apply! Possible dependencies: 907ec5fca3dc ("mm: zero remaining unavailable struct pages") ec393a0f014e ("mm: return zero_resv_unavail optimization") NOTE: The patch will not be queued to stable trees until it is upstream. How should we proceed with this patch?
On 16.12.19 16:06, Sasha Levin wrote: > Hi, > > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: f7f99100d8d9 ("mm: stop zeroing memory during allocation in vmemmap"). > > The bot has tested the following trees: v5.4.2, v5.3.15, v4.19.88. > > v5.4.2: Build OK! > v5.3.15: Build OK! > v4.19.88: Failed to apply! Possible dependencies: > 907ec5fca3dc ("mm: zero remaining unavailable struct pages") > ec393a0f014e ("mm: return zero_resv_unavail optimization") Yes, these two look like the right dependencies and should be picked as well.
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 62dcd6b76c80..1eb2ce7c79e4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6932,7 +6932,8 @@ static u64 zero_pfn_range(unsigned long spfn, unsigned long epfn) * This function also addresses a similar issue where struct pages are left * uninitialized because the physical address range is not covered by * memblock.memory or memblock.reserved. That could happen when memblock - * layout is manually configured via memmap=. + * layout is manually configured via memmap=, or when the highest physical + * address (max_pfn) does not end on a section boundary. */ void __init zero_resv_unavail(void) { @@ -6950,7 +6951,16 @@ void __init zero_resv_unavail(void) pgcnt += zero_pfn_range(PFN_DOWN(next), PFN_UP(start)); next = end; } - pgcnt += zero_pfn_range(PFN_DOWN(next), max_pfn); + + /* + * Early sections always have a fully populated memmap for the whole + * section - see pfn_valid(). If the last section has holes at the + * end and that section is marked "online", the memmap will be + * considered initialized. Make sure that memmap has a well defined + * state. + */ + pgcnt += zero_pfn_range(PFN_DOWN(next), + round_up(max_pfn, PAGES_PER_SECTION)); /* * Struct pages that do not have backing memory. This could be because