lkml.org 
[lkml]   [2022]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH V2 1/5] asm-generic: ticket-lock: New generic ticket-based spinlock
On Sat, Mar 19, 2022 at 7:52 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sat, Mar 19, 2022 at 4:54 AM <guoren@kernel.org> wrote:
> > /*
> > - * You need to implement asm/spinlock.h for SMP support. The generic
> > - * version does not handle SMP.
> > + * Using ticket-spinlock.h as generic for SMP support.
> > */
> > #ifdef CONFIG_SMP
> > -#error need an architecture specific asm/spinlock.h
> > +#include <asm-generic/ticket-lock.h>
> > +#ifdef CONFIG_QUEUED_RWLOCKS
> > +#include <asm-generic/qrwlock.h>
> > +#else
> > +#error Please select ARCH_USE_QUEUED_RWLOCKS in architecture Kconfig
> > +#endif
> > #endif
>
> There is no need for the !CONFIG_SMP case, as asm/spinlock.h only ever
> gets included for SMP builds in the first place. This was already a mistake
> in the existing code, but your change would be the time to fix it.
>
> I would also drop the !CONFIG_QUEUED_RWLOCKS case, just include
> it unconditionally. If any architecture wants the ticket spinlock in
> combination with a custom rwlock, they can simply include the
> asm-generic/ticket-lock.h from their asm/spinlock.h, but more
> likely any architecture that can use the ticket spinlock will also
> want the qrwlock anyway.
I agree, !CONFIG_SMP & !CONFIG_QUEUED_RWLOCKS are unnecessary.

@Palmer, you could pick back the series, thx.

>
> Arnd



--
Best Regards
Guo Ren

ML: https://lore.kernel.org/linux-csky/

\
 
 \ /
  Last update: 2022-03-19 14:27    [W:0.075 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site