diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-07-01 17:55:09 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2014-06-07 05:31:02 -0400 |
commit | dd0b15011310c3713d0c340a541ad4768c0a45a3 (patch) | |
tree | 16d269bc4cb0df66b1318cf672232a9ecba43fd9 | |
parent | 666b2ad99ea4ef4bf094dbcd0b828ee4ac7a61fd (diff) |
Cache 'prev' in LITMUS^RT runqueue
LITMUS^RT plugins like to know who 'prev' is. pick_next_task() doesn't
expose that info, so we just cache prev in the runqueue. Could robably
be replaced by looking at 'current' instead.
-rw-r--r-- | kernel/sched/core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b50b3c2e9887..ad6ba364fc68 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -1953,6 +1953,14 @@ static inline void pre_schedule(struct rq *rq, struct task_struct *prev) | |||
1953 | { | 1953 | { |
1954 | if (prev->sched_class->pre_schedule) | 1954 | if (prev->sched_class->pre_schedule) |
1955 | prev->sched_class->pre_schedule(rq, prev); | 1955 | prev->sched_class->pre_schedule(rq, prev); |
1956 | |||
1957 | /* LITMUS^RT not very clean hack: we need to save the prev task as our | ||
1958 | * scheduling decision rely on it (as we drop the rq lock something in | ||
1959 | * prev can change...); there is no way to escape this hack apart from | ||
1960 | * modifying pick_nex_task(rq, _prev_) or falling back on the previous | ||
1961 | * solution of decoupling scheduling decisions. | ||
1962 | */ | ||
1963 | rq->litmus.prev = prev; | ||
1956 | } | 1964 | } |
1957 | 1965 | ||
1958 | /* rq->lock is NOT held, but preemption is disabled */ | 1966 | /* rq->lock is NOT held, but preemption is disabled */ |