Commit 5c7e7a0d authored by T.J. Alumbaugh's avatar T.J. Alumbaugh Committed by Andrew Morton

mm: multi-gen LRU: cleanup lru_gen_soft_reclaim()

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@google.comSigned-off-by: default avatarT.J. Alumbaugh <talumbau@google.com>
Reviewed-by: default avatarYuanchu Xie <yuanchu@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 0285762c
...@@ -534,7 +534,7 @@ void lru_gen_exit_memcg(struct mem_cgroup *memcg); ...@@ -534,7 +534,7 @@ void lru_gen_exit_memcg(struct mem_cgroup *memcg);
void lru_gen_online_memcg(struct mem_cgroup *memcg); void lru_gen_online_memcg(struct mem_cgroup *memcg);
void lru_gen_offline_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_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 */ #else /* !CONFIG_MEMCG */
...@@ -585,7 +585,7 @@ static inline void lru_gen_release_memcg(struct mem_cgroup *memcg) ...@@ -585,7 +585,7 @@ static inline void lru_gen_release_memcg(struct mem_cgroup *memcg)
{ {
} }
static inline void lru_gen_soft_reclaim(struct lruvec *lruvec) static inline void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid)
{ {
} }
......
...@@ -485,7 +485,7 @@ static void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid) ...@@ -485,7 +485,7 @@ static void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid)
if (lru_gen_enabled()) { if (lru_gen_enabled()) {
if (soft_limit_excess(memcg)) if (soft_limit_excess(memcg))
lru_gen_soft_reclaim(&memcg->nodeinfo[nid]->lruvec); lru_gen_soft_reclaim(memcg, nid);
return; return;
} }
......
...@@ -4846,8 +4846,10 @@ void lru_gen_release_memcg(struct mem_cgroup *memcg) ...@@ -4846,8 +4846,10 @@ 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)
{ {
struct lruvec *lruvec = get_lruvec(memcg, nid);
/* see the comment on MEMCG_NR_GENS */ /* see the comment on MEMCG_NR_GENS */
if (lru_gen_memcg_seg(lruvec) != MEMCG_LRU_HEAD) if (lru_gen_memcg_seg(lruvec) != MEMCG_LRU_HEAD)
lru_gen_rotate_memcg(lruvec, MEMCG_LRU_HEAD); lru_gen_rotate_memcg(lruvec, MEMCG_LRU_HEAD);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment