[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <153063057666.1818.17625951186610808734.stgit@localhost.localdomain>
Date: Tue, 03 Jul 2018 18:09:36 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: vdavydov.dev@...il.com, shakeelb@...gle.com,
viro@...iv.linux.org.uk, hannes@...xchg.org, mhocko@...nel.org,
tglx@...utronix.de, pombredanne@...b.com, stummala@...eaurora.org,
gregkh@...uxfoundation.org, sfr@...b.auug.org.au, guro@...com,
mka@...omium.org, penguin-kernel@...ove.SAKURA.ne.jp,
chris@...is-wilson.co.uk, longman@...hat.com, minchan@...nel.org,
ying.huang@...el.com, mgorman@...hsingularity.net, jbacik@...com,
linux@...ck-us.net, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, willy@...radead.org, lirongqing@...du.com,
aryabinin@...tuozzo.com, akpm@...ux-foundation.org,
ktkhai@...tuozzo.com
Subject: [PATCH v8 06/17] mm: Refactoring in workingset_init()
Use prealloc_shrinker()/register_shrinker_prepared()
instead of register_shrinker(). This will be used
in next patch.
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
Acked-by: Vladimir Davydov <vdavydov.dev@...il.com>
Tested-by: Shakeel Butt <shakeelb@...gle.com>
---
mm/workingset.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/workingset.c b/mm/workingset.c
index a466e731231d..b16489c60471 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -507,16 +507,17 @@ 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);
- /* list_lru lock nests inside the IRQ-safe i_pages lock */
- ret = __list_lru_init(&shadow_nodes, true, true, &shadow_nodes_key);
+ ret = prealloc_shrinker(&workingset_shadow_shrinker);
if (ret)
goto err;
- ret = register_shrinker(&workingset_shadow_shrinker);
+ /* list_lru lock nests inside the IRQ-safe i_pages lock */
+ ret = __list_lru_init(&shadow_nodes, true, 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;
}
Powered by blists - more mailing lists