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

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

 



On Thu, 16 Apr 2020 14:53:12 -0400
Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:

> > static inline this_cpu_spin_lock_irqsave(struct spinlock __per_cpu *lock)
> > {
> > 	migrate_disable();
> > 	spin_lock_irqsave(this_cpu_ptr(lock));
> > 	migrate_enable();
> > }  
> 
> Here we want to grab the pointer of a per-CPU structure for the local CPU,
> and then grab its lock at the same time without getting migrated, so at least
> for this code the above API, it may not fit properly but perhaps for other
> code it may.

	this_cpu_spin_lock_irqsave(&krc.lock);
	krcp = this_cpu_ptr(&krc);

Note, spin_lock() disables migration, even on PREEMPT_RT.

-- Steve



[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