]> git.baikalelectronics.ru Git - kernel.git/commit
sched/fair: Fix SCHED_HRTICK bug leading to late preemption of tasks
authorSrivatsa Vaddagiri <vatsa@codeaurora.org>
Sat, 17 Sep 2016 01:28:51 +0000 (18:28 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 22 Sep 2016 13:20:18 +0000 (15:20 +0200)
commitdaff179a8fc37a13488a461ca508f8df2021d611
treec5f4794c74ad0b2147f5a0a300c64d4dee9cdd50
parentc6d847eb01a4adf5df2ab49b3ff3ba82008e31c9
sched/fair: Fix SCHED_HRTICK bug leading to late preemption of tasks

SCHED_HRTICK feature is useful to preempt SCHED_FAIR tasks on-the-dot
(just when they would have exceeded their ideal_runtime).

It makes use of a per-CPU hrtimer resource and hence arming that
hrtimer should be based on total SCHED_FAIR tasks a CPU has across its
various cfs_rqs, rather than being based on number of tasks in a
particular cfs_rq (as implemented currently).

As a result, with current code, its possible for a running task (which
is the sole task in its cfs_rq) to be preempted much after its
ideal_runtime has elapsed, resulting in increased latency for tasks in
other cfs_rq on same CPU.

Fix this by arming sched hrtimer based on total number of SCHED_FAIR
tasks a CPU has across its various cfs_rqs.

Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1474075731-11550-1-git-send-email-joonwoop@codeaurora.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c