mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-18 16:44:27 +08:00
mm: page_isolation: handle unaccepted memory isolation
Page isolation machinery doesn't know anything about unaccepted memory and considers it non-free. It leads to alloc_contig_pages() failure. Treat unaccepted memory as free and accept memory on pageblock isolation. Once memory is accepted it becomes PageBuddy() and page isolation knows how to deal with them. Link: https://lkml.kernel.org/r/20240809114854.3745464-8-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Borislav Petkov <bp@alien8.de> Cc: David Hildenbrand <david@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
55ad43e8ba
commit
e44dd9b133
@ -152,6 +152,9 @@ static int set_migratetype_isolate(struct page *page, int migratetype, int isol_
|
||||
unsigned long flags;
|
||||
unsigned long check_unmovable_start, check_unmovable_end;
|
||||
|
||||
if (PageUnaccepted(page))
|
||||
accept_page(page);
|
||||
|
||||
spin_lock_irqsave(&zone->lock, flags);
|
||||
|
||||
/*
|
||||
@ -367,6 +370,11 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags,
|
||||
VM_BUG_ON(!page);
|
||||
pfn = page_to_pfn(page);
|
||||
|
||||
if (PageUnaccepted(page)) {
|
||||
pfn += MAX_ORDER_NR_PAGES;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (PageBuddy(page)) {
|
||||
int order = buddy_order(page);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user