@@ -834,9 +834,9 @@ static void shrink_worker(struct work_struct *w)
goto resched;
}
- if (!mem_cgroup_online(memcg)) {
+ if (!mem_cgroup_tryget_online(memcg)) {
/* drop the reference from mem_cgroup_iter() */
- mem_cgroup_put(memcg);
+ mem_cgroup_iter_break(NULL, memcg);
pool->next_shrink = NULL;
spin_unlock(&zswap_pools_lock);
@@ -985,7 +985,7 @@ static void zswap_pool_destroy(struct zswap_pool *pool)
list_lru_destroy(&pool->list_lru);
spin_lock(&zswap_pools_lock);
- mem_cgroup_put(pool->next_shrink);
+ mem_cgroup_iter_break(NULL, pool->next_shrink);
pool->next_shrink = NULL;
spin_unlock(&zswap_pools_lock);
Use the correct function for the onlineness check for the memcg selection, and use mem_cgroup_iter_break() to break the iteration. Suggested-by: Yosry Ahmed <yosryahmed@google.com> Signed-off-by: Nhat Pham <nphamcs@gmail.com> --- mm/zswap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)