cpupower: Do not analyse offlined cpus
Use sysfs_is_cpu_online(cpu) instead of cpufreq_cpu_exists(cpu) to detect offlined cpus. Re-arrange printfs slightly to have a consistent output even if you have multiple CPUs as output and even if offlined cores are in between. Signed-off-by: Thomas Renninger <trenn@suse.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
e51207f003
commit
ce512b8404
@@ -12,7 +12,6 @@
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <cpufreq.h>
|
||||
#include "helpers/helpers.h"
|
||||
#include "helpers/sysfs.h"
|
||||
#include "helpers/bitmask.h"
|
||||
@@ -78,10 +77,15 @@ int cmd_set(int argc, char **argv)
|
||||
for (cpu = bitmask_first(cpus_chosen);
|
||||
cpu <= bitmask_last(cpus_chosen); cpu++) {
|
||||
|
||||
if (!bitmask_isbitset(cpus_chosen, cpu) ||
|
||||
cpufreq_cpu_exists(cpu))
|
||||
if (!bitmask_isbitset(cpus_chosen, cpu))
|
||||
continue;
|
||||
|
||||
if (sysfs_is_cpu_online(cpu) != 1){
|
||||
fprintf(stderr, _("Cannot set values on CPU %d:"), cpu);
|
||||
fprintf(stderr, _(" *is offline\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (params.perf_bias) {
|
||||
ret = msr_intel_set_perf_bias(cpu, perf_bias);
|
||||
if (ret) {
|
||||
|
Reference in New Issue
Block a user