lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH-next v3] mm/memcg: Properly handle memcg_stock access for PREEMPT_RT
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.

Thanks,
Davidlohr

\
 
 \ /
  Last update: 2021-12-15 05:37    [W:0.335 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site