aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-05-08 08:07:48 -0400
committerThomas Gleixner <tglx@linutronix.de>2012-05-08 08:07:48 -0400
commit67ba5293f705eb1d1b98710e5ccb0f615936a6fc (patch)
treecdb4cfd94033b5c0f42eeb4de368802049880a12 /kernel/sched
parent86627c93b35082f7a0e4d3111546943984b932c7 (diff)
parentd909a81b198a397593495508c4a5755fe95552fb (diff)
Merge branch 'smp/threadalloc' into smp/hotplug
Reason: Pull in the separate branch which was created so arch/tile can base further work on it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c22
-rw-r--r--kernel/sched/fair.c18
-rw-r--r--kernel/sched/features.h1
3 files changed, 27 insertions, 14 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6a63cde23d03..7b77e3b84b4f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6406,16 +6406,26 @@ static void __sdt_free(const struct cpumask *cpu_map)
6406 struct sd_data *sdd = &tl->data; 6406 struct sd_data *sdd = &tl->data;
6407 6407
6408 for_each_cpu(j, cpu_map) { 6408 for_each_cpu(j, cpu_map) {
6409 struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); 6409 struct sched_domain *sd;
6410 if (sd && (sd->flags & SD_OVERLAP)) 6410
6411 free_sched_groups(sd->groups, 0); 6411 if (sdd->sd) {
6412 kfree(*per_cpu_ptr(sdd->sd, j)); 6412 sd = *per_cpu_ptr(sdd->sd, j);
6413 kfree(*per_cpu_ptr(sdd->sg, j)); 6413 if (sd && (sd->flags & SD_OVERLAP))
6414 kfree(*per_cpu_ptr(sdd->sgp, j)); 6414 free_sched_groups(sd->groups, 0);
6415 kfree(*per_cpu_ptr(sdd->sd, j));
6416 }
6417
6418 if (sdd->sg)
6419 kfree(*per_cpu_ptr(sdd->sg, j));
6420 if (sdd->sgp)
6421 kfree(*per_cpu_ptr(sdd->sgp, j));
6415 } 6422 }
6416 free_percpu(sdd->sd); 6423 free_percpu(sdd->sd);
6424 sdd->sd = NULL;
6417 free_percpu(sdd->sg); 6425 free_percpu(sdd->sg);
6426 sdd->sg = NULL;
6418 free_percpu(sdd->sgp); 6427 free_percpu(sdd->sgp);
6428 sdd->sgp = NULL;
6419 } 6429 }
6420} 6430}
6421 6431
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0d97ebdc58f0..e9553640c1c3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -784,7 +784,7 @@ account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
784 update_load_add(&rq_of(cfs_rq)->load, se->load.weight); 784 update_load_add(&rq_of(cfs_rq)->load, se->load.weight);
785#ifdef CONFIG_SMP 785#ifdef CONFIG_SMP
786 if (entity_is_task(se)) 786 if (entity_is_task(se))
787 list_add_tail(&se->group_node, &rq_of(cfs_rq)->cfs_tasks); 787 list_add(&se->group_node, &rq_of(cfs_rq)->cfs_tasks);
788#endif 788#endif
789 cfs_rq->nr_running++; 789 cfs_rq->nr_running++;
790} 790}
@@ -3215,6 +3215,8 @@ static int move_one_task(struct lb_env *env)
3215 3215
3216static unsigned long task_h_load(struct task_struct *p); 3216static unsigned long task_h_load(struct task_struct *p);
3217 3217
3218static const unsigned int sched_nr_migrate_break = 32;
3219
3218/* 3220/*
3219 * move_tasks tries to move up to load_move weighted load from busiest to 3221 * move_tasks tries to move up to load_move weighted load from busiest to
3220 * this_rq, as part of a balancing operation within domain "sd". 3222 * this_rq, as part of a balancing operation within domain "sd".
@@ -3242,7 +3244,7 @@ static int move_tasks(struct lb_env *env)
3242 3244
3243 /* take a breather every nr_migrate tasks */ 3245 /* take a breather every nr_migrate tasks */
3244 if (env->loop > env->loop_break) { 3246 if (env->loop > env->loop_break) {
3245 env->loop_break += sysctl_sched_nr_migrate; 3247 env->loop_break += sched_nr_migrate_break;
3246 env->flags |= LBF_NEED_BREAK; 3248 env->flags |= LBF_NEED_BREAK;
3247 break; 3249 break;
3248 } 3250 }
@@ -3252,7 +3254,7 @@ static int move_tasks(struct lb_env *env)
3252 3254
3253 load = task_h_load(p); 3255 load = task_h_load(p);
3254 3256
3255 if (load < 16 && !env->sd->nr_balance_failed) 3257 if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed)
3256 goto next; 3258 goto next;
3257 3259
3258 if ((load / 2) > env->load_move) 3260 if ((load / 2) > env->load_move)
@@ -4407,7 +4409,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
4407 .dst_cpu = this_cpu, 4409 .dst_cpu = this_cpu,
4408 .dst_rq = this_rq, 4410 .dst_rq = this_rq,
4409 .idle = idle, 4411 .idle = idle,
4410 .loop_break = sysctl_sched_nr_migrate, 4412 .loop_break = sched_nr_migrate_break,
4411 }; 4413 };
4412 4414
4413 cpumask_copy(cpus, cpu_active_mask); 4415 cpumask_copy(cpus, cpu_active_mask);
@@ -4445,10 +4447,10 @@ redo:
4445 * correctly treated as an imbalance. 4447 * correctly treated as an imbalance.
4446 */ 4448 */
4447 env.flags |= LBF_ALL_PINNED; 4449 env.flags |= LBF_ALL_PINNED;
4448 env.load_move = imbalance; 4450 env.load_move = imbalance;
4449 env.src_cpu = busiest->cpu; 4451 env.src_cpu = busiest->cpu;
4450 env.src_rq = busiest; 4452 env.src_rq = busiest;
4451 env.loop_max = busiest->nr_running; 4453 env.loop_max = min_t(unsigned long, sysctl_sched_nr_migrate, busiest->nr_running);
4452 4454
4453more_balance: 4455more_balance:
4454 local_irq_save(flags); 4456 local_irq_save(flags);
diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index e61fd73913d0..de00a486c5c6 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -68,3 +68,4 @@ SCHED_FEAT(TTWU_QUEUE, true)
68 68
69SCHED_FEAT(FORCE_SD_OVERLAP, false) 69SCHED_FEAT(FORCE_SD_OVERLAP, false)
70SCHED_FEAT(RT_RUNTIME_SHARE, true) 70SCHED_FEAT(RT_RUNTIME_SHARE, true)
71SCHED_FEAT(LB_MIN, false)