提交 0532ec6d 编写于 作者: W Wei Li 提交者: Zheng Zengkai

locking/qspinlock: Add CNA support for ARM64

hulk inclusion
category: feature
bugzilla: 169576
CVE: NA

-------------------------------------------------

Enabling CNA is controlled via a new configuration option
(NUMA_AWARE_SPINLOCKS). Add it for arm64.
Signed-off-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5a868a49
......@@ -1075,6 +1075,22 @@ config NODES_SHIFT
Specify the maximum number of NUMA Nodes available on the target
system. Increases memory reserved to accommodate various tables.
config NUMA_AWARE_SPINLOCKS
bool "Numa-aware spinlocks"
depends on NUMA
depends on QUEUED_SPINLOCKS
depends on PARAVIRT_SPINLOCKS
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.
config USE_PERCPU_NUMA_NODE_ID
def_bool y
depends on NUMA
......
......@@ -14,6 +14,10 @@
#define _Q_PENDING_LOOPS (1 << 9)
#ifdef CONFIG_NUMA_AWARE_SPINLOCKS
extern void cna_configure_spin_lock_slowpath(void);
#endif
#ifdef CONFIG_PARAVIRT_SPINLOCKS
extern void native_queued_spin_lock_slowpath(struct qspinlock *lock, u32 val);
extern void __pv_init_lock_hash(void);
......
......@@ -741,10 +741,6 @@ void __init alternative_instructions(void)
}
#endif
#if defined(CONFIG_NUMA_AWARE_SPINLOCKS)
cna_configure_spin_lock_slowpath();
#endif
apply_paravirt(__parainstructions, __parainstructions_end);
restart_nmi();
......
......@@ -2823,6 +2823,10 @@ void __init numa_policy_init(void)
pr_err("%s: interleaving failed\n", __func__);
check_numabalancing_enable();
#if defined(CONFIG_NUMA_AWARE_SPINLOCKS)
cna_configure_spin_lock_slowpath();
#endif
}
/* Reset policy of current process to default */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册