• Kirill Tkhai's avatar
    sched/dl: Fix preemption checks · f3a7e1a9
    Kirill Tkhai authored
    1) switched_to_dl() check is wrong. We reschedule only
       if rq->curr is deadline task, and we do not reschedule
       if it's a lower priority task. But we must always
       preempt a task of other classes.
    
    2) dl_task_timer():
       Policy does not change in case of priority inheritance.
       rt_mutex_setprio() changes prio, while policy remains old.
    
    So we lose some balancing logic in dl_task_timer() and
    switched_to_dl() when we check policy instead of priority. Boosted
    task may be rq->curr.
    
    (I didn't change switched_from_dl() because no check is necessary
    there at all).
    
    I've looked at this place(switched_to_dl) several times and even fixed
    this function, but found just now...  I suppose some performance tests
    may work better after this.
    Signed-off-by: default avatarKirill Tkhai <ktkhai@parallels.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Juri Lelli <juri.lelli@gmail.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/1413909356.19914.128.camel@tkhaiSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    f3a7e1a9
deadline.c 43.3 KB