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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b45fd235-a454-360e-4853-d41db3213e9d@redhat.com>
Date:   Fri, 1 Oct 2021 22:03:05 -0400
From:   Waiman Long <llong@...hat.com>
To:     Roman Gushchin <guro@...com>
Cc:     Johannes Weiner <hannes@...xchg.org>,
        Michal Hocko <mhocko@...nel.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org,
        cgroups@...r.kernel.org, linux-mm@...ck.org,
        Shakeel Butt <shakeelb@...gle.com>,
        Muchun Song <songmuchun@...edance.com>
Subject: Re: [PATCH 2/3] mm, memcg: Remove obsolete memcg_free_kmem()

On 10/1/21 8:01 PM, Roman Gushchin wrote:
> On Fri, Oct 01, 2021 at 03:09:37PM -0400, Waiman Long wrote:
>> Since commit d648bcc7fe65 ("mm: kmem: make memcg_kmem_enabled()
>> irreversible"), the only thing memcg_free_kmem() does is to call
>> memcg_offline_kmem() when the memcg is still online. However,
>> memcg_offline_kmem() is only called from mem_cgroup_css_free() which
>> cannot be reached if the memcg hasn't been offlined first.
> Hm, is it true? What if online_css() fails?
I just realize that memcg_online_kmem() is called at css_create(). So 
yes, if css_online() fails (i.e. ENOMEM), we will need to do 
memcg_offline_kmem().
>> As this
>> function now serves no purpose, we should just remove it.
> It looks like we can just use memcg_offline_kmem() instead of
> memcg_free_kmem().

Right, memcg_free_kmem() isn't the right name for that. I agree that we 
should just change mem_cgroup_css_free() to call memcg_offline_kmem() 
directly. Will update the patch accordingly.

Thanks,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ