From: Muchun Song Date: Tue, 15 Dec 2020 03:12:27 +0000 (-0800) Subject: mm/page_isolation: do not isolate the max order page X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2484be0f88dc6c9670362d51f6a04f2da0626b50;p=uclinux-h8%2Flinux.git mm/page_isolation: do not isolate the max order page A max order page has no buddy page and never merges to another order. So isolating and then freeing it is pointless. Link: https://lkml.kernel.org/r/20201202122114.75316-1-songmuchun@bytedance.com Fixes: 3c605096d315 ("mm/page_alloc: restrict max order of merging on isolated pageblock") Signed-off-by: Muchun Song Reviewed-by: Andrew Morton Acked-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Joonsoo Kim Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_isolation.c b/mm/page_isolation.c index a254e1f370a3..bddf788f45bf 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -88,7 +88,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) */ if (PageBuddy(page)) { order = buddy_order(page); - if (order >= pageblock_order) { + if (order >= pageblock_order && order < MAX_ORDER - 1) { pfn = page_to_pfn(page); buddy_pfn = __find_buddy_pfn(pfn, order); buddy = page + (buddy_pfn - pfn);