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:
+27
-7
@@ -54,12 +54,12 @@ struct config cfg = {
|
||||
.hotunplug = NULL,
|
||||
};
|
||||
|
||||
int num_cpu_start, memory, cpu, reload_pending;
|
||||
long cmm_pagesize_start;
|
||||
unsigned long meminfo_size, vmstat_size, cpustat_size, varinfo_size;
|
||||
char *meminfo, *vmstat, *cpustat, *varinfo;
|
||||
double *timestamps;
|
||||
unsigned int history_max, history_current, history_prev, sym_names_count;
|
||||
unsigned long meminfo_size, vmstat_size, cpustat_size, varinfo_size;
|
||||
int num_cpu_start, memory, cpu, reload_pending, saved_polarization;
|
||||
char *meminfo, *vmstat, *cpustat, *varinfo;
|
||||
long cmm_pagesize_start;
|
||||
double *timestamps;
|
||||
|
||||
static struct symbols symbols;
|
||||
static jmp_buf jmpenv;
|
||||
@@ -77,8 +77,29 @@ static void eval_cpu_rules(void)
|
||||
{
|
||||
double diffs[CPUSTATS], diffs_total, percent_factor;
|
||||
char *procinfo_current, *procinfo_prev;
|
||||
int nr_cpus, on_off;
|
||||
int nr_cpus, on_off, polarization;
|
||||
|
||||
polarization = get_polarization();
|
||||
if (polarization < 0) {
|
||||
cpuplugd_debug("couldn't determine system polarization\n");
|
||||
cpuplugd_debug("skipping cpu rule evaluation\n");
|
||||
return;
|
||||
}
|
||||
if (saved_polarization != polarization) {
|
||||
saved_polarization = polarization;
|
||||
if (polarization == PLR_VERTICAL) {
|
||||
/* revert cpu hotplug adjustments after switching from horizontal */
|
||||
reactivate_cpus();
|
||||
} else if (polarization == PLR_HORIZONTAL) {
|
||||
/* reapply cpu config after switching from vertical */
|
||||
apply_cpu_config();
|
||||
}
|
||||
}
|
||||
if (polarization == PLR_VERTICAL) {
|
||||
cpuplugd_debug("system is running vertical polarization\n");
|
||||
cpuplugd_debug("cpuplugd won't make cpu adjustments\n");
|
||||
return;
|
||||
}
|
||||
nr_cpus = get_numcpus();
|
||||
procinfo_current = cpustat + history_current * cpustat_size;
|
||||
procinfo_prev = cpustat + history_prev * cpustat_size;
|
||||
@@ -157,7 +178,6 @@ static void eval_cpu_rules(void)
|
||||
printf("\n");
|
||||
printf("---------------------------------------------\n");
|
||||
}
|
||||
|
||||
on_off = 0;
|
||||
/* Evaluate the hotplug rule */
|
||||
if (eval_term(cfg.hotplug, &symbols))
|
||||
|
||||
Reference in New Issue
Block a user