/* node numbers to accept / reject */
struct hap_cpuset only_nodes;
struct hap_cpuset drop_nodes;
+ /* cluster numbers to accept / reject */
+ struct hap_cpuset only_clusters;
+ struct hap_cpuset drop_clusters;
/* core numbers to accept / reject */
struct hap_cpuset only_cores;
struct hap_cpuset drop_cores;
ha_cpu_topo[cpu].st |= HA_CPU_F_DONT_USE;
}
+ /* remove CPUs in the drop-cluster set or not in the only-cluster set */
+ for (cpu = 0; cpu <= cpu_topo_lastcpu; cpu++) {
+ if ( ha_cpuset_isset(&cpu_set_cfg.drop_clusters, ha_cpu_topo[cpu].cl_lid) ||
+ !ha_cpuset_isset(&cpu_set_cfg.only_clusters, ha_cpu_topo[cpu].cl_lid))
+ ha_cpu_topo[cpu].st |= HA_CPU_F_DONT_USE;
+ }
+
/* remove CPUs in the drop-core set or not in the only-core set */
for (cpu = 0; cpu <= cpu_topo_lastcpu; cpu++) {
if ( ha_cpuset_isset(&cpu_set_cfg.drop_cores, ha_cpu_topo[cpu].ts_id) ||
ha_cpuset_and(&cpu_set_cfg.only_nodes, &tmp_cpuset);
arg++;
}
+ else if (strcmp(args[arg], "drop-cluster") == 0 || strcmp(args[arg], "only-cluster") == 0) {
+ if (!*args[arg + 1]) {
+ memprintf(err, "missing cluster set");
+ goto parse_err;
+ }
+
+ cpu_set_str[0] = args[arg + 1];
+ if (parse_cpu_set(cpu_set_str, &tmp_cpuset, err) != 0)
+ goto parse_err;
+
+ if (*args[arg] == 'd') // clusters to drop
+ ha_cpuset_or(&cpu_set_cfg.drop_clusters, &tmp_cpuset);
+ else // clusters to keep
+ ha_cpuset_and(&cpu_set_cfg.only_clusters, &tmp_cpuset);
+ arg++;
+ }
else if (strcmp(args[arg], "drop-core") == 0 || strcmp(args[arg], "only-core") == 0) {
if (!*args[arg + 1]) {
memprintf(err, "missing core set");
leave_with_err:
/* complete with supported directives */
- memprintf(err, "%s (only 'reset', 'only-cpu', 'drop-cpu', 'only-node', 'drop-node', 'only-core', 'drop-core', 'only-thread', 'drop-thread' supported).", *err);
+ memprintf(err, "%s (only 'reset', 'only-cpu', 'drop-cpu', 'only-node', 'drop-node', 'only-cluster', 'drop-cluster', 'only-core', 'drop-core', 'only-thread', 'drop-thread' supported).", *err);
leave:
return -1;
}
ha_cpuset_zero(&cpu_set_cfg.only_cpus);
ha_cpuset_zero(&cpu_set_cfg.drop_nodes);
ha_cpuset_zero(&cpu_set_cfg.only_nodes);
+ ha_cpuset_zero(&cpu_set_cfg.drop_clusters);
+ ha_cpuset_zero(&cpu_set_cfg.only_clusters);
ha_cpuset_zero(&cpu_set_cfg.drop_cores);
ha_cpuset_zero(&cpu_set_cfg.only_cores);
ha_cpuset_zero(&cpu_set_cfg.drop_threads);
for (cpu = 0; cpu < cpu_topo_maxcpus; cpu++) {
ha_cpuset_set(&cpu_set_cfg.only_cpus, cpu);
ha_cpuset_set(&cpu_set_cfg.only_nodes, cpu);
+ ha_cpuset_set(&cpu_set_cfg.only_clusters, cpu);
ha_cpuset_set(&cpu_set_cfg.only_cores, cpu);
ha_cpuset_set(&cpu_set_cfg.only_threads, cpu);
}