diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-07-01 17:55:09 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-08-07 03:47:01 -0400 |
commit | 934b09c301dcb8c199de40fb1a086480d2b21e2b (patch) | |
tree | 504a07be61dcf5d95e0ecf325b51c9ef8b8b635d | |
parent | 73b2f982396d6e394b8befc657cd6d24a3958e1d (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 f909689b623b..d2e37fb8c19e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -1950,6 +1950,14 @@ static inline void pre_schedule(struct rq *rq, struct task_struct *prev) | |||
1950 | { | 1950 | { |
1951 | if (prev->sched_class->pre_schedule) | 1951 | if (prev->sched_class->pre_schedule) |
1952 | prev->sched_class->pre_schedule(rq, prev); | 1952 | prev->sched_class->pre_schedule(rq, prev); |
1953 | |||
1954 | /* LITMUS^RT not very clean hack: we need to save the prev task as our | ||
1955 | * scheduling decision rely on it (as we drop the rq lock something in | ||
1956 | * prev can change...); there is no way to escape this hack apart from | ||
1957 | * modifying pick_nex_task(rq, _prev_) or falling back on the previous | ||
1958 | * solution of decoupling scheduling decisions. | ||
1959 | */ | ||
1960 | rq->litmus.prev = prev; | ||
1953 | } | 1961 | } |
1954 | 1962 | ||
1955 | /* rq->lock is NOT held, but preemption is disabled */ | 1963 | /* rq->lock is NOT held, but preemption is disabled */ |