aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2010-09-21 22:49:37 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2010-10-18 17:07:27 -0400
commit8cc60b37588e130bed9d418bcfbe4d64c3a91935 (patch)
tree8a3644e785bcd47984d76be0ccbe58f20da9fa4c /include/litmus
parent2ed4499a959f8fc30e430b6644ec83ceb7d49ef6 (diff)
rt_domain_t: add add_release_on()
This API addition allows the calling code to override the release master for a given rt_domain_t object. This is particularly useful if a job is supposed to migrate to a particular CPU. This need arises for example in semi- partitioned schedulers.
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/rt_domain.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h
index 59e6b54e9281..ac249292e866 100644
--- a/include/litmus/rt_domain.h
+++ b/include/litmus/rt_domain.h
@@ -143,12 +143,26 @@ static inline struct task_struct* take_ready(rt_domain_t* rt)
143static inline void add_release(rt_domain_t* rt, struct task_struct *task) 143static inline void add_release(rt_domain_t* rt, struct task_struct *task)
144{ 144{
145 unsigned long flags; 145 unsigned long flags;
146 /* first we need the write lock for rt_ready_queue */
147 raw_spin_lock_irqsave(&rt->tobe_lock, flags); 146 raw_spin_lock_irqsave(&rt->tobe_lock, flags);
148 __add_release(rt, task); 147 __add_release(rt, task);
149 raw_spin_unlock_irqrestore(&rt->tobe_lock, flags); 148 raw_spin_unlock_irqrestore(&rt->tobe_lock, flags);
150} 149}
151 150
151#ifdef CONFIG_RELEASE_MASTER
152void __add_release_on(rt_domain_t* rt, struct task_struct *task,
153 int target_cpu);
154
155static inline void add_release_on(rt_domain_t* rt,
156 struct task_struct *task,
157 int target_cpu)
158{
159 unsigned long flags;
160 raw_spin_lock_irqsave(&rt->tobe_lock, flags);
161 __add_release_on(rt, task, target_cpu);
162 raw_spin_unlock_irqrestore(&rt->tobe_lock, flags);
163}
164#endif
165
152static inline int __jobs_pending(rt_domain_t* rt) 166static inline int __jobs_pending(rt_domain_t* rt)
153{ 167{
154 return !bheap_empty(&rt->ready_queue); 168 return !bheap_empty(&rt->ready_queue);