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>
*
* NB: If user specified cpu_pattern, cpu_npartitions will be ignored
*/
*
* 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");
module_param(cpu_pattern, charp, 0444);
MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern");
#endif
if (*cpu_pattern != 0) {
#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);
if (cfs_cpt_table == NULL) {
CERROR("Failed to create cptab from pattern %s\n",
cpu_pattern);