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:
"Misc fixes"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/deadline: Fix deadline parameter modification handling
sched/wait: Remove might_sleep() from wait_event_cmd()
sched: Fix crash if cpuset_cpumask_can_shrink() is passed an empty cpumask
sched/fair: Avoid using uninitialized variable in preferred_group_nid()

+34 -8
-1
include/linux/wait.h
··· 363 363 */ 364 364 #define wait_event_cmd(wq, condition, cmd1, cmd2) \ 365 365 do { \ 366 - might_sleep(); \ 367 366 if (condition) \ 368 367 break; \ 369 368 __wait_event_cmd(wq, condition, cmd1, cmd2); \
+31 -5
kernel/sched/core.c
··· 1814 1814 dl_se->dl_period = 0; 1815 1815 dl_se->flags = 0; 1816 1816 dl_se->dl_bw = 0; 1817 + 1818 + dl_se->dl_throttled = 0; 1819 + dl_se->dl_new = 1; 1820 + dl_se->dl_yielded = 0; 1817 1821 } 1818 1822 1819 1823 /* ··· 1843 1839 #endif 1844 1840 1845 1841 RB_CLEAR_NODE(&p->dl.rb_node); 1846 - hrtimer_init(&p->dl.dl_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1842 + init_dl_task_timer(&p->dl); 1847 1843 __dl_clear_params(p); 1848 1844 1849 1845 INIT_LIST_HEAD(&p->rt.run_list); ··· 2053 2049 * allocated bandwidth to reflect the new situation. 2054 2050 * 2055 2051 * This function is called while holding p's rq->lock. 2052 + * 2053 + * XXX we should delay bw change until the task's 0-lag point, see 2054 + * __setparam_dl(). 2056 2055 */ 2057 2056 static int dl_overflow(struct task_struct *p, int policy, 2058 2057 const struct sched_attr *attr) ··· 3258 3251 { 3259 3252 struct sched_dl_entity *dl_se = &p->dl; 3260 3253 3261 - init_dl_task_timer(dl_se); 3262 3254 dl_se->dl_runtime = attr->sched_runtime; 3263 3255 dl_se->dl_deadline = attr->sched_deadline; 3264 3256 dl_se->dl_period = attr->sched_period ?: dl_se->dl_deadline; 3265 3257 dl_se->flags = attr->sched_flags; 3266 3258 dl_se->dl_bw = to_ratio(dl_se->dl_period, dl_se->dl_runtime); 3267 - dl_se->dl_throttled = 0; 3268 - dl_se->dl_new = 1; 3269 - dl_se->dl_yielded = 0; 3259 + 3260 + /* 3261 + * Changing the parameters of a task is 'tricky' and we're not doing 3262 + * the correct thing -- also see task_dead_dl() and switched_from_dl(). 3263 + * 3264 + * What we SHOULD do is delay the bandwidth release until the 0-lag 3265 + * point. This would include retaining the task_struct until that time 3266 + * and change dl_overflow() to not immediately decrement the current 3267 + * amount. 3268 + * 3269 + * Instead we retain the current runtime/deadline and let the new 3270 + * parameters take effect after the current reservation period lapses. 3271 + * This is safe (albeit pessimistic) because the 0-lag point is always 3272 + * before the current scheduling deadline. 3273 + * 3274 + * We can still have temporary overloads because we do not delay the 3275 + * change in bandwidth until that time; so admission control is 3276 + * not on the safe side. It does however guarantee tasks will never 3277 + * consume more than promised. 3278 + */ 3270 3279 } 3271 3280 3272 3281 /* ··· 4664 4641 int ret = 1, trial_cpus; 4665 4642 struct dl_bw *cur_dl_b; 4666 4643 unsigned long flags; 4644 + 4645 + if (!cpumask_weight(cur)) 4646 + return ret; 4667 4647 4668 4648 rcu_read_lock_sched(); 4669 4649 cur_dl_b = dl_bw_of(cpumask_any(cur));
+2 -1
kernel/sched/deadline.c
··· 1094 1094 * Since we are TASK_DEAD we won't slip out of the domain! 1095 1095 */ 1096 1096 raw_spin_lock_irq(&dl_b->lock); 1097 + /* XXX we should retain the bw until 0-lag */ 1097 1098 dl_b->total_bw -= p->dl.dl_bw; 1098 1099 raw_spin_unlock_irq(&dl_b->lock); 1099 1100 ··· 1615 1614 1616 1615 static void switched_from_dl(struct rq *rq, struct task_struct *p) 1617 1616 { 1617 + /* XXX we should retain the bw until 0-lag */ 1618 1618 cancel_dl_timer(rq, p); 1619 - 1620 1619 __dl_clear_params(p); 1621 1620 1622 1621 /*
+1 -1
kernel/sched/fair.c
··· 1730 1730 nodes = node_online_map; 1731 1731 for (dist = sched_max_numa_distance; dist > LOCAL_DISTANCE; dist--) { 1732 1732 unsigned long max_faults = 0; 1733 - nodemask_t max_group; 1733 + nodemask_t max_group = NODE_MASK_NONE; 1734 1734 int a, b; 1735 1735 1736 1736 /* Are there nodes at this distance from each other? */