diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/cputime.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 53f5b12f2821..81b763ba58a6 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c | |||
| @@ -432,6 +432,32 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st) | |||
| 432 | *ut = cputime.utime; | 432 | *ut = cputime.utime; |
| 433 | *st = cputime.stime; | 433 | *st = cputime.stime; |
| 434 | } | 434 | } |
| 435 | |||
| 436 | /* | ||
| 437 | * Archs that account the whole time spent in the idle task | ||
| 438 | * (outside irq) as idle time can rely on this and just implement | ||
| 439 | * vtime_account_system() and vtime_account_idle(). Archs that | ||
| 440 | * have other meaning of the idle time (s390 only includes the | ||
| 441 | * time spent by the CPU when it's in low power mode) must override | ||
| 442 | * vtime_account(). | ||
| 443 | */ | ||
| 444 | #ifndef __ARCH_HAS_VTIME_ACCOUNT | ||
| 445 | void vtime_account(struct task_struct *tsk) | ||
| 446 | { | ||
| 447 | unsigned long flags; | ||
| 448 | |||
| 449 | local_irq_save(flags); | ||
| 450 | |||
| 451 | if (in_interrupt() || !is_idle_task(tsk)) | ||
| 452 | vtime_account_system(tsk); | ||
| 453 | else | ||
| 454 | vtime_account_idle(tsk); | ||
| 455 | |||
| 456 | local_irq_restore(flags); | ||
| 457 | } | ||
| 458 | EXPORT_SYMBOL_GPL(vtime_account); | ||
| 459 | #endif /* __ARCH_HAS_VTIME_ACCOUNT */ | ||
| 460 | |||
| 435 | #else | 461 | #else |
| 436 | 462 | ||
| 437 | #ifndef nsecs_to_cputime | 463 | #ifndef nsecs_to_cputime |
