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 tag 'sched-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
"Various fixes: a deadline scheduler fix, a migration fix, a Sparse fix
and a comment fix"

* tag 'sched-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/core: Do not requeue task on CPU excluded from cpus_mask
sched/rt: Fix Sparse warnings due to undefined rt.c declarations
exit: Fix typo in comment: s/sub-theads/sub-threads
sched, cpuset: Fix dl_cpu_busy() panic due to empty cs->cpus_allowed

+18 -11
+1 -1
include/linux/sched.h
··· 1825 1825 } 1826 1826 1827 1827 extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpumask *trial); 1828 - extern int task_can_attach(struct task_struct *p, const struct cpumask *cs_cpus_allowed); 1828 + extern int task_can_attach(struct task_struct *p, const struct cpumask *cs_effective_cpus); 1829 1829 #ifdef CONFIG_SMP 1830 1830 extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask); 1831 1831 extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask);
+1 -1
kernel/cgroup/cpuset.c
··· 2239 2239 goto out_unlock; 2240 2240 2241 2241 cgroup_taskset_for_each(task, css, tset) { 2242 - ret = task_can_attach(task, cs->cpus_allowed); 2242 + ret = task_can_attach(task, cs->effective_cpus); 2243 2243 if (ret) 2244 2244 goto out_unlock; 2245 2245 ret = security_task_setscheduler(task);
+1 -1
kernel/exit.c
··· 1051 1051 * p->signal fields because the whole thread group is dead 1052 1052 * and nobody can change them. 1053 1053 * 1054 - * psig->stats_lock also protects us from our sub-theads 1054 + * psig->stats_lock also protects us from our sub-threads 1055 1055 * which can reap other children at the same time. Until 1056 1056 * we change k_getrusage()-like users to rely on this lock 1057 1057 * we have to take ->siglock as well.
+11 -5
kernel/sched/core.c
··· 3802 3802 return per_cpu(sd_llc_id, this_cpu) == per_cpu(sd_llc_id, that_cpu); 3803 3803 } 3804 3804 3805 - static inline bool ttwu_queue_cond(int cpu) 3805 + static inline bool ttwu_queue_cond(struct task_struct *p, int cpu) 3806 3806 { 3807 3807 /* 3808 3808 * Do not complicate things with the async wake_list while the CPU is 3809 3809 * in hotplug state. 3810 3810 */ 3811 3811 if (!cpu_active(cpu)) 3812 + return false; 3813 + 3814 + /* Ensure the task will still be allowed to run on the CPU. */ 3815 + if (!cpumask_test_cpu(cpu, p->cpus_ptr)) 3812 3816 return false; 3813 3817 3814 3818 /* ··· 3844 3840 3845 3841 static bool ttwu_queue_wakelist(struct task_struct *p, int cpu, int wake_flags) 3846 3842 { 3847 - if (sched_feat(TTWU_QUEUE) && ttwu_queue_cond(cpu)) { 3843 + if (sched_feat(TTWU_QUEUE) && ttwu_queue_cond(p, cpu)) { 3848 3844 sched_clock_cpu(cpu); /* Sync clocks across CPUs */ 3849 3845 __ttwu_queue_wakelist(p, cpu, wake_flags); 3850 3846 return true; ··· 9016 9012 } 9017 9013 9018 9014 int task_can_attach(struct task_struct *p, 9019 - const struct cpumask *cs_cpus_allowed) 9015 + const struct cpumask *cs_effective_cpus) 9020 9016 { 9021 9017 int ret = 0; 9022 9018 ··· 9035 9031 } 9036 9032 9037 9033 if (dl_task(p) && !cpumask_intersects(task_rq(p)->rd->span, 9038 - cs_cpus_allowed)) { 9039 - int cpu = cpumask_any_and(cpu_active_mask, cs_cpus_allowed); 9034 + cs_effective_cpus)) { 9035 + int cpu = cpumask_any_and(cpu_active_mask, cs_effective_cpus); 9040 9036 9037 + if (unlikely(cpu >= nr_cpu_ids)) 9038 + return -EINVAL; 9041 9039 ret = dl_cpu_busy(cpu, p); 9042 9040 } 9043 9041
+4 -3
kernel/sched/sched.h
··· 481 481 extern void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b); 482 482 extern void unthrottle_cfs_rq(struct cfs_rq *cfs_rq); 483 483 484 - extern void unregister_rt_sched_group(struct task_group *tg); 485 - extern void free_rt_sched_group(struct task_group *tg); 486 - extern int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent); 487 484 extern void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq, 488 485 struct sched_rt_entity *rt_se, int cpu, 489 486 struct sched_rt_entity *parent); ··· 517 520 struct cfs_bandwidth { }; 518 521 519 522 #endif /* CONFIG_CGROUP_SCHED */ 523 + 524 + extern void unregister_rt_sched_group(struct task_group *tg); 525 + extern void free_rt_sched_group(struct task_group *tg); 526 + extern int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent); 520 527 521 528 /* 522 529 * u64_u32_load/u64_u32_store