lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v7 1/5] locking/qspinlock: Rename mcs lock/unlock macros and make them more generic
    On Mon, Nov 25, 2019 at 04:07:05PM -0500, Alex Kogan wrote:

    > --- a/arch/arm/include/asm/mcs_spinlock.h
    > +++ b/arch/arm/include/asm/mcs_spinlock.h
    > @@ -6,7 +6,7 @@
    > #include <asm/spinlock.h>
    >
    > /* MCS spin-locking. */
    > -#define arch_mcs_spin_lock_contended(lock) \
    > +#define arch_mcs_spin_lock(lock) \
    > do { \
    > /* Ensure prior stores are observed before we enter wfe. */ \
    > smp_mb(); \
    > @@ -14,9 +14,9 @@ do { \
    > wfe(); \
    > } while (0) \
    >
    > -#define arch_mcs_spin_unlock_contended(lock) \
    > +#define arch_mcs_pass_lock(lock, val) \
    > do { \
    > - smp_store_release(lock, 1); \
    > + smp_store_release((lock), (val)); \
    > dsb_sev(); \
    > } while (0)

    So I hate those names; it used to be clear this was the contended path,
    not so anymore. arch_mcs_spin_lock() in particular is grossly misnamed
    now.

    's/arch_mcs_spin_lock/arch_mcs_spin_wait/g' could perhaps work, if you
    really want to get rid of the _contended suffix.

    Also, pass_lock seems unfortunately named...

    \
     
     \ /
      Last update: 2020-01-22 10:16    [W:6.816 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site