Skip to contentSkip to conversation

mm: memcg: remove obsolete memcg_has_children()

PATCH Applied Lukas Bulwahn 4 participants 4 messages Nov 16, 2020 – Nov 18, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: memcg: remove obsolete memcg_has_children()

Commit 2ef1bf118c40 ("mm: memcg: deprecate the non-hierarchical mode") removed the only use of memcg_has_children() in mem_cgroup_hierarchy_write() as part of the feature deprecation.

Hence, since then, make CC=clang W=1 warns:

mm/memcontrol.c:3421:20:
warning: unused function 'memcg_has_children' [-Wunused-function]

Simply remove this obsolete unused function.

---
applies cleanly on next-20201113, not on current master

Roman, please ack.

Andrew, please pick this minor non-urgent patch into your -next tree.

 mm/memcontrol.c | 13 -------------
 1 file changed, 13 deletions(-)
mm/memcontrol.c +0 -13
index f95ddb3e9898..d49d7c507284 100644
@@ -3415,19 +3415,6 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
 	return nr_reclaimed;
 }
 
-/*
- * Test whether @memcg has children, dead or alive.
- */
-static inline bool memcg_has_children(struct mem_cgroup *memcg)
-{
-	bool ret;
-
-	rcu_read_lock();
-	ret = css_next_child(NULL, &memcg->css);
-	rcu_read_unlock();
-	return ret;
-}
-
 /*
  * Reclaims as many pages from the given memcg as possible.
  *
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Lukas Bulwahn

Commit 2ef1bf118c40 ("mm: memcg: deprecate the non-hierarchical mode") removed the only use of memcg_has_children() in mem_cgroup_hierarchy_write() as part of the feature deprecation.

Hence, since then, make CC=clang W=1 warns:

mm/memcontrol.c:3421:20:
warning: unused function 'memcg_has_children' [-Wunused-function]

Quoted 7 lines

Simply remove this obsolete unused function.

---
applies cleanly on next-20201113, not on current master

Roman, please ack.

Thanks!

Reviewed-by on v1 1/1
#2 lore raw
In reply to Lukas Bulwahn
Quoted 4 lines · Lukas Bulwahn

Commit 2ef1bf118c40 ("mm: memcg: deprecate the non-hierarchical mode") removed the only use of memcg_has_children() in mem_cgroup_hierarchy_write() as part of the feature deprecation.

Quoted 8 lines

Hence, since then, make CC=clang W=1 warns:

mm/memcontrol.c:3421:20:
warning: unused function 'memcg_has_children' [-Wunused-function]

Simply remove this obsolete unused function.

Acked-by on v1 1/1
#3 lore raw
In reply to Lukas Bulwahn
Quoted 4 lines · Lukas Bulwahn

Commit 2ef1bf118c40 ("mm: memcg: deprecate the non-hierarchical mode") removed the only use of memcg_has_children() in mem_cgroup_hierarchy_write() as part of the feature deprecation.

Quoted 8 lines

Hence, since then, make CC=clang W=1 warns:

mm/memcontrol.c:3421:20:
warning: unused function 'memcg_has_children' [-Wunused-function]

Simply remove this obsolete unused function.

git grep agrees

Quoted 36 lines

---
applies cleanly on next-20201113, not on current master

Roman, please ack.

Andrew, please pick this minor non-urgent patch into your -next tree.

 mm/memcontrol.c | 13 -------------
 1 file changed, 13 deletions(-)
mm/memcontrol.c +0 -13
index f95ddb3e9898..d49d7c507284 100644
@@ -3415,19 +3415,6 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
 	return nr_reclaimed;
 }
 
-/*
- * Test whether @memcg has children, dead or alive.
- */
-static inline bool memcg_has_children(struct mem_cgroup *memcg)
-{
-	bool ret;
-
-	rcu_read_lock();
-	ret = css_next_child(NULL, &memcg->css);
-	rcu_read_unlock();
-	return ret;
-}
-
 /*
  * Reclaims as many pages from the given memcg as possible.
  *
Signature · 1 line
2.17.1
Signature · 2 lines
Michal Hocko
SUSE Labs