Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar.

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched: Fix OOPS when build_sched_domains() percpu allocation fails
sched: Fix more load-balancing fallout

+27 -14
+16 -6
kernel/sched/core.c
··· 6405 6405 struct sd_data *sdd = &tl->data; 6406 6406 6407 6407 for_each_cpu(j, cpu_map) { 6408 - struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); 6409 - if (sd && (sd->flags & SD_OVERLAP)) 6410 - free_sched_groups(sd->groups, 0); 6411 - kfree(*per_cpu_ptr(sdd->sd, j)); 6412 - kfree(*per_cpu_ptr(sdd->sg, j)); 6413 - kfree(*per_cpu_ptr(sdd->sgp, j)); 6408 + struct sched_domain *sd; 6409 + 6410 + if (sdd->sd) { 6411 + sd = *per_cpu_ptr(sdd->sd, j); 6412 + if (sd && (sd->flags & SD_OVERLAP)) 6413 + free_sched_groups(sd->groups, 0); 6414 + kfree(*per_cpu_ptr(sdd->sd, j)); 6415 + } 6416 + 6417 + if (sdd->sg) 6418 + kfree(*per_cpu_ptr(sdd->sg, j)); 6419 + if (sdd->sgp) 6420 + kfree(*per_cpu_ptr(sdd->sgp, j)); 6414 6421 } 6415 6422 free_percpu(sdd->sd); 6423 + sdd->sd = NULL; 6416 6424 free_percpu(sdd->sg); 6425 + sdd->sg = NULL; 6417 6426 free_percpu(sdd->sgp); 6427 + sdd->sgp = NULL; 6418 6428 } 6419 6429 } 6420 6430
+10 -8
kernel/sched/fair.c
··· 784 784 update_load_add(&rq_of(cfs_rq)->load, se->load.weight); 785 785 #ifdef CONFIG_SMP 786 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 788 #endif 789 789 cfs_rq->nr_running++; 790 790 } ··· 3215 3215 3216 3216 static unsigned long task_h_load(struct task_struct *p); 3217 3217 3218 + static const unsigned int sched_nr_migrate_break = 32; 3219 + 3218 3220 /* 3219 3221 * move_tasks tries to move up to load_move weighted load from busiest to 3220 3222 * this_rq, as part of a balancing operation within domain "sd". ··· 3244 3242 3245 3243 /* take a breather every nr_migrate tasks */ 3246 3244 if (env->loop > env->loop_break) { 3247 - env->loop_break += sysctl_sched_nr_migrate; 3245 + env->loop_break += sched_nr_migrate_break; 3248 3246 env->flags |= LBF_NEED_BREAK; 3249 3247 break; 3250 3248 } ··· 3254 3252 3255 3253 load = task_h_load(p); 3256 3254 3257 - if (load < 16 && !env->sd->nr_balance_failed) 3255 + if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed) 3258 3256 goto next; 3259 3257 3260 3258 if ((load / 2) > env->load_move) ··· 4409 4407 .dst_cpu = this_cpu, 4410 4408 .dst_rq = this_rq, 4411 4409 .idle = idle, 4412 - .loop_break = sysctl_sched_nr_migrate, 4410 + .loop_break = sched_nr_migrate_break, 4413 4411 }; 4414 4412 4415 4413 cpumask_copy(cpus, cpu_active_mask); ··· 4447 4445 * correctly treated as an imbalance. 4448 4446 */ 4449 4447 env.flags |= LBF_ALL_PINNED; 4450 - env.load_move = imbalance; 4451 - env.src_cpu = busiest->cpu; 4452 - env.src_rq = busiest; 4453 - env.loop_max = busiest->nr_running; 4448 + env.load_move = imbalance; 4449 + env.src_cpu = busiest->cpu; 4450 + env.src_rq = busiest; 4451 + env.loop_max = min_t(unsigned long, sysctl_sched_nr_migrate, busiest->nr_running); 4454 4452 4455 4453 more_balance: 4456 4454 local_irq_save(flags);
+1
kernel/sched/features.h
··· 68 68 69 69 SCHED_FEAT(FORCE_SD_OVERLAP, false) 70 70 SCHED_FEAT(RT_RUNTIME_SHARE, true) 71 + SCHED_FEAT(LB_MIN, false)