lkml.org 
[lkml]   [2021]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 30/63] locking/spinlock: Provide RT variant
Date
On Tue, Aug 03 2021 at 14:32, Hillf Danton wrote:
> On Fri, 30 Jul 2021 15:50:37 +0200
>> + * The RT substitutions explicitly disable migration and take
>> + * rcu_read_lock() across the lock held section.
>> + */
>
> My stupid question is how it works in scenarios like spinlock chain
>
> spin_lock(&foo->lock);
> spin_lock(&bar->lock);
> do something for foo and bar;
> spin_unlock(&bar->lock);
> spin_unlock(&foo->lock);
>
> with rcu read lock held across the lock protected section because rcu
> lock has preempt disabled and that will disallow scheduling while acquiring
> the inner lock.

If CONFIG_PREEMPT_RCU=y rcu_read_lock() does not disable
preemption. This is even true for !RT kernels with CONFIG_PREEMPT=y

Thanks,

tglx


\
 
 \ /
  Last update: 2021-08-03 11:11    [W:0.342 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site