Whamcloud - gitweb
LU-5050 libcfs: default CPT matches NUMA topology 77/22377/3
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 8 Sep 2016 06:50:59 +0000 (09:50 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 21 Sep 2016 02:56:28 +0000 (02:56 +0000)
Change default value of CPT pattern and make it match NUMA topology

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Iea76deec2face42a01e4aeda690e277be31325a9
Reviewed-on: http://review.whamcloud.com/22377
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/libcfs/linux/linux-cpu.c

index d3d40ce..dca5d37 100644 (file)
@@ -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);