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]
Message-Id: <092476D2-C2C4-496C-A92C-EC0B331990ED@linux.dev>
Date:   Sun, 1 May 2022 14:09:49 -0700
From:   Roman Gushchin <roman.gushchin@...ux.dev>
To:     Vasily Averin <vvs@...nvz.org>
Cc:     Shakeel Butt <shakeelb@...gle.com>,
        Michal Koutný <mkoutny@...e.com>,
        Vlastimil Babka <vbabka@...e.cz>, kernel@...nvz.org,
        Florian Westphal <fw@...len.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...e.com>,
        Cgroups <cgroups@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH memcg v4] net: set proper memcg for net_init hooks allocations


> On May 1, 2022, at 6:44 AM, Vasily Averin <vvs@...nvz.org> wrote:
> 
> On 4/28/22 01:47, Shakeel Butt wrote:
>>> On Wed, Apr 27, 2022 at 3:43 PM Vasily Averin <vvs@...nvz.org> wrote:
>>> 
>>> On 4/27/22 18:06, Shakeel Butt wrote:
>>>> On Wed, Apr 27, 2022 at 5:22 AM Michal Koutný <mkoutny@...e.com> wrote:
>>>>> 
>>>>> On Tue, Apr 26, 2022 at 10:23:32PM -0700, Shakeel Butt <shakeelb@...gle.com> wrote:
>>>>>> [...]
>>>>>>> 
>>>>>>> +static inline struct mem_cgroup *get_mem_cgroup_from_obj(void *p)
>>>>>>> +{
>>>>>>> +       struct mem_cgroup *memcg;
>>>>>>> +
>>>>>> 
>>>>>> Do we need memcg_kmem_enabled() check here or maybe
>>>>>> mem_cgroup_from_obj() should be doing memcg_kmem_enabled() instead of
>>>>>> mem_cgroup_disabled() as we can have "cgroup.memory=nokmem" boot
>>>>>> param.
>>> 
>>> Shakeel, unfortunately I'm not ready to answer this question right now.
>>> I even did not noticed that memcg_kmem_enabled() and mem_cgroup_disabled()
>>> have a different nature.
>>> If you have no objections I'm going to keep this place as is and investigate
>>> this question later.
>>> 
>> 
>> Patch is good as is. Just add the documentation to the functions in
>> the next version and you can keep the ACKs.
> 
> I noticed that the kernel already has a function get_mem_cgroup_from_objcg(),
> the name of which is very similar to my new function get_mem_cgroup_from_obj().
> Maybe it's better to rename my function to get_mem_cgroup_from_ptr()?

I don’t think it’s a problem: objcg is a widely used abbreviation and in my opinion is different enough from obj. I’d keep it for the consistency with the mem_cgroup_from_obj().

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ