From 4fb513d0a635ce749ddb2173e9841814622ba4a2 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Thu, 8 Sep 2016 09:50:59 +0300 Subject: [PATCH] LU-5050 libcfs: default CPT matches NUMA topology Change default value of CPT pattern and make it match NUMA topology Signed-off-by: Liang Zhen Signed-off-by: Dmitry Eremin Change-Id: Iea76deec2face42a01e4aeda690e277be31325a9 Reviewed-on: http://review.whamcloud.com/22377 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin --- libcfs/libcfs/linux/linux-cpu.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libcfs/libcfs/linux/linux-cpu.c b/libcfs/libcfs/linux/linux-cpu.c index d3d40ce..dca5d37 100644 --- a/libcfs/libcfs/linux/linux-cpu.c +++ b/libcfs/libcfs/linux/linux-cpu.c @@ -64,7 +64,7 @@ MODULE_PARM_DESC(cpu_npartitions, "# of CPU partitions"); * * NB: If user specified cpu_pattern, cpu_npartitions will be ignored */ -static char *cpu_pattern = ""; +static char *cpu_pattern = "N"; module_param(cpu_pattern, charp, 0444); MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern"); @@ -1088,7 +1088,15 @@ cfs_cpu_init(void) #endif if (*cpu_pattern != 0) { - cfs_cpt_table = cfs_cpt_table_create_pattern(cpu_pattern); + char *cpu_pattern_dup = kstrdup(cpu_pattern, GFP_KERNEL); + + if (cpu_pattern_dup == NULL) { + CERROR("Failed to duplicate cpu_pattern\n"); + goto failed; + } + + cfs_cpt_table = cfs_cpt_table_create_pattern(cpu_pattern_dup); + kfree(cpu_pattern_dup); if (cfs_cpt_table == NULL) { CERROR("Failed to create cptab from pattern %s\n", cpu_pattern); -- 1.8.3.1