[PATCH] mm: page_alloc: remove MIGRATE_HIGHATOMIC order0 page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The MIGRATE_HIGHATOMIC pages are used for order > 0 allocation,
so pages in MIGRATE_HIGHATOMIC order0 freelist are invalid.

This patch can solve the allocation failure from buddy, due to
the reserved MIGRATE_HIGHATOMIC order0 pages.

Signed-off-by: Zhiguo Jiang <justinjiang@xxxxxxxx>
---
 mm/page_alloc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 14b51d1ef4c3..10c5b053bedf 100755
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -831,6 +831,9 @@ static inline void __free_one_page(struct page *page,
 	else
 		to_tail = buddy_merge_likely(pfn, buddy_pfn, page, order);
 
+	if (unlikely(!order && is_migrate_highatomic(migratetype)))
+		migratetype = MIGRATE_MOVABLE;
+
 	if (to_tail)
 		add_to_free_list_tail(page, zone, order, migratetype);
 	else
@@ -1639,9 +1642,13 @@ static int move_freepages(struct zone *zone,
 		VM_BUG_ON_PAGE(page_zone(page) != zone, page);
 
 		order = buddy_order(page);
-		move_to_free_list(page, zone, order, migratetype);
+		if (unlikely(!order && is_migrate_highatomic(migratetype)))
+			move_to_free_list(page, zone, order, MIGRATE_MOVABLE);
+		else {
+			move_to_free_list(page, zone, order, migratetype);
+			pages_moved += 1 << order;
+		}
 		pfn += 1 << order;
-		pages_moved += 1 << order;
 	}
 
 	return pages_moved;
-- 
2.39.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux