> 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. > Agree, it is minimal. But if possible the possibility should be 0 :) > > 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 > 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? -- Vlad Rezki