diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-08-17 18:47:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-17 19:20:30 -0400 |
commit | 39887653aab4cffb0074d0d3c4f392e61b67d22b (patch) | |
tree | 81bc116a1556395a6e3cd5adbf40faefdb21bbe7 | |
parent | 0a4465d340282f92719f4e3a56545a848e638d15 (diff) |
mm/workingset.c: refactor workingset_init()
Use prealloc_shrinker()/register_shrinker_prepared() instead of
register_shrinker(). This will be used in next patch.
[ktkhai@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 <ktkhai@virtuozzo.com>
Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
Tested-by: Shakeel Butt <shakeelb@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Li RongQing <lirongqing@baidu.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Sahitya Tummala <stummala@codeaurora.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <longman@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/workingset.c | 7 |
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) | |||
523 | pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n", | 523 | pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n", |
524 | timestamp_bits, max_order, bucket_order); | 524 | timestamp_bits, max_order, bucket_order); |
525 | 525 | ||
526 | ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key); | 526 | ret = prealloc_shrinker(&workingset_shadow_shrinker); |
527 | if (ret) | 527 | if (ret) |
528 | goto err; | 528 | goto err; |
529 | ret = register_shrinker(&workingset_shadow_shrinker); | 529 | ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key); |
530 | if (ret) | 530 | if (ret) |
531 | goto err_list_lru; | 531 | goto err_list_lru; |
532 | register_shrinker_prepared(&workingset_shadow_shrinker); | ||
532 | return 0; | 533 | return 0; |
533 | err_list_lru: | 534 | err_list_lru: |
534 | list_lru_destroy(&shadow_nodes); | 535 | free_prealloced_shrinker(&workingset_shadow_shrinker); |
535 | err: | 536 | err: |
536 | return ret; | 537 | return ret; |
537 | } | 538 | } |