FROMLIST: mm: replace migrate_prep with lru_add_drain_all
Currently, migrate_prep is merely a wrapper of lru_cache_add_all. There is not much to gain from having additional abstraction. Use lru_add_drain_all instead of migrate_prep, which would be more descriptive. note: migrate_prep_local in compaction.c changed into lru_add_drain to avoid CPU schedule cost with involving many other CPUs to keep keep old behavior. Bug: 180018981 Link: https://lore.kernel.org/linux-mm/20210310161429.399432-1-minchan@kernel.org/ Signed-off-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I1bd3fcb13993e8a7a7961ceec817ac17304364cb
This commit is contained in:
@@ -753,6 +753,11 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy)
|
||||
}
|
||||
|
||||
/*
|
||||
* lru_add_drain_all() usually needs to be called before we start compiling
|
||||
* a list of pages to be migrated using isolate_lru_page(). Note that pages
|
||||
* may be moved off the LRU after we have drained them. Those pages will
|
||||
* fail to migrate like other pages that may be busy.
|
||||
*
|
||||
* Doesn't need any cpu hotplug locking because we do rely on per-cpu
|
||||
* kworkers being shut down before our page_alloc_cpu_dead callback is
|
||||
* executed on the offlined cpu.
|
||||
|
Reference in New Issue
Block a user