lkml.org 
[lkml]   [2023]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] mm: compaction: Move list validation into compact_zone()
Date
Move the cc.freepages and cc.migratepages list validation into compact_zone()
to remove some duplicate code.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
mm/compaction.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 5e6f5e35748d..f8e8addc8664 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2488,6 +2488,9 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)

trace_mm_compaction_end(cc, start_pfn, end_pfn, sync, ret);

+ VM_BUG_ON(!list_empty(&cc->freepages));
+ VM_BUG_ON(!list_empty(&cc->migratepages));
+
return ret;
}

@@ -2526,9 +2529,6 @@ static enum compact_result compact_zone_order(struct zone *zone, int order,

ret = compact_zone(&cc, &capc);

- VM_BUG_ON(!list_empty(&cc.freepages));
- VM_BUG_ON(!list_empty(&cc.migratepages));
-
/*
* Make sure we hide capture control first before we read the captured
* page pointer, otherwise an interrupt could free and capture a page
@@ -2659,9 +2659,6 @@ static void proactive_compact_node(pg_data_t *pgdat)
cc.zone = zone;

compact_zone(&cc, NULL);
-
- VM_BUG_ON(!list_empty(&cc.freepages));
- VM_BUG_ON(!list_empty(&cc.migratepages));
}
}

@@ -2689,9 +2686,6 @@ static void compact_node(int nid)
cc.zone = zone;

compact_zone(&cc, NULL);
-
- VM_BUG_ON(!list_empty(&cc.freepages));
- VM_BUG_ON(!list_empty(&cc.migratepages));
}
}

@@ -2868,9 +2862,6 @@ static void kcompactd_do_work(pg_data_t *pgdat)
cc.total_migrate_scanned);
count_compact_events(KCOMPACTD_FREE_SCANNED,
cc.total_free_scanned);
-
- VM_BUG_ON(!list_empty(&cc.freepages));
- VM_BUG_ON(!list_empty(&cc.migratepages));
}

/*
--
2.27.0
\
 
 \ /
  Last update: 2023-03-26 23:34    [W:0.049 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site