aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuchun Song <[email protected]>2020-12-14 19:12:27 -0800
committerLinus Torvalds <[email protected]>2020-12-15 12:13:45 -0800
commit2484be0f88dc6c9670362d51f6a04f2da0626b50 (patch)
treeb9ca431e9cf579548c9a2871385d36cfcd9d244f
parent8d87d07c9283b45fd50f15d488368d0be6492a17 (diff)
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/[email protected] Fixes: 3c605096d315 ("mm/page_alloc: restrict max order of merging on isolated pageblock") Signed-off-by: Muchun Song <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/page_isolation.c2
1 files changed, 1 insertions, 1 deletions
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);