sched/deadline: Fix sched_yield() behavior
yield_task_dl() is broken: o it forces current to be throttled setting its runtime to zero; o it sets current's dl_se->dl_new to one, expecting that dl_task_timer() will queue it back with proper parameters at replenish time. Unfortunately, dl_task_timer() has this check at the very beginning: if (!dl_task(p) || dl_se->dl_new) goto unlock; So, it just bails out and the task is never replenished. It actually yielded forever. To fix this, introduce a new flag indicating that the task properly yielded the CPU before its current runtime expired. While this is a little overdoing at the moment, the flag would be useful in the future to discriminate between "good" jobs (of which remaining runtime could be reclaimed, i.e. recycled) and "bad" jobs (for which dl_throttled task has been set) that needed to be stopped. Reported-by: yjay.kim <yjay.kim@lge.com> Signed-off-by: Juri Lelli <juri.lelli@gmail.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20140429103953.e68eba1b2ac3309214e3dc5a@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
2d513868e2
commit
5bfd126e80
3 changed files with 9 additions and 4 deletions
|
|
@ -1153,9 +1153,12 @@ struct sched_dl_entity {
|
|||
*
|
||||
* @dl_boosted tells if we are boosted due to DI. If so we are
|
||||
* outside bandwidth enforcement mechanism (but only until we
|
||||
* exit the critical section).
|
||||
* exit the critical section);
|
||||
*
|
||||
* @dl_yielded tells if task gave up the cpu before consuming
|
||||
* all its available runtime during the last job.
|
||||
*/
|
||||
int dl_throttled, dl_new, dl_boosted;
|
||||
int dl_throttled, dl_new, dl_boosted, dl_yielded;
|
||||
|
||||
/*
|
||||
* Bandwidth enforcement timer. Each -deadline task has its
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue