diff options
author | Peter Zijlstra <peterz@infradead.org> | 2012-01-09 05:28:35 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-05-17 07:48:56 -0400 |
commit | 8e7fbcbc22c12414bcc9dfdd683637f58fb32759 (patch) | |
tree | a438021ddeadddd8f0745293aeb8c80dbe3c999c /tools | |
parent | fac536f7e4927f34d480dc066f3a578c743b8f0e (diff) |
sched: Remove stale power aware scheduling remnants and dysfunctional knobs
It's been broken forever (i.e. it's not scheduling in a power
aware fashion), as reported by Suresh and others sending
patches, and nobody cares enough to fix it properly ...
so remove it to make space free for something better.
There's various problems with the code as it stands today, first
and foremost the user interface which is bound to topology
levels and has multiple values per level. This results in a
state explosion which the administrator or distro needs to
master and almost nobody does.
Furthermore large configuration state spaces aren't good, it
means the thing doesn't just work right because it's either
under so many impossibe to meet constraints, or even if
there's an achievable state workloads have to be aware of
it precisely and can never meet it for dynamic workloads.
So pushing this kind of decision to user-space was a bad idea
even with a single knob - it's exponentially worse with knobs
on every node of the topology.
There is a proposal to replace the user interface with a single
3 state knob:
sched_balance_policy := { performance, power, auto }
where 'auto' would be the preferred default which looks at things
like Battery/AC mode and possible cpufreq state or whatever the hw
exposes to show us power use expectations - but there's been no
progress on it in the past many months.
Aside from that, the actual implementation of the various knobs
is known to be broken. There have been sporadic attempts at
fixing things but these always stop short of reaching a mergable
state.
Therefore this wholesale removal with the hopes of spurring
people who care to come forward once again and work on a
coherent replacement.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1326104915.2442.53.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/cpupower/man/cpupower-set.1 | 9 | ||||
-rw-r--r-- | tools/power/cpupower/utils/helpers/sysfs.c | 35 |
2 files changed, 2 insertions, 42 deletions
diff --git a/tools/power/cpupower/man/cpupower-set.1 b/tools/power/cpupower/man/cpupower-set.1 index c4954a9fe4e7..9dbd536518ab 100644 --- a/tools/power/cpupower/man/cpupower-set.1 +++ b/tools/power/cpupower/man/cpupower-set.1 | |||
@@ -85,15 +85,6 @@ Possible values are: | |||
85 | savings | 85 | savings |
86 | .RE | 86 | .RE |
87 | 87 | ||
88 | sched_mc_power_savings is dependent upon SCHED_MC, which is | ||
89 | itself architecture dependent. | ||
90 | |||
91 | sched_smt_power_savings is dependent upon SCHED_SMT, which | ||
92 | is itself architecture dependent. | ||
93 | |||
94 | The two files are independent of each other. It is possible | ||
95 | that one file may be present without the other. | ||
96 | |||
97 | .SH "SEE ALSO" | 88 | .SH "SEE ALSO" |
98 | cpupower-info(1), cpupower-monitor(1), powertop(1) | 89 | cpupower-info(1), cpupower-monitor(1), powertop(1) |
99 | .PP | 90 | .PP |
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c index c6343024a611..96e28c124b5c 100644 --- a/tools/power/cpupower/utils/helpers/sysfs.c +++ b/tools/power/cpupower/utils/helpers/sysfs.c | |||
@@ -362,22 +362,7 @@ char *sysfs_get_cpuidle_driver(void) | |||
362 | */ | 362 | */ |
363 | int sysfs_get_sched(const char *smt_mc) | 363 | int sysfs_get_sched(const char *smt_mc) |
364 | { | 364 | { |
365 | unsigned long value; | 365 | return -ENODEV; |
366 | char linebuf[MAX_LINE_LEN]; | ||
367 | char *endp; | ||
368 | char path[SYSFS_PATH_MAX]; | ||
369 | |||
370 | if (strcmp("mc", smt_mc) && strcmp("smt", smt_mc)) | ||
371 | return -EINVAL; | ||
372 | |||
373 | snprintf(path, sizeof(path), | ||
374 | PATH_TO_CPU "sched_%s_power_savings", smt_mc); | ||
375 | if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0) | ||
376 | return -1; | ||
377 | value = strtoul(linebuf, &endp, 0); | ||
378 | if (endp == linebuf || errno == ERANGE) | ||
379 | return -1; | ||
380 | return value; | ||
381 | } | 366 | } |
382 | 367 | ||
383 | /* | 368 | /* |
@@ -388,21 +373,5 @@ int sysfs_get_sched(const char *smt_mc) | |||
388 | */ | 373 | */ |
389 | int sysfs_set_sched(const char *smt_mc, int val) | 374 | int sysfs_set_sched(const char *smt_mc, int val) |
390 | { | 375 | { |
391 | char linebuf[MAX_LINE_LEN]; | 376 | return -ENODEV; |
392 | char path[SYSFS_PATH_MAX]; | ||
393 | struct stat statbuf; | ||
394 | |||
395 | if (strcmp("mc", smt_mc) && strcmp("smt", smt_mc)) | ||
396 | return -EINVAL; | ||
397 | |||
398 | snprintf(path, sizeof(path), | ||
399 | PATH_TO_CPU "sched_%s_power_savings", smt_mc); | ||
400 | sprintf(linebuf, "%d", val); | ||
401 | |||
402 | if (stat(path, &statbuf) != 0) | ||
403 | return -ENODEV; | ||
404 | |||
405 | if (sysfs_write_file(path, linebuf, MAX_LINE_LEN) == 0) | ||
406 | return -1; | ||
407 | return 0; | ||
408 | } | 377 | } |