diff options
author | Joshua Bakita <bakitajoshua@gmail.com> | 2021-04-11 18:41:50 -0400 |
---|---|---|
committer | Joshua Bakita <bakitajoshua@gmail.com> | 2021-04-11 18:41:50 -0400 |
commit | a023a031a1c028fc20e6465116b8aeece9cdac7d (patch) | |
tree | 081bb53904160d57f045d17be3ba2248854e5789 | |
parent | 8bad63d41181f8c6052056baed7a8244a7149d2a (diff) |
Further cleanup of unnecassary rebase changes
-rw-r--r-- | kernel/sched/litmus.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/kernel/sched/litmus.c b/kernel/sched/litmus.c index 79d30027a5e9..5244f9e1da6f 100644 --- a/kernel/sched/litmus.c +++ b/kernel/sched/litmus.c | |||
@@ -50,14 +50,9 @@ litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
50 | 50 | ||
51 | sched_state_plugin_check(); | 51 | sched_state_plugin_check(); |
52 | 52 | ||
53 | if (!next) { | ||
54 | update_enforcement_timer(next); | ||
55 | return next; | ||
56 | } | ||
57 | |||
58 | #ifdef CONFIG_SMP | 53 | #ifdef CONFIG_SMP |
59 | /* check if a global plugin pulled a task from a different RQ */ | 54 | /* check if a global plugin pulled a task from a different RQ */ |
60 | if (task_rq(next) != rq) { | 55 | if (next && task_rq(next) != rq) { |
61 | /* we need to migrate the task */ | 56 | /* we need to migrate the task */ |
62 | other_rq = task_rq(next); | 57 | other_rq = task_rq(next); |
63 | from_where = other_rq->cpu; | 58 | from_where = other_rq->cpu; |
@@ -173,7 +168,7 @@ litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
173 | #endif | 168 | #endif |
174 | 169 | ||
175 | /* check if the task became invalid while we dropped the lock */ | 170 | /* check if the task became invalid while we dropped the lock */ |
176 | if (!is_realtime(next) || !tsk_rt(next)->present) { | 171 | if (next && (!is_realtime(next) || !tsk_rt(next)->present)) { |
177 | TRACE_TASK(next, | 172 | TRACE_TASK(next, |
178 | "BAD: next (no longer?) valid\n"); | 173 | "BAD: next (no longer?) valid\n"); |
179 | litmus->next_became_invalid(next); | 174 | litmus->next_became_invalid(next); |
@@ -181,13 +176,15 @@ litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
181 | next = NULL; | 176 | next = NULL; |
182 | } | 177 | } |
183 | 178 | ||
179 | if (next) { | ||
184 | #ifdef CONFIG_SMP | 180 | #ifdef CONFIG_SMP |
185 | next->rt_param.stack_in_use = rq->cpu; | 181 | next->rt_param.stack_in_use = rq->cpu; |
186 | #else | 182 | #else |
187 | next->rt_param.stack_in_use = 0; | 183 | next->rt_param.stack_in_use = 0; |
188 | #endif | 184 | #endif |
189 | update_rq_clock(rq); | 185 | update_rq_clock(rq); |
190 | next->se.exec_start = rq->clock; | 186 | next->se.exec_start = rq->clock; |
187 | } | ||
191 | 188 | ||
192 | out: | 189 | out: |
193 | update_enforcement_timer(next); | 190 | update_enforcement_timer(next); |
@@ -264,27 +261,24 @@ static void put_prev_task_litmus(struct rq *rq, struct task_struct *p) | |||
264 | 261 | ||
265 | /* pick_next_task_litmus() - litmus_schedule() function | 262 | /* pick_next_task_litmus() - litmus_schedule() function |
266 | * | 263 | * |
267 | * @param prev Unused, as this is deprecated in our caller. | 264 | * prev and rf are deprecated by our caller and unused |
268 | * return the next task to be scheduled | 265 | * returns the next task to be scheduled |
269 | */ | 266 | */ |
270 | static struct task_struct *pick_next_task_litmus(struct rq *rq, | 267 | static struct task_struct *pick_next_task_litmus(struct rq *rq, |
271 | struct task_struct *prev, struct rq_flags *rf) | 268 | struct task_struct *prev, struct rq_flags *rf) |
272 | { | 269 | { |
273 | struct task_struct *next; | 270 | struct task_struct *next; |
274 | // I don't know if this is correct, but rf may be NULL according to | ||
275 | // sched.h, so I'm hoping NIL_COOKIE is safe to use in that case. | ||
276 | struct pin_cookie cookie = NIL_COOKIE; | ||
277 | if (rf) { | ||
278 | cookie = rf->cookie; | ||
279 | } | ||
280 | if (rq->curr && is_realtime(rq->curr)) | 271 | if (rq->curr && is_realtime(rq->curr)) |
281 | update_time_litmus(rq, rq->curr); | 272 | update_time_litmus(rq, rq->curr); |
282 | 273 | ||
283 | lockdep_unpin_lock(&rq->lock, cookie); | 274 | /* litmus_schedule() should be wrapped by the rq_upin_lock() and |
275 | * rq_repin_lock() annotations. Unfortunately, these annotations can | ||
276 | * not presently be added meaningfully as we are not passed rf->cookie. | ||
277 | */ | ||
284 | TS_PLUGIN_SCHED_START; | 278 | TS_PLUGIN_SCHED_START; |
285 | next = litmus_schedule(rq, rq->curr); | 279 | next = litmus_schedule(rq, rq->curr); |
286 | TS_PLUGIN_SCHED_END; | 280 | TS_PLUGIN_SCHED_END; |
287 | lockdep_repin_lock(&rq->lock, cookie); | 281 | |
288 | return next; | 282 | return next; |
289 | } | 283 | } |
290 | 284 | ||