diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-03 14:56:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-03 14:56:24 -0500 |
commit | 61420f59a589c0668f70cbe725785837c78ece90 (patch) | |
tree | 79ae77d731cd2425677b9527d50079d8cf34c3b2 /arch/powerpc/kernel | |
parent | d97106ab53f812910a62d18afb9dbe882819c1ba (diff) | |
parent | c742b31c03f37c5c499178f09f57381aa6c70131 (diff) |
Merge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
[PATCH] improve idle cputime accounting
[PATCH] improve precision of idle time detection.
[PATCH] improve precision of process accounting.
[PATCH] idle cputime accounting
[PATCH] fix scaled & unscaled cputime accounting
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/time.c | 18 |
2 files changed, 12 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 51b201ddf9a1..fb7049c054c0 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/mqueue.h> | 33 | #include <linux/mqueue.h> |
34 | #include <linux/hardirq.h> | 34 | #include <linux/hardirq.h> |
35 | #include <linux/utsname.h> | 35 | #include <linux/utsname.h> |
36 | #include <linux/kernel_stat.h> | ||
36 | 37 | ||
37 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
38 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 99f1ddd68582..c9564031a2a9 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -256,8 +256,10 @@ void account_system_vtime(struct task_struct *tsk) | |||
256 | delta += sys_time; | 256 | delta += sys_time; |
257 | get_paca()->system_time = 0; | 257 | get_paca()->system_time = 0; |
258 | } | 258 | } |
259 | account_system_time(tsk, 0, delta); | 259 | if (in_irq() || idle_task(smp_processor_id()) != tsk) |
260 | account_system_time_scaled(tsk, deltascaled); | 260 | account_system_time(tsk, 0, delta, deltascaled); |
261 | else | ||
262 | account_idle_time(delta); | ||
261 | per_cpu(cputime_last_delta, smp_processor_id()) = delta; | 263 | per_cpu(cputime_last_delta, smp_processor_id()) = delta; |
262 | per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled; | 264 | per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled; |
263 | local_irq_restore(flags); | 265 | local_irq_restore(flags); |
@@ -275,10 +277,8 @@ void account_process_tick(struct task_struct *tsk, int user_tick) | |||
275 | 277 | ||
276 | utime = get_paca()->user_time; | 278 | utime = get_paca()->user_time; |
277 | get_paca()->user_time = 0; | 279 | get_paca()->user_time = 0; |
278 | account_user_time(tsk, utime); | ||
279 | |||
280 | utimescaled = cputime_to_scaled(utime); | 280 | utimescaled = cputime_to_scaled(utime); |
281 | account_user_time_scaled(tsk, utimescaled); | 281 | account_user_time(tsk, utime, utimescaled); |
282 | } | 282 | } |
283 | 283 | ||
284 | /* | 284 | /* |
@@ -338,8 +338,12 @@ void calculate_steal_time(void) | |||
338 | tb = mftb(); | 338 | tb = mftb(); |
339 | purr = mfspr(SPRN_PURR); | 339 | purr = mfspr(SPRN_PURR); |
340 | stolen = (tb - pme->tb) - (purr - pme->purr); | 340 | stolen = (tb - pme->tb) - (purr - pme->purr); |
341 | if (stolen > 0) | 341 | if (stolen > 0) { |
342 | account_steal_time(current, stolen); | 342 | if (idle_task(smp_processor_id()) != current) |
343 | account_steal_time(stolen); | ||
344 | else | ||
345 | account_idle_time(stolen); | ||
346 | } | ||
343 | pme->tb = tb; | 347 | pme->tb = tb; |
344 | pme->purr = purr; | 348 | pme->purr = purr; |
345 | } | 349 | } |