diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-05-28 10:30:29 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 17:21:31 -0400 |
commit | a084c01569bcfe13fd880a0b1e3a9026629a89da (patch) | |
tree | c52640fb3f007637a1914ec6f0b6b92051be73c3 /kernel/sched.c | |
parent | e68debebdc2983600063cd6b04c6a51c4b7ddcc1 (diff) |
Better explanation of jump-to-CFS optimization removal
GSN-EDF and friends rely on being called even if there is currently
no runnable real-time task on the runqueue for (at least) two reasons:
1) To initiate migrations. LITMUS^RT pull tasks for migrations; this requires
plugins to be called even if no task is currently present.
2) To maintain invariants when jobs block.
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 9ad41979c0b2..1701eaebb79c 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -487,6 +487,7 @@ struct rt_rq { | |||
487 | 487 | ||
488 | /* Litmus related fields in a runqueue */ | 488 | /* Litmus related fields in a runqueue */ |
489 | struct litmus_rq { | 489 | struct litmus_rq { |
490 | unsigned long nr_running; | ||
490 | struct task_struct *prev; | 491 | struct task_struct *prev; |
491 | }; | 492 | }; |
492 | 493 | ||
@@ -5420,13 +5421,15 @@ pick_next_task(struct rq *rq) | |||
5420 | /* | 5421 | /* |
5421 | * Optimization: we know that if all tasks are in | 5422 | * Optimization: we know that if all tasks are in |
5422 | * the fair class we can call that function directly: | 5423 | * the fair class we can call that function directly: |
5423 | */ | 5424 | |
5424 | /* | 5425 | * NOT IN LITMUS^RT! |
5425 | * LITMUS_TODO: can we move processes out of fair class? | 5426 | |
5426 | * i.e., create a litmus_rq | 5427 | * This breaks many assumptions in the plugins. |
5427 | */ | 5428 | * Do not uncomment without thinking long and hard |
5428 | /* Don't do this for LITMUS | 5429 | * about how this affects global plugins such as GSN-EDF. |
5429 | if (likely(rq->nr_running == rq->cfs.nr_running)) { | 5430 | |
5431 | if (rq->nr_running == rq->cfs.nr_running) { | ||
5432 | TRACE("taking shortcut in pick_next_task()\n"); | ||
5430 | p = fair_sched_class.pick_next_task(rq); | 5433 | p = fair_sched_class.pick_next_task(rq); |
5431 | if (likely(p)) | 5434 | if (likely(p)) |
5432 | return p; | 5435 | return p; |