Re: [PATCH 1/3] rcu: Use static initializer for krc.lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-04-16 18:01:29 [+0200], Uladzislau Rezki wrote:
> > As written in my previous email to Joel (who somehow fell of the Cc
> > list in this part of the thread):
> > |local_irq_save() + spin_lock() is the problem, see
> > |    https://www.kernel.org/doc/html/latest/locking/locktypes.html#spinlock-t-and-rwlock-t
> > 
> You mean that in CONFIG_PREEMPT_RT:
> 
> <snip>
>  local_irq_save(flags);
>  krcp = this_cpu_ptr(&krc);
>  spin_lock(&krcp->lock);
> <snip>
> 
> it will not be preempted, what does not follow PREEMPT_RT policy. Is that correct?

No. local_irq_save() disables interrupts and spin_lock() acquires a
sleeping lock which may schedule() if contended. The documentation has
this piece:
|On PREEMPT_RT kernel this code sequence breaks because RT-mutex
|requires a fully preemptible context. Instead, use spin_lock_irq() or
|spin_lock_irqsave() and their unlock counterparts.

Sebastian



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux