lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 15 Dec 2022 18:18:03 +0000
From:   Shakeel Butt <shakeelb@...gle.com>
To:     Haifeng Xu <haifeng.xu@...pee.com>
Cc:     akpm@...ux-foundation.org, roman.gushchin@...ux.dev,
        songmuchun@...edance.com, hannes@...xchg.org, vbabka@...e.cz,
        willy@...radead.org, vasily.averin@...ux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/memcontrol: Skip root memcg in memcg_memory_event_mm

On Thu, Dec 15, 2022 at 09:19:07AM +0000, Haifeng Xu wrote:
> The memory events aren't supported on root cgroup, so there is no need
> to account MEMCG_OOM_KILL on root memcg.
> 

Can you explain the scenario where this is happening and causing issue
for you?

> Signed-off-by: Haifeng Xu <haifeng.xu@...pee.com>
> ---
>  include/linux/memcontrol.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 567f12323f55..09f75161a3bc 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -1142,7 +1142,7 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm,
>  
>  	rcu_read_lock();
>  	memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
> -	if (likely(memcg))
> +	if (likely(memcg && !mem_cgroup_is_root(memcg)))

Even if we need this additional check, this is not the right place.

>  		memcg_memory_event(memcg, event);
>  	rcu_read_unlock();
>  }
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ