The patch titled Subject: mm: multi-gen LRU: cleanup lru_gen_soft_reclaim() has been added to the -mm mm-unstable branch. Its filename is mm-multi-gen-lru-cleanup-lru_gen_soft_reclaim.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-multi-gen-lru-cleanup-lru_gen_soft_reclaim.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "T.J. Alumbaugh" <talumbau@xxxxxxxxxx> Subject: mm: multi-gen LRU: cleanup lru_gen_soft_reclaim() Date: Mon, 22 May 2023 11:20:56 +0000 lru_gen_soft_reclaim() gets the lruvec from the memcg and node ID to keep a cleaner interface on the caller side. Link: https://lkml.kernel.org/r/20230522112058.2965866-2-talumbau@xxxxxxxxxx Signed-off-by: T.J. Alumbaugh <talumbau@xxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Yuanchu Xie <yuanchu@xxxxxxxxxx> Cc: Yu Zhao <yuzhao@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/mmzone.h | 4 ++-- mm/memcontrol.c | 2 +- mm/vmscan.c | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) --- a/include/linux/mmzone.h~mm-multi-gen-lru-cleanup-lru_gen_soft_reclaim +++ a/include/linux/mmzone.h @@ -534,7 +534,7 @@ void lru_gen_exit_memcg(struct mem_cgrou void lru_gen_online_memcg(struct mem_cgroup *memcg); void lru_gen_offline_memcg(struct mem_cgroup *memcg); void lru_gen_release_memcg(struct mem_cgroup *memcg); -void lru_gen_soft_reclaim(struct lruvec *lruvec); +void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid); #else /* !CONFIG_MEMCG */ @@ -585,7 +585,7 @@ static inline void lru_gen_release_memcg { } -static inline void lru_gen_soft_reclaim(struct lruvec *lruvec) +static inline void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid) { } --- a/mm/memcontrol.c~mm-multi-gen-lru-cleanup-lru_gen_soft_reclaim +++ a/mm/memcontrol.c @@ -485,7 +485,7 @@ static void mem_cgroup_update_tree(struc if (lru_gen_enabled()) { if (soft_limit_excess(memcg)) - lru_gen_soft_reclaim(&memcg->nodeinfo[nid]->lruvec); + lru_gen_soft_reclaim(memcg, nid); return; } --- a/mm/vmscan.c~mm-multi-gen-lru-cleanup-lru_gen_soft_reclaim +++ a/mm/vmscan.c @@ -4846,8 +4846,10 @@ void lru_gen_release_memcg(struct mem_cg } } -void lru_gen_soft_reclaim(struct lruvec *lruvec) +void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid) { + struct lruvec *lruvec = get_lruvec(memcg, nid); + /* see the comment on MEMCG_NR_GENS */ if (lru_gen_memcg_seg(lruvec) != MEMCG_LRU_HEAD) lru_gen_rotate_memcg(lruvec, MEMCG_LRU_HEAD); _ Patches currently in -mm which might be from talumbau@xxxxxxxxxx are mm-multi-gen-lru-use-macro-for-bitmap.patch mm-multi-gen-lru-cleanup-lru_gen_soft_reclaim.patch mm-multi-gen-lru-add-helpers-in-page-table-walks.patch mm-multi-gen-lru-cleanup-lru_gen_test_recent.patch