linux/kernel/sched
Luca Abeni cae817ad60 sched/deadline: Avoid double-accounting in case of missed deadlines
commit 269ad8015a upstream.

The dl_runtime_exceeded() function is supposed to ckeck if
a SCHED_DEADLINE task must be throttled, by checking if its
current runtime is <= 0. However, it also checks if the
scheduling deadline has been missed (the current time is
larger than the current scheduling deadline), further
decreasing the runtime if this happens.
This "double accounting" is wrong:

- In case of partitioned scheduling (or single CPU), this
  happens if task_tick_dl() has been called later than expected
  (due to small HZ values). In this case, the current runtime is
  also negative, and replenish_dl_entity() can take care of the
  deadline miss by recharging the current runtime to a value smaller
  than dl_runtime

- In case of global scheduling on multiple CPUs, scheduling
  deadlines can be missed even if the task did not consume more
  runtime than expected, hence penalizing the task is wrong

This patch fix this problem by throttling a SCHED_DEADLINE task
only when its runtime becomes negative, and not modifying the runtime

Signed-off-by: Luca Abeni <luca.abeni@unitn.it>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@gmail.com>
Cc: Dario Faggioli <raistlin@linux.it>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1418813432-20797-3-git-send-email-luca.abeni@unitn.it
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-16 06:59:33 -08:00
..
Makefile sched/deadline: speed up SCHED_DEADLINE pushes with a push-heap 2014-01-13 13:46:46 +01:00
auto_group.c sched/autogroup: Fix race with task_groups list 2013-05-28 09:40:22 +02:00
auto_group.h
clock.c sched/clock: Prevent tracing recursion in sched_clock_cpu() 2014-03-11 11:33:48 +01:00
completion.c sched: Move completion code from core.c to completion.c 2013-11-06 07:49:19 +01:00
core.c sched: Use rq->rd in sched_setaffinity() under RCU read lock 2014-11-14 09:00:11 -08:00
cpuacct.c cgroup: replace cftype->read_seq_string() with cftype->seq_show() 2013-12-05 12:28:04 -05:00
cpuacct.h
cpudeadline.c sched/deadline: Fix memory leak 2014-06-11 11:54:08 -07:00
cpudeadline.h sched/deadline: speed up SCHED_DEADLINE pushes with a push-heap 2014-01-13 13:46:46 +01:00
cpupri.c sched: Use CPUPRI_NR_PRIORITIES instead of MAX_RT_PRIO in cpupri check 2014-06-11 11:54:08 -07:00
cpupri.h
cputime.c sched: Sanitize irq accounting madness 2014-06-11 11:54:08 -07:00
deadline.c sched/deadline: Avoid double-accounting in case of missed deadlines 2015-01-16 06:59:33 -08:00
debug.c sched: Fix possible divide by zero in avg_atom() calculation 2014-07-28 08:06:03 -07:00
fair.c sched: Fix double normalization of vruntime 2014-02-27 12:29:38 +01:00
features.h sched/numa: Resist moving tasks towards nodes with fewer hinting faults 2013-10-09 12:40:27 +02:00
idle_task.c sched/numa: Introduce migrate_swap() 2013-10-09 12:40:46 +02:00
proc.c sched: Change get_rq_runnable_load() to static and inline 2013-06-27 10:07:44 +02:00
rt.c printk: rename printk_sched to printk_deferred 2014-08-07 14:52:37 -07:00
sched.h sched/deadline: Remove useless dl_nr_total 2014-02-21 21:27:10 +01:00
stats.c
stats.h sched: Micro-optimize by dropping unnecessary task_rq() calls 2013-09-25 13:51:06 +02:00
stop_task.c sched/deadline: Add SCHED_DEADLINE structures & implementation 2014-01-13 13:41:06 +01:00
wait.c sched: Move wait code from core.c to wait.c 2013-11-06 07:49:18 +01:00