lkml.org 
[lkml]   [2021]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking: Generic ticket lock
On Fri, Oct 22, 2021 at 10:23:02AM +0100, Mark Rutland wrote:
> Hi Peter,
>
> On Thu, Oct 21, 2021 at 03:05:15PM +0200, Peter Zijlstra wrote:
> > +static __always_inline void ticket_lock(arch_spinlock_t *lock)
> > +{
> > + u32 val = atomic_fetch_add_acquire(ONE_TICKET, lock);
>
> I wonder, should these atomics be arch_atomic_*(), in case an arch_ or raw_
> lock is used in noinstr code? The plain atomic_*() forms can have explicit
> inline instrumentation.
>
> I haven't seen any issues with qspinlock so far, and that also uses the
> (instrumented) atomics, so maybe that's not actually a problem, but I'm not
> sure what we intend here w.r.t. instrumentability.

So far it's not been a problem, and as you say, if we want to change
this, we need a larger audit/cleanup.

IIRC there's a potential problem in the arm idle code (noinstr'ing the
idle code is still on the TODO list somewhre, hampered by the need to
create more tooling).

\
 
 \ /
  Last update: 2021-10-22 14:34    [W:0.200 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site