[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b50b7c01-c4fc-87bd-f5d9-80e6438cf670@redhat.com>
Date: Wed, 15 Dec 2021 11:58:45 -0500
From: Waiman Long <longman@...hat.com>
To: Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
linux-mm@...ck.org,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH-next v3] mm/memcg: Properly handle memcg_stock access for
PREEMPT_RT
On 12/14/21 23:36, Davidlohr Bueso wrote:
> On Tue, 14 Dec 2021, Waiman Long wrote:
>
>> @@ -2189,7 +2194,7 @@ static void drain_local_stock(struct
>> work_struct *dummy)
>> * drain_stock races is that we always operate on local CPU stock
>> * here with IRQ disabled
>> */
>> - local_irq_save(flags);
>> + local_lock_irqsave(&memcg_stock.lock, flags);
>>
>> stock = this_cpu_ptr(&memcg_stock);
>> drain_obj_stock(&stock->irq_obj);
>
> So here there is still the problem that you can end up taking sleeping
> locks
> with irqs disabled via obj_cgroup_put() >> obj_cgroup_release() - ie: the
> percpu_ref_switch_lock and css_set_lock. It had occurred to me to promote
> the former to a raw spinlock, but doubt we can get away with the latter.
Yes, it is tricky to avoid all these. One possibility to to delay
obj_cgroup_release() through RCU. However, this is outside the scope of
this patch.
Cheers,
Longman
Powered by blists - more mailing lists