diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-11 11:24:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-11 11:24:32 -0500 |
commit | 94dba895333a4321f27360e42b807260ae36bda4 (patch) | |
tree | 7b6381da7ea9fc176001dda0714725c3a1dd6cc7 /kernel/sched.c | |
parent | 9ce04f9238cafcfd09a502f2bc8c13b5f44ec590 (diff) | |
parent | 4da94d49b2ecb0a26e716a8811c3ecc542c2a65d (diff) |
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
timers: fix TIMER_ABSTIME for process wide cpu timers
timers: split process wide cpu clocks/timers, fix
x86: clean up hpet timer reinit
timers: split process wide cpu clocks/timers, remove spurious warning
timers: split process wide cpu clocks/timers
signal: re-add dead task accumulation stats.
x86: fix hpet timer reinit for x86_64
sched: fix nohz load balancer on cpu offline
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 8ee437a5ec1d..e72485033c48 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3890,19 +3890,24 @@ int select_nohz_load_balancer(int stop_tick) | |||
3890 | int cpu = smp_processor_id(); | 3890 | int cpu = smp_processor_id(); |
3891 | 3891 | ||
3892 | if (stop_tick) { | 3892 | if (stop_tick) { |
3893 | cpumask_set_cpu(cpu, nohz.cpu_mask); | ||
3894 | cpu_rq(cpu)->in_nohz_recently = 1; | 3893 | cpu_rq(cpu)->in_nohz_recently = 1; |
3895 | 3894 | ||
3896 | /* | 3895 | if (!cpu_active(cpu)) { |
3897 | * If we are going offline and still the leader, give up! | 3896 | if (atomic_read(&nohz.load_balancer) != cpu) |
3898 | */ | 3897 | return 0; |
3899 | if (!cpu_active(cpu) && | 3898 | |
3900 | atomic_read(&nohz.load_balancer) == cpu) { | 3899 | /* |
3900 | * If we are going offline and still the leader, | ||
3901 | * give up! | ||
3902 | */ | ||
3901 | if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu) | 3903 | if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu) |
3902 | BUG(); | 3904 | BUG(); |
3905 | |||
3903 | return 0; | 3906 | return 0; |
3904 | } | 3907 | } |
3905 | 3908 | ||
3909 | cpumask_set_cpu(cpu, nohz.cpu_mask); | ||
3910 | |||
3906 | /* time for ilb owner also to sleep */ | 3911 | /* time for ilb owner also to sleep */ |
3907 | if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) { | 3912 | if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) { |
3908 | if (atomic_read(&nohz.load_balancer) == cpu) | 3913 | if (atomic_read(&nohz.load_balancer) == cpu) |