diff options
author | Tony Breeds <tony@bakeyournoodle.com> | 2008-03-17 01:23:29 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-03-25 17:44:05 -0400 |
commit | 96366a8d3f17ee964802378d4a1f51fda86f070e (patch) | |
tree | 80ee328c588a1fbef0134c3ffcd8bb07267a22d8 /arch/powerpc/platforms/pseries/setup.c | |
parent | 71e91a0abb839f8d2372236d8fe0513c295ec717 (diff) |
[POWERPC] Update wait_state_cycles in the VPA
The hypervisor can look at the value in the wait_state_cycles field of
the VPA for an estimate of how busy dedicated processors are.
Currently, as the kernel never touches this field, we appear to be
100% busy. This records the duration the kernel is in powersave and
passes that to the HV to provide a reasonable indication of
utilisation.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/setup.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index fdb9b1c8f977..90555a39fe62 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -393,6 +393,7 @@ static void pseries_dedicated_idle_sleep(void) | |||
393 | { | 393 | { |
394 | unsigned int cpu = smp_processor_id(); | 394 | unsigned int cpu = smp_processor_id(); |
395 | unsigned long start_snooze; | 395 | unsigned long start_snooze; |
396 | unsigned long in_purr, out_purr; | ||
396 | 397 | ||
397 | /* | 398 | /* |
398 | * Indicate to the HV that we are idle. Now would be | 399 | * Indicate to the HV that we are idle. Now would be |
@@ -400,6 +401,7 @@ static void pseries_dedicated_idle_sleep(void) | |||
400 | */ | 401 | */ |
401 | get_lppaca()->idle = 1; | 402 | get_lppaca()->idle = 1; |
402 | get_lppaca()->donate_dedicated_cpu = 1; | 403 | get_lppaca()->donate_dedicated_cpu = 1; |
404 | in_purr = mfspr(SPRN_PURR); | ||
403 | 405 | ||
404 | /* | 406 | /* |
405 | * We come in with interrupts disabled, and need_resched() | 407 | * We come in with interrupts disabled, and need_resched() |
@@ -432,6 +434,8 @@ static void pseries_dedicated_idle_sleep(void) | |||
432 | 434 | ||
433 | out: | 435 | out: |
434 | HMT_medium(); | 436 | HMT_medium(); |
437 | out_purr = mfspr(SPRN_PURR); | ||
438 | get_lppaca()->wait_state_cycles += out_purr - in_purr; | ||
435 | get_lppaca()->donate_dedicated_cpu = 0; | 439 | get_lppaca()->donate_dedicated_cpu = 0; |
436 | get_lppaca()->idle = 0; | 440 | get_lppaca()->idle = 0; |
437 | } | 441 | } |