diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 52bbf1c842a8..61245b8d0f16 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3880,19 +3880,24 @@ int select_nohz_load_balancer(int stop_tick) | |||
3880 | int cpu = smp_processor_id(); | 3880 | int cpu = smp_processor_id(); |
3881 | 3881 | ||
3882 | if (stop_tick) { | 3882 | if (stop_tick) { |
3883 | cpumask_set_cpu(cpu, nohz.cpu_mask); | ||
3884 | cpu_rq(cpu)->in_nohz_recently = 1; | 3883 | cpu_rq(cpu)->in_nohz_recently = 1; |
3885 | 3884 | ||
3886 | /* | 3885 | if (!cpu_active(cpu)) { |
3887 | * If we are going offline and still the leader, give up! | 3886 | if (atomic_read(&nohz.load_balancer) != cpu) |
3888 | */ | 3887 | return 0; |
3889 | if (!cpu_active(cpu) && | 3888 | |
3890 | atomic_read(&nohz.load_balancer) == cpu) { | 3889 | /* |
3890 | * If we are going offline and still the leader, | ||
3891 | * give up! | ||
3892 | */ | ||
3891 | if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu) | 3893 | if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu) |
3892 | BUG(); | 3894 | BUG(); |
3895 | |||
3893 | return 0; | 3896 | return 0; |
3894 | } | 3897 | } |
3895 | 3898 | ||
3899 | cpumask_set_cpu(cpu, nohz.cpu_mask); | ||
3900 | |||
3896 | /* time for ilb owner also to sleep */ | 3901 | /* time for ilb owner also to sleep */ |
3897 | if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) { | 3902 | if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) { |
3898 | if (atomic_read(&nohz.load_balancer) == cpu) | 3903 | if (atomic_read(&nohz.load_balancer) == cpu) |
@@ -4687,8 +4692,8 @@ EXPORT_SYMBOL(default_wake_function); | |||
4687 | * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns | 4692 | * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns |
4688 | * zero in this (rare) case, and we handle it by continuing to scan the queue. | 4693 | * zero in this (rare) case, and we handle it by continuing to scan the queue. |
4689 | */ | 4694 | */ |
4690 | static void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | 4695 | void __wake_up_common(wait_queue_head_t *q, unsigned int mode, |
4691 | int nr_exclusive, int sync, void *key) | 4696 | int nr_exclusive, int sync, void *key) |
4692 | { | 4697 | { |
4693 | wait_queue_t *curr, *next; | 4698 | wait_queue_t *curr, *next; |
4694 | 4699 | ||
@@ -5939,12 +5944,7 @@ void sched_show_task(struct task_struct *p) | |||
5939 | printk(KERN_CONT " %016lx ", thread_saved_pc(p)); | 5944 | printk(KERN_CONT " %016lx ", thread_saved_pc(p)); |
5940 | #endif | 5945 | #endif |
5941 | #ifdef CONFIG_DEBUG_STACK_USAGE | 5946 | #ifdef CONFIG_DEBUG_STACK_USAGE |
5942 | { | 5947 | free = stack_not_used(p); |
5943 | unsigned long *n = end_of_stack(p); | ||
5944 | while (!*n) | ||
5945 | n++; | ||
5946 | free = (unsigned long)n - (unsigned long)end_of_stack(p); | ||
5947 | } | ||
5948 | #endif | 5948 | #endif |
5949 | printk(KERN_CONT "%5lu %5d %6d\n", free, | 5949 | printk(KERN_CONT "%5lu %5d %6d\n", free, |
5950 | task_pid_nr(p), task_pid_nr(p->real_parent)); | 5950 | task_pid_nr(p), task_pid_nr(p->real_parent)); |