aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Tkhai <[email protected]>2018-08-17 15:47:41 -0700
committerLinus Torvalds <[email protected]>2018-08-17 16:20:30 -0700
commit39887653aab4cffb0074d0d3c4f392e61b67d22b (patch)
tree81bc116a1556395a6e3cd5adbf40faefdb21bbe7
parent0a4465d340282f92719f4e3a56545a848e638d15 (diff)
mm/workingset.c: refactor workingset_init()
Use prealloc_shrinker()/register_shrinker_prepared() instead of register_shrinker(). This will be used in next patch. [[email protected]: v9] Link: http://lkml.kernel.org/r/153112550112.4097.16606173020912323761.stgit@localhost.localdomain Link: http://lkml.kernel.org/r/153063057666.1818.17625951186610808734.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai <[email protected]> Acked-by: Vladimir Davydov <[email protected]> Tested-by: Shakeel Butt <[email protected]> Cc: Al Viro <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: "Huang, Ying" <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Li RongQing <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Matthias Kaehlcke <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Philippe Ombredanne <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Sahitya Tummala <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Tetsuo Handa <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Waiman Long <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/workingset.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/workingset.c b/mm/workingset.c
index 529480c21f93..4e0b2523aae2 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -523,15 +523,16 @@ static int __init workingset_init(void)
pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n",
timestamp_bits, max_order, bucket_order);
- ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key);
+ ret = prealloc_shrinker(&workingset_shadow_shrinker);
if (ret)
goto err;
- ret = register_shrinker(&workingset_shadow_shrinker);
+ ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key);
if (ret)
goto err_list_lru;
+ register_shrinker_prepared(&workingset_shadow_shrinker);
return 0;
err_list_lru:
- list_lru_destroy(&shadow_nodes);
+ free_prealloced_shrinker(&workingset_shadow_shrinker);
err:
return ret;
}