diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-07-01 17:55:09 -0400 |
---|---|---|
committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2014-10-21 10:07:39 -0400 |
commit | f40461bc0f6f2b7d76e6c24aef758862e3cbd0c1 (patch) | |
tree | ecc1ea4c2317495aaae0069f6e7758d94f79d3f8 | |
parent | e07b27e05418f939cb559e96733aa2e96de71592 (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 */ |