sched/fair: check_preempt_wakeup: Fix assumption on the default policy
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 16 Sep 2016 16:16:36 +0000 (12:16 -0400)
committerJulien Desfossez <jdesfossez@efficios.com>
Fri, 16 Sep 2016 20:59:33 +0000 (16:59 -0400)
commitf14bf141e6378d6176bc23e2509f2535e8a0aae7
treed0d3fb1a27d6f6364d46229bb29cd03cabf50fdf
parent562d4a2d7fa26b11d995f418951f3396a5d0f550
sched/fair: check_preempt_wakeup: Fix assumption on the default policy

Tasks with RT or deadline scheduling class may inherit from a task with
a "fair" scheduling class. This priority inheritance changes the
scheduling class, but not the task "policy" field.

Therefore, the fair scheduler should not assume that policy !=
SCHED_NORMAL is the same as (policy == SCHED_BATCH || policy ==
SCHED_IDLE), because the policy could also be SCHED_RR, SCHED_FIFO, or
SCHED_DEADLINE.

The incorrect comparison in check_preempt_wakeup makes RR, FIFO and
DEADLINE tasks which inherit from a fair task behave as if they were
IDLE or BATCH tasks, thus awaiting the following tick before preempting
the current task.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
kernel/sched/fair.c
This page took 0.024359 seconds and 5 git commands to generate.