aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0952931ca7f6..83b68ff6df80 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2311,16 +2311,6 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
2311 if (!sched_feat(SYNC_WAKEUPS)) 2311 if (!sched_feat(SYNC_WAKEUPS))
2312 sync = 0; 2312 sync = 0;
2313 2313
2314 if (!sync) {
2315 if (current->se.avg_overlap < sysctl_sched_migration_cost &&
2316 p->se.avg_overlap < sysctl_sched_migration_cost)
2317 sync = 1;
2318 } else {
2319 if (current->se.avg_overlap >= sysctl_sched_migration_cost ||
2320 p->se.avg_overlap >= sysctl_sched_migration_cost)
2321 sync = 0;
2322 }
2323
2324#ifdef CONFIG_SMP 2314#ifdef CONFIG_SMP
2325 if (sched_feat(LB_WAKEUP_UPDATE)) { 2315 if (sched_feat(LB_WAKEUP_UPDATE)) {
2326 struct sched_domain *sd; 2316 struct sched_domain *sd;
@@ -3952,19 +3942,24 @@ int select_nohz_load_balancer(int stop_tick)
3952 int cpu = smp_processor_id(); 3942 int cpu = smp_processor_id();
3953 3943
3954 if (stop_tick) { 3944 if (stop_tick) {
3955 cpumask_set_cpu(cpu, nohz.cpu_mask);
3956 cpu_rq(cpu)->in_nohz_recently = 1; 3945 cpu_rq(cpu)->in_nohz_recently = 1;
3957 3946
3958 /* 3947 if (!cpu_active(cpu)) {
3959 * If we are going offline and still the leader, give up! 3948 if (atomic_read(&nohz.load_balancer) != cpu)
3960 */ 3949 return 0;
3961 if (!cpu_active(cpu) && 3950
3962 atomic_read(&nohz.load_balancer) == cpu) { 3951 /*
3952 * If we are going offline and still the leader,
3953 * give up!
3954 */
3963 if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu) 3955 if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu)
3964 BUG(); 3956 BUG();
3957
3965 return 0; 3958 return 0;
3966 } 3959 }
3967 3960
3961 cpumask_set_cpu(cpu, nohz.cpu_mask);
3962
3968 /* time for ilb owner also to sleep */ 3963 /* time for ilb owner also to sleep */
3969 if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) { 3964 if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) {
3970 if (atomic_read(&nohz.load_balancer) == cpu) 3965 if (atomic_read(&nohz.load_balancer) == cpu)