From 2b2bfacf05bfd64a0f315894ec87367590158e94 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sun, 9 Aug 2015 13:18:52 +0200 Subject: Disable cut-to-CFS optimization in Linux scheduler Global plugins require that the plugin be called even if there currently is no real-time task executing on the local core. --- kernel/sched/core.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'kernel') diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d1a8feda6918..6bd6bfd2fcb9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3307,21 +3307,29 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct pin_cookie cookie /* * Optimization: we know that if all tasks are in * the fair class we can call that function directly: - */ + + * NOT IN LITMUS^RT! + + * This breaks many assumptions in the plugins. + * Do not uncomment without thinking long and hard + * about how this affects global plugins such as GSN-EDF. + if (likely(prev->sched_class == class && rq->nr_running == rq->cfs.h_nr_running)) { p = fair_sched_class.pick_next_task(rq, prev, cookie); if (unlikely(p == RETRY_TASK)) goto again; - /* assumes fair_sched_class->next == idle_sched_class */ + // assumes fair_sched_class->next == idle_sched_class if (unlikely(!p)) p = idle_sched_class.pick_next_task(rq, prev, cookie); return p; - } + + */ again: + for_each_class(class) { p = class->pick_next_task(rq, prev, cookie); if (p) { -- cgit v1.2.2