diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-03-20 08:59:47 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-03-20 08:59:47 +0000 |
commit | 7b915d3eaf2802578456359b5e756af0c1246c58 (patch) | |
tree | 5cf79bd30fcd9ee1ee7a7487670fe436ef38f5e5 /tools/misc/xenpm.c | |
parent | cec3850d146e992d3f8452cc154d9728c4fbc647 (diff) | |
download | xen-7b915d3eaf2802578456359b5e756af0c1246c58.tar.gz xen-7b915d3eaf2802578456359b5e756af0c1246c58.tar.bz2 xen-7b915d3eaf2802578456359b5e756af0c1246c58.zip |
xenpm: Add a small scheduler knob "sched_smt_power_savings"
Current scheduler only care performance, thus always picks pCPU from
the most idle package. This knob provides another option to pick pCPU from
least idle package, for user who want performance power balance.
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Diffstat (limited to 'tools/misc/xenpm.c')
-rw-r--r-- | tools/misc/xenpm.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c index 3540ab2de8..39eef6517f 100644 --- a/tools/misc/xenpm.c +++ b/tools/misc/xenpm.c @@ -56,6 +56,7 @@ void show_help(void) " set-up-threshold [cpuid] <num> set up threshold on CPU <cpuid> or all\n" " it is used in ondemand governor.\n" " get-cpu-topology get thread/core/socket topology info\n" + " set-sched-smt enable|disable enable/disable scheduler smt power saving\n" " start [seconds] start collect Cx/Px statistics,\n" " output after CTRL-C or SIGINT or several seconds.\n" ); @@ -838,6 +839,36 @@ void cpu_topology_func(int argc, char *argv[]) return ; } +void set_sched_smt_func(int argc, char *argv[]) +{ + int value, rc; + + if (argc != 1){ + show_help(); + exit(-1); + } + + if ( !strncmp(argv[0], "disable", sizeof("disable")) ) + { + value = 0; + } + else if ( !strncmp(argv[0], "enable", sizeof("enable")) ) + { + value = 1; + } + else + { + show_help(); + exit(-1); + } + + rc = xc_set_sched_opt_smt(xc_fd, value); + printf("%s sched_smt_power_savings %s\n", argv[0], + rc? "failed":"successeed" ); + + return; +} + struct { const char *name; void (*function)(int argc, char *argv[]); @@ -854,6 +885,7 @@ struct { { "set-sampling-rate", scaling_sampling_rate_func }, { "set-up-threshold", scaling_up_threshold_func }, { "get-cpu-topology", cpu_topology_func}, + { "set-sched-smt", set_sched_smt_func}, }; int main(int argc, char *argv[]) |