aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/rt_domain.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2009-12-17 21:47:19 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-29 17:19:53 -0400
commit0b28a3122d6917784701377e15a863489aee1c6c (patch)
tree259c8f59ed477e81f97b5dc6ac7ec8ce06ce1e26 /litmus/rt_domain.c
parentc15be843778236e9f2fdbc207ab36ba996b2bb1b (diff)
[ported from 2008.3] Add release-master support
Diffstat (limited to 'litmus/rt_domain.c')
-rw-r--r--litmus/rt_domain.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c
index 78e76421aeba..62c9fdcd22be 100644
--- a/litmus/rt_domain.c
+++ b/litmus/rt_domain.c
@@ -158,6 +158,7 @@ static void reinit_release_heap(struct task_struct* t)
158 158
159 /* initialize */ 159 /* initialize */
160 heap_init(&rh->heap); 160 heap_init(&rh->heap);
161 atomic_set(&rh->info.state, HRTIMER_START_ON_INACTIVE);
161} 162}
162/* arm_release_timer() - start local release timer or trigger 163/* arm_release_timer() - start local release timer or trigger
163 * remote timer (pull timer) 164 * remote timer (pull timer)
@@ -217,14 +218,18 @@ static void arm_release_timer(rt_domain_t *_rt)
217 TRACE_TASK(t, "arming timer 0x%p\n", &rh->timer); 218 TRACE_TASK(t, "arming timer 0x%p\n", &rh->timer);
218 /* we cannot arm the timer using hrtimer_start() 219 /* we cannot arm the timer using hrtimer_start()
219 * as it may deadlock on rq->lock 220 * as it may deadlock on rq->lock
221 *
222 * PINNED mode is ok on both local and remote CPU
220 */ 223 */
221 /* FIXME now only one cpu without pulling 224 if (rt->release_master == NO_CPU)
222 * later more cpus; hrtimer_pull should call 225 __hrtimer_start_range_ns(&rh->timer,
223 * __hrtimer_start... always with PINNED mode 226 ns_to_ktime(rh->release_time),
224 */ 227 0, HRTIMER_MODE_ABS_PINNED, 0);
225 __hrtimer_start_range_ns(&rh->timer, 228 else
226 ns_to_ktime(rh->release_time), 229 hrtimer_start_on(rt->release_master,
227 0, HRTIMER_MODE_ABS_PINNED, 0); 230 &rh->info, &rh->timer,
231 ns_to_ktime(rh->release_time),
232 HRTIMER_MODE_ABS_PINNED);
228 } else 233 } else
229 TRACE_TASK(t, "0x%p is not my timer\n", &rh->timer); 234 TRACE_TASK(t, "0x%p is not my timer\n", &rh->timer);
230 } 235 }
@@ -246,6 +251,8 @@ void rt_domain_init(rt_domain_t *rt,
246 if (!order) 251 if (!order)
247 order = dummy_order; 252 order = dummy_order;
248 253
254 rt->release_master = NO_CPU;
255
249 heap_init(&rt->ready_queue); 256 heap_init(&rt->ready_queue);
250 INIT_LIST_HEAD(&rt->tobe_released); 257 INIT_LIST_HEAD(&rt->tobe_released);
251 for (i = 0; i < RELEASE_QUEUE_SLOTS; i++) 258 for (i = 0; i < RELEASE_QUEUE_SLOTS; i++)