lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] mm: vmpressure: use mem_cgroup_is_root API
On Tue 11-02-20 13:24:09, Yang Shi wrote:
> Use mem_cgroup_is_root() API to check if memcg is root memcg instead of
> open coding.

Yes, the direct use outside of memcontrol.c should be really an
exception. The only other similar case is cgwb_bdi_init and there is no
easy way to replace - except for adding a helper which is not worth it.

> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>

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

Thanks!

> ---
> mm/vmpressure.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmpressure.c b/mm/vmpressure.c
> index 0590f00..d69019f 100644
> --- a/mm/vmpressure.c
> +++ b/mm/vmpressure.c
> @@ -280,7 +280,7 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
> enum vmpressure_levels level;
>
> /* For now, no users for root-level efficiency */
> - if (!memcg || memcg == root_mem_cgroup)
> + if (!memcg || mem_cgroup_is_root(memcg))
> return;
>
> spin_lock(&vmpr->sr_lock);
> --
> 1.8.3.1
>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2020-02-12 09:24    [W:0.084 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site