summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2005-01-14 23:14:53 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-14 23:14:53 -0800
commitd61a371b7cd0638d43b2808b535bdf408d2031bc (patch)
tree5586044f00b169c6676f0d52c1c2c663bb0b0bf0 /kernel
parentec6d84c7ef684a0b85d15c50dadef9a039574d03 (diff)
[PATCH] cputime: s/390: fix account_steal_time.
account_steal_time called for idle doesn't work correctly: 1) steal time while idle needs to be added to the system time of idle to get correct uptime numbers 3) if there is an i/o request outstanding the steal time should be added to iowait, even if the hypervisor scheduled another virtual cpu since we are still waiting for i/o. 2) steal time while idle without an i/o request outstanding has to be added to cpustat->idle and not to cpustat->system. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 9e1fbc42bd01..78c228199494 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2383,13 +2383,17 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
void account_steal_time(struct task_struct *p, cputime_t steal)
{
struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
- cputime64_t steal64 = cputime_to_cputime64(steal);
+ cputime64_t tmp = cputime_to_cputime64(steal);
runqueue_t *rq = this_rq();
- if (p == rq->idle)
- cpustat->system = cputime64_add(cpustat->system, steal64);
- else
- cpustat->steal = cputime64_add(cpustat->steal, steal64);
+ if (p == rq->idle) {
+ p->stime = cputime_add(p->stime, steal);
+ if (atomic_read(&rq->nr_iowait) > 0)
+ cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
+ else
+ cpustat->idle = cputime64_add(cpustat->idle, tmp);
+ } else
+ cpustat->steal = cputime64_add(cpustat->steal, tmp);
}
/*