diff mbox series

[RFC,7/7] mm/page_isolation: avoid drain_all_pages for alloc_pages_bulk

Message ID 20200814173131.2803002-8-minchan@kernel.org (mailing list archive)
State New, archived
Headers show
Series Support high-order page bulk allocation | expand

Commit Message

Minchan Kim Aug. 14, 2020, 5:31 p.m. UTC
The draining PCP of CPUs whenever we marked a pageblock
MIGRATE_ISOLATE in the big range is too expensive when we consider
fact that alloc_pages_bulk is just best effort approach.

Thus, this patch avoids the flush when the semantic allows
ISOLATE_FAILURE.

Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 mm/page_isolation.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 6208db89a31b..e70bdded02e9 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -54,9 +54,7 @@  static int set_migratetype_isolate(struct page *page, int migratetype, int isol_
 
 out:
 	spin_unlock_irqrestore(&zone->lock, flags);
-	if (!ret) {
-		drain_all_pages(zone);
-	} else {
+	if (ret) {
 		WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE);
 
 		if ((isol_flags & REPORT_FAILURE) && unmovable)
@@ -197,6 +195,8 @@  int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
 				undo_pfn = pfn;
 				goto undo;
 			}
+			if (!(flags & ALLOW_ISOLATE_FAILURE))
+				drain_all_pages(page_zone(page));
 			nr_isolate_pageblock++;
 		}
 	}