diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-21 20:21:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-21 20:21:34 -0400 |
commit | 48b1db7c7a952b5e7021826e727baedae35d7f3f (patch) | |
tree | ccf8c0d1ff6e214feb7c1c66728d6366cb99d586 | |
parent | ea75a2c715a4bf682c756d4754665fb3595f3531 (diff) | |
parent | e117cb52bdb4d376b711bee34af6434c9e314b3b (diff) |
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar:
"Two fixes: a stop-machine preemption fix and a SCHED_DEADLINE fix"
* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/deadline: Fix switched_from_dl() warning
stop_machine: Disable preemption when waking two stopper threads
-rw-r--r-- | kernel/sched/deadline.c | 11 | ||||
-rw-r--r-- | kernel/stop_machine.c | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index fbfc3f1d368a..10c7b51c0d1f 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c | |||
@@ -2290,8 +2290,17 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p) | |||
2290 | if (task_on_rq_queued(p) && p->dl.dl_runtime) | 2290 | if (task_on_rq_queued(p) && p->dl.dl_runtime) |
2291 | task_non_contending(p); | 2291 | task_non_contending(p); |
2292 | 2292 | ||
2293 | if (!task_on_rq_queued(p)) | 2293 | if (!task_on_rq_queued(p)) { |
2294 | /* | ||
2295 | * Inactive timer is armed. However, p is leaving DEADLINE and | ||
2296 | * might migrate away from this rq while continuing to run on | ||
2297 | * some other class. We need to remove its contribution from | ||
2298 | * this rq running_bw now, or sub_rq_bw (below) will complain. | ||
2299 | */ | ||
2300 | if (p->dl.dl_non_contending) | ||
2301 | sub_running_bw(&p->dl, &rq->dl); | ||
2294 | sub_rq_bw(&p->dl, &rq->dl); | 2302 | sub_rq_bw(&p->dl, &rq->dl); |
2303 | } | ||
2295 | 2304 | ||
2296 | /* | 2305 | /* |
2297 | * We cannot use inactive_task_timer() to invoke sub_running_bw() | 2306 | * We cannot use inactive_task_timer() to invoke sub_running_bw() |
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index f89014a2c238..1ff523dae6e2 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
@@ -270,7 +270,11 @@ unlock: | |||
270 | goto retry; | 270 | goto retry; |
271 | } | 271 | } |
272 | 272 | ||
273 | wake_up_q(&wakeq); | 273 | if (!err) { |
274 | preempt_disable(); | ||
275 | wake_up_q(&wakeq); | ||
276 | preempt_enable(); | ||
277 | } | ||
274 | 278 | ||
275 | return err; | 279 | return err; |
276 | } | 280 | } |