aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-09-21 16:22:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-09-21 16:22:10 -0400
commit1ce1e41c1b61a992077bd1c45c6c3fd6a8b10c02 (patch)
tree33d958f957e77c93612b027deb91f2e81b08d372 /kernel
parent87ac6fa26e0e7ea49e1c8030e962effc05e1c5eb (diff)
parentf6c3f1686e7ec1dd8725a9a3dcb857dfd0c7a5bf (diff)
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched: Fix nohz balance kick sched: Fix user time incorrectly accounted as system time on 32-bit
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c8
-rw-r--r--kernel/sched_fair.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index ed09d4f2a69c..dc85ceb90832 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3513,9 +3513,9 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
3513 rtime = nsecs_to_cputime(p->se.sum_exec_runtime); 3513 rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
3514 3514
3515 if (total) { 3515 if (total) {
3516 u64 temp; 3516 u64 temp = rtime;
3517 3517
3518 temp = (u64)(rtime * utime); 3518 temp *= utime;
3519 do_div(temp, total); 3519 do_div(temp, total);
3520 utime = (cputime_t)temp; 3520 utime = (cputime_t)temp;
3521 } else 3521 } else
@@ -3546,9 +3546,9 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
3546 rtime = nsecs_to_cputime(cputime.sum_exec_runtime); 3546 rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
3547 3547
3548 if (total) { 3548 if (total) {
3549 u64 temp; 3549 u64 temp = rtime;
3550 3550
3551 temp = (u64)(rtime * cputime.utime); 3551 temp *= cputime.utime;
3552 do_div(temp, total); 3552 do_div(temp, total);
3553 utime = (cputime_t)temp; 3553 utime = (cputime_t)temp;
3554 } else 3554 } else
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index a171138a9402..db3f674ca49d 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -3630,7 +3630,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
3630 if (time_before(now, nohz.next_balance)) 3630 if (time_before(now, nohz.next_balance))
3631 return 0; 3631 return 0;
3632 3632
3633 if (!rq->nr_running) 3633 if (rq->idle_at_tick)
3634 return 0; 3634 return 0;
3635 3635
3636 first_pick_cpu = atomic_read(&nohz.first_pick_cpu); 3636 first_pick_cpu = atomic_read(&nohz.first_pick_cpu);