Re: [PATCH 3/4] memcg: manipulate memcg private ID references by ID
From: Bingfang Guo
Date: Sun Sep 20 2026 - 06:12:13 EST
On Fri, Sep 18, 2026 at 01:24:01PM -0700, Shakeel Butt wrote:
> On Sat, Sep 19, 2026 at 02:46:52AM +0800, Bingfang Guo wrote:
>> Thanks for pointing out this.
>>
>> Agreed. Both two callers are already holding the rcu lock so
>> taking the lock here is unnecessary. So I will drop the
>> rcu_read_lock() and use that in the next version!
>>
>> My concern is that: mem_cgroup_private_id_put() looks like a
>> universal put function, requiring rcu held (which is true today)
>> is not that obvious to the users. So I think adding a short kdoc
>> comment to make it clear later might be a good idea.
>
> This function is internal to memcg code, so whoever is going to call it better
> know to call it with rcu held because of lockdep assert. No need to have a
> comment.
Okay, I'll keep that in mind!