diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-05-04 23:30:02 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-05-04 23:30:02 -0400 |
commit | 7e4891de3120ad67d3f4d7bb49aa6d251244993a (patch) | |
tree | ff21d796ce2e0262c68f0ab26c8b1ad6e8d72016 | |
parent | d8fecef68f7998d4240a687444aefce2568476ca (diff) |
litmus core: cleanup
Line breaks, ammend comments, etc.
-rw-r--r-- | litmus/sched_litmus.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/litmus/sched_litmus.c b/litmus/sched_litmus.c index 97e0624903..3ebec1dfd2 100644 --- a/litmus/sched_litmus.c +++ b/litmus/sched_litmus.c | |||
@@ -55,9 +55,9 @@ static void litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
55 | mb(); | 55 | mb(); |
56 | spin_unlock(&rq->lock); | 56 | spin_unlock(&rq->lock); |
57 | 57 | ||
58 | /* Don't race with a concurrent switch. | 58 | /* Don't race with a concurrent switch. This could deadlock in |
59 | * This could deadlock in the case of cross or circular migrations. | 59 | * the case of cross or circular migrations. It's the job of |
60 | * It's the job of the plugin to make sure that doesn't happen. | 60 | * the plugin to make sure that doesn't happen. |
61 | */ | 61 | */ |
62 | TRACE_TASK(rq->litmus_next, "stack_in_use=%d\n", | 62 | TRACE_TASK(rq->litmus_next, "stack_in_use=%d\n", |
63 | rq->litmus_next->rt_param.stack_in_use); | 63 | rq->litmus_next->rt_param.stack_in_use); |
@@ -71,7 +71,8 @@ static void litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
71 | if (rq->litmus_next->rt_param.stack_in_use == NO_CPU) | 71 | if (rq->litmus_next->rt_param.stack_in_use == NO_CPU) |
72 | TRACE_TASK(rq->litmus_next, | 72 | TRACE_TASK(rq->litmus_next, |
73 | "descheduled. Proceeding.\n"); | 73 | "descheduled. Proceeding.\n"); |
74 | if (lt_before(_maybe_deadlock + 10000000, litmus_clock())) { | 74 | if (lt_before(_maybe_deadlock + 10000000, |
75 | litmus_clock())) { | ||
75 | /* We've been spinning for 10ms. | 76 | /* We've been spinning for 10ms. |
76 | * Something can't be right! | 77 | * Something can't be right! |
77 | * Let's abandon the task and bail out; at least | 78 | * Let's abandon the task and bail out; at least |
@@ -79,7 +80,8 @@ static void litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
79 | * deadlock. | 80 | * deadlock. |
80 | */ | 81 | */ |
81 | TRACE_TASK(rq->litmus_next, | 82 | TRACE_TASK(rq->litmus_next, |
82 | "stack too long in use. Deadlock?\n"); | 83 | "stack too long in use. " |
84 | "Deadlock?\n"); | ||
83 | rq->litmus_next = NULL; | 85 | rq->litmus_next = NULL; |
84 | 86 | ||
85 | /* bail out */ | 87 | /* bail out */ |
@@ -118,12 +120,15 @@ static void litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
118 | * couple of things still hold: | 120 | * couple of things still hold: |
119 | * - it is still a real-time task | 121 | * - it is still a real-time task |
120 | * - it is still runnable (could have been stopped) | 122 | * - it is still runnable (could have been stopped) |
123 | * If either is violated, then the active plugin is | ||
124 | * doing something wrong. | ||
121 | */ | 125 | */ |
122 | if (!is_realtime(rq->litmus_next) || | 126 | if (!is_realtime(rq->litmus_next) || |
123 | !is_running(rq->litmus_next)) { | 127 | !is_running(rq->litmus_next)) { |
124 | /* BAD BAD BAD */ | 128 | /* BAD BAD BAD */ |
125 | TRACE_TASK(rq->litmus_next, | 129 | TRACE_TASK(rq->litmus_next, |
126 | "migration invariant FAILED: rt=%d running=%d\n", | 130 | "BAD: migration invariant FAILED: " |
131 | "rt=%d running=%d\n", | ||
127 | is_realtime(rq->litmus_next), | 132 | is_realtime(rq->litmus_next), |
128 | is_running(rq->litmus_next)); | 133 | is_running(rq->litmus_next)); |
129 | /* drop the task */ | 134 | /* drop the task */ |
@@ -136,7 +141,8 @@ static void litmus_schedule(struct rq *rq, struct task_struct *prev) | |||
136 | rq->litmus_next->rt_param.stack_in_use = rq->cpu; | 141 | rq->litmus_next->rt_param.stack_in_use = rq->cpu; |
137 | } | 142 | } |
138 | 143 | ||
139 | static void enqueue_task_litmus(struct rq *rq, struct task_struct *p, int wakeup) | 144 | static void enqueue_task_litmus(struct rq *rq, struct task_struct *p, |
145 | int wakeup) | ||
140 | { | 146 | { |
141 | if (wakeup) { | 147 | if (wakeup) { |
142 | sched_trace_task_resume(p); | 148 | sched_trace_task_resume(p); |
@@ -186,9 +192,9 @@ static void task_tick_litmus(struct rq *rq, struct task_struct *p) | |||
186 | { | 192 | { |
187 | } | 193 | } |
188 | 194 | ||
189 | /* This is called when a task became a real-time task, either due | 195 | /* This is called when a task became a real-time task, either due to a SCHED_* |
190 | * to a SCHED_* class transition or due to PI mutex inheritance.\ | 196 | * class transition or due to PI mutex inheritance. We don't handle Linux PI |
191 | * We don't handle Linux PI mutex inheritance yet. Use LITMUS provided | 197 | * mutex inheritance yet (and probably never will). Use LITMUS provided |
192 | * synchronization primitives instead. | 198 | * synchronization primitives instead. |
193 | */ | 199 | */ |
194 | static void set_curr_task_litmus(struct rq *rq) | 200 | static void set_curr_task_litmus(struct rq *rq) |