linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: memcg: remove obsolete memcg_has_children()
@ 2020-11-16  5:50 Lukas Bulwahn
  2020-11-16 21:12 ` Roman Gushchin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lukas Bulwahn @ 2020-11-16  5:50 UTC (permalink / raw)
  To: Roman Gushchin, Johannes Weiner, Andrew Morton, cgroups, linux-mm
  Cc: Michal Hocko, Vladimir Davydov, Arnd Bergmann, Tom Rix,
	Nathan Chancellor, Nick Desaulniers, clang-built-linux,
	kernel-janitors, linux-kernel, 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]

Simply remove this obsolete unused function.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
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(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f95ddb3e9898..d49d7c507284 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -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.
  *
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm: memcg: remove obsolete memcg_has_children()
  2020-11-16  5:50 [PATCH] mm: memcg: remove obsolete memcg_has_children() Lukas Bulwahn
@ 2020-11-16 21:12 ` Roman Gushchin
  2020-11-17  2:55 ` Nathan Chancellor
  2020-11-18 12:46 ` Michal Hocko
  2 siblings, 0 replies; 4+ messages in thread
From: Roman Gushchin @ 2020-11-16 21:12 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Johannes Weiner, Andrew Morton, cgroups, linux-mm, Michal Hocko,
	Vladimir Davydov, Arnd Bergmann, Tom Rix, Nathan Chancellor,
	Nick Desaulniers, clang-built-linux, kernel-janitors,
	linux-kernel

On Mon, Nov 16, 2020 at 06:50:43AM +0100, Lukas Bulwahn wrote:
> 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.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> applies cleanly on next-20201113, not on current master
> 
> Roman, please ack.

Acked-by: Roman Gushchin <guro@fb.com>

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm: memcg: remove obsolete memcg_has_children()
  2020-11-16  5:50 [PATCH] mm: memcg: remove obsolete memcg_has_children() Lukas Bulwahn
  2020-11-16 21:12 ` Roman Gushchin
@ 2020-11-17  2:55 ` Nathan Chancellor
  2020-11-18 12:46 ` Michal Hocko
  2 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2020-11-17  2:55 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Roman Gushchin, Johannes Weiner, Andrew Morton, cgroups,
	linux-mm, Michal Hocko, Vladimir Davydov, Arnd Bergmann, Tom Rix,
	Nick Desaulniers, clang-built-linux, kernel-janitors,
	linux-kernel

On Mon, Nov 16, 2020 at 06:50:43AM +0100, Lukas Bulwahn wrote:
> 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.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm: memcg: remove obsolete memcg_has_children()
  2020-11-16  5:50 [PATCH] mm: memcg: remove obsolete memcg_has_children() Lukas Bulwahn
  2020-11-16 21:12 ` Roman Gushchin
  2020-11-17  2:55 ` Nathan Chancellor
@ 2020-11-18 12:46 ` Michal Hocko
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Hocko @ 2020-11-18 12:46 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Roman Gushchin, Johannes Weiner, Andrew Morton, cgroups,
	linux-mm, Vladimir Davydov, Arnd Bergmann, Tom Rix,
	Nathan Chancellor, Nick Desaulniers, clang-built-linux,
	kernel-janitors, linux-kernel

On Mon 16-11-20 06:50:43, Lukas Bulwahn wrote:
> 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.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

git grep agrees
Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> 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(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index f95ddb3e9898..d49d7c507284 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -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.
>   *
> -- 
> 2.17.1

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-18 12:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  5:50 [PATCH] mm: memcg: remove obsolete memcg_has_children() Lukas Bulwahn
2020-11-16 21:12 ` Roman Gushchin
2020-11-17  2:55 ` Nathan Chancellor
2020-11-18 12:46 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).