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 17:38:44 [+0200], Uladzislau Rezki wrote:
> > What is the worst thing that can happen if a CPU migration happens
> > between raw_cpu_ptr() and spin_lock_irqsave() ?
> > 
> You will just introduce higher rate of lock contention what we would
> like to get rid of. 

The possibility of the migration is minimal. So it is not _always_
happening.

>                     Could you please explain what is broken when you
> do like:
> 
> <snip>
> local_irq_save(flags);
> krcp = this_cpu_ptr(&krc);
> spin_lock(&krcp->lock);
> <snip>

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

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