cpuplugd: Halt cpu hotplugging on vertical polarization

On vertical polarization, kernel can be adjusting CPU capacities
dynamically, and cpuplugd can interfere this with hotplug operations
causing performance degradation. To prevent this, check if system has
switched its polarization state, and act accordingly.
If system is on vertical polarization when daemon starts, no CPU hotplug
action is triggered. If system changes to vertical polarization during
daemon runtime, revert cpuhotplug adjustments and stop further CPU
hotplug actions. If system switches back to horizontal polarization
during runtime of the daemon, start evaluating CPU hotplug rules and
trigger adjustments.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Mete Durlu
2024-05-23 13:58:08 +02:00
committed by Jan Höppner
parent c91d172c99
commit 147ff1bf49
6 changed files with 111 additions and 46 deletions
+17 -2
View File
@@ -78,6 +78,23 @@ int get_num_online_cpus(void)
return number;
}
/*
* get_polarization() - return system polarization
*/
int get_polarization(void)
{
int polarization;
char *path;
path = util_path_sysfs("devices/system/cpu/dispatching");
if (util_file_read_i(&polarization, NUM_BASE, path) < 0) {
polarization = -1;
cpuplugd_debug("failed to read system polarization\n");
}
free(path);
return polarization;
}
/*
* is_cpu_hotpluggable() - check if cpuhotplug operations are supported
* for the given cpu.
@@ -206,8 +223,6 @@ void reactivate_cpus(void)
int cpuid, nc, count, i;
char *path;
/* suppress verbose messages on exit */
debug = 0;
/*
* Only enable the number of cpus which where available at
* daemon startup time by checking num_cpu_start.