lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJF2gTTLJ3h8drkoTcV_V9AaNsNBkvg9G9Fi3+w_srJzcZG3=g@mail.gmail.com>
Date:   Fri, 4 Aug 2023 09:49:22 +0800
From:   Guo Ren <guoren@...nel.org>
To:     Davidlohr Bueso <dave@...olabs.net>
Cc:     Alex Kogan <alex.kogan@...cle.com>, linux@...linux.org.uk,
        peterz@...radead.org, mingo@...hat.com, will.deacon@....com,
        arnd@...db.de, longman@...hat.com, linux-arch@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        tglx@...utronix.de, bp@...en8.de, hpa@...or.com, x86@...nel.org,
        guohanjun@...wei.com, jglauber@...vell.com,
        steven.sistare@...cle.com, daniel.m.jordan@...cle.com,
        dave.dice@...cle.com
Subject: Re: [PATCH v15 3/6] locking/qspinlock: Introduce CNA into the slow
 path of qspinlock

On Thu, Sep 23, 2021 at 3:26 AM Davidlohr Bueso <dave@...olabs.net> wrote:
>
> On Fri, 14 May 2021, Alex Kogan wrote:
>
> >diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> >index a816935d23d4..94d35507560c 100644
> >--- a/Documentation/admin-guide/kernel-parameters.txt
> >+++ b/Documentation/admin-guide/kernel-parameters.txt
> >@@ -3515,6 +3515,16 @@
> >                       NUMA balancing.
> >                       Allowed values are enable and disable
> >
> >+      numa_spinlock=  [NUMA, PV_OPS] Select the NUMA-aware variant
> >+                      of spinlock. The options are:
> >+                      auto - Enable this variant if running on a multi-node
> >+                      machine in native environment.
> >+                      on  - Unconditionally enable this variant.
>
> Is there any reason why the user would explicitly pass the on option
> when the auto thing already does the multi-node check? Perhaps strange
> numa topologies? Otherwise I would say it's not needed and the fewer
> options we give the user for low level locking the better.
>
> >+                      off - Unconditionally disable this variant.
> >+
> >+                      Not specifying this option is equivalent to
> >+                      numa_spinlock=auto.
> >+
> >       numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
> >                       'node', 'default' can be specified
> >                       This can be set from sysctl after boot.
> >diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> >index 0045e1b44190..819c3dad8afc 100644
> >--- a/arch/x86/Kconfig
> >+++ b/arch/x86/Kconfig
> >@@ -1564,6 +1564,26 @@ config NUMA
> >
> >         Otherwise, you should say N.
> >
> >+config NUMA_AWARE_SPINLOCKS
> >+      bool "Numa-aware spinlocks"
> >+      depends on NUMA
> >+      depends on QUEUED_SPINLOCKS
> >+      depends on 64BIT
> >+      # For now, we depend on PARAVIRT_SPINLOCKS to make the patching work.
> >+      # This is awkward, but hopefully would be resolved once static_call()
> >+      # is available.
> >+      depends on PARAVIRT_SPINLOCKS
>
> We now have static_call() - see 9183c3f9ed7.
>
>
> >+      default y
> >+      help
> >+        Introduce NUMA (Non Uniform Memory Access) awareness into
> >+        the slow path of spinlocks.
> >+
> >+        In this variant of qspinlock, the kernel will try to keep the lock
> >+        on the same node, thus reducing the number of remote cache misses,
> >+        while trading some of the short term fairness for better performance.
> >+
> >+        Say N if you want absolute first come first serve fairness.
>
> This would also need a depends on !PREEMPT_RT, no? Raw spinlocks really want
> the determinism.
I hope we shouldn't force disable it in the Kconfig. Could we put this
idea in numa_spinlock=auto?

>
> Thanks,
> Davidlohr



-- 
Best Regards
 Guo Ren

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ