[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240930072355.2892-2-yongli-oc@zhaoxin.com>
Date: Mon, 30 Sep 2024 15:23:53 +0800
From: yongli-oc <yongli-oc@...oxin.com>
To: <peterz@...radead.org>, <mingo@...hat.com>, <will@...nel.org>,
<longman@...hat.com>, <boqun.feng@...il.com>
CC: <linux-kernel@...r.kernel.org>, <yongli@...oxin.com>,
<louisqi@...oxin.com>, <cobechen@...oxin.com>, <jiangbowang@...oxin.com>
Subject: [PATCH v2 1/3] locking/osq_lock: The Kconfig for dynamic numa-aware osq lock.
The make menu to choose if compile the dynamic numa-aware osq lock
or not, default is N.
Signed-off-by: yongli-oc <yongli-oc@...oxin.com>
---
kernel/Kconfig.numalocks | 17 +++++++++++++++++
lib/Kconfig.debug | 1 +
2 files changed, 18 insertions(+)
create mode 100644 kernel/Kconfig.numalocks
diff --git a/kernel/Kconfig.numalocks b/kernel/Kconfig.numalocks
new file mode 100644
index 000000000000..feb1751b637c
--- /dev/null
+++ b/kernel/Kconfig.numalocks
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+menu "NUMA Lock Supporting (OSQ)"
+
+config LOCK_SPIN_ON_OWNER_NUMA
+ bool "Enable dynamic numa-aware osq lock"
+ depends on LOCK_SPIN_ON_OWNER && X86_64
+ default n
+ help
+ According the cpu numa architecture, the numa-aware lock
+ always unlocks the process waiting on the same numa node
+ first. It is different from the kernel inbox osq_lock.
+ The dynamic numa-aware osq lock switchies between osq_lock and
+ numa-aware lock automatically, according contention level.
+ Enable: echo 1 > /proc/zx_numa_lock/dynamic_enable.
+
+endmenu # NUMA Lock Supporting
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 27539c2626bf..cf9344eb61a4 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1337,6 +1337,7 @@ config DEBUG_PREEMPT
depending on workload as it triggers debugging routines for each
this_cpu operation. It should only be used for debugging purposes.
+source "kernel/Kconfig.numalocks"
menu "Lock Debugging (spinlocks, mutexes, etc...)"
config LOCK_DEBUGGING_SUPPORT
--
2.34.1
Powered by blists - more mailing lists