summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorCon Kolivas <kernel@kolivas.org>2016-10-22 08:49:02 +1100
committerCon Kolivas <kernel@kolivas.org>2016-10-22 09:55:05 +1100
commit98bd0d525be19905bf76e0555936ab92713dec78 (patch)
tree7a5a1a329d2e99f2e4142e707bcbd683e8aafbad /kernel
parent04bbfdc3164a52ae35bd0b7572a67689de2a8a62 (diff)
Provide unique low overhead edt function for UP.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/MuQSS.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/kernel/sched/MuQSS.c b/kernel/sched/MuQSS.c
index 475e7fcf7f30..c9b7c851789e 100644
--- a/kernel/sched/MuQSS.c
+++ b/kernel/sched/MuQSS.c
@@ -3622,8 +3622,6 @@ static inline void check_deadline(struct task_struct *p, struct rq *rq)
time_slice_expired(p, rq);
}
-#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
-
/*
* Task selection with skiplists is a simple matter of picking off the first
* task in the sorted list, an O(1) operation. The lookup is amortised O(1)
@@ -3640,8 +3638,9 @@ static inline void check_deadline(struct task_struct *p, struct rq *rq)
* runqueue or a runqueue with more tasks than the current one with a better
* key/deadline.
*/
-static inline struct
-task_struct *earliest_deadline_task(struct rq *rq, int cpu, struct task_struct *idle)
+#ifdef CONFIG_SMP
+static inline struct task_struct
+*earliest_deadline_task(struct rq *rq, int cpu, struct task_struct *idle)
{
struct task_struct *edt = idle;
struct rq *locked = NULL;
@@ -3719,6 +3718,19 @@ task_struct *earliest_deadline_task(struct rq *rq, int cpu, struct task_struct *
return edt;
}
+#else /* CONFIG_SMP */
+static inline struct task_struct
+*earliest_deadline_task(struct rq *rq, int cpu, struct task_struct *idle)
+{
+ struct task_struct *edt;
+
+ if (unlikely(!rq->sl->entries))
+ return idle;
+ edt = rq->node.next[0]->value;
+ take_task(rq, cpu, edt);
+ return edt;
+}
+#endif /* CONFIG_SMP */
/*
* Print scheduling while atomic bug: