mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
+17
-2
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user