diff options
author | Kairui Song <kasong@tencent.com> | 2024-11-05 01:52:57 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-11-11 17:22:26 -0800 |
commit | da0c02516c501b43bd39ad4aca5779c86153d143 (patch) | |
tree | fb6d62186590f2191f808c14432425a055ae10e1 /mm/zswap.c | |
parent | fb56fdf8b9a2f7397f8a83dce50189f3f0cf71af (diff) | |
download | lwn-da0c02516c501b43bd39ad4aca5779c86153d143.tar.gz lwn-da0c02516c501b43bd39ad4aca5779c86153d143.zip |
mm/list_lru: simplify the list_lru walk callback function
Now isolation no longer takes the list_lru global node lock, only use the
per-cgroup lock instead. And this lock is inside the list_lru_one being
walked, no longer needed to pass the lock explicitly.
Link: https://lkml.kernel.org/r/20241104175257.60853-7-ryncsn@gmail.com
Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Chengming Zhou <zhouchengming@bytedance.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Waiman Long <longman@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/zswap.c')
-rw-r--r-- | mm/zswap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/zswap.c b/mm/zswap.c index ba35e4550941..f6316b66fb23 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1102,7 +1102,7 @@ static int zswap_writeback_entry(struct zswap_entry *entry, * for reclaim by this ratio. */ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_one *l, - spinlock_t *lock, void *arg) + void *arg) { struct zswap_entry *entry = container_of(item, struct zswap_entry, lru); bool *encountered_page_in_swapcache = (bool *)arg; @@ -1158,7 +1158,7 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o * It's safe to drop the lock here because we return either * LRU_REMOVED_RETRY or LRU_RETRY. */ - spin_unlock(lock); + spin_unlock(&l->lock); writeback_result = zswap_writeback_entry(entry, swpentry); |