From: Kirill Tkhai <ktk...@virtuozzo.com> Use prealloc_shrinker()/register_shrinker_prepared() instead of register_shrinker(). This will be used in next patch.
[ktk...@virtuozzo.com: 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 <ktk...@virtuozzo.com> Acked-by: Vladimir Davydov <vdavydov....@gmail.com> Tested-by: Shakeel Butt <shake...@google.com> Cc: Al Viro <v...@zeniv.linux.org.uk> Cc: Andrey Ryabinin <aryabi...@virtuozzo.com> Cc: Chris Wilson <ch...@chris-wilson.co.uk> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: Guenter Roeck <li...@roeck-us.net> Cc: "Huang, Ying" <ying.hu...@intel.com> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Josef Bacik <jba...@fb.com> Cc: Li RongQing <lirongq...@baidu.com> Cc: Matthew Wilcox <wi...@infradead.org> Cc: Matthias Kaehlcke <m...@chromium.org> Cc: Mel Gorman <mgor...@techsingularity.net> Cc: Michal Hocko <mho...@kernel.org> Cc: Minchan Kim <minc...@kernel.org> Cc: Philippe Ombredanne <pombreda...@nexb.com> Cc: Roman Gushchin <g...@fb.com> Cc: Sahitya Tummala <stumm...@codeaurora.org> Cc: Stephen Rothwell <s...@canb.auug.org.au> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Waiman Long <long...@redhat.com> Signed-off-by: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Linus Torvalds <torva...@linux-foundation.org> (cherry picked from commit 39887653aab4cffb0074d0d3c4f392e61b67d22b) Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- mm/workingset.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index 4c053b353c35..1eec3e4f2c42 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -592,15 +592,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; } -- 2.24.1 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel