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