aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-25 11:42:07 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-25 11:42:07 -0400
commite1ab93add217944741e21d44a49b7f9a76af4442 (patch)
tree2732e000bc6967683c6cdad3db4cf73cc0ad8e9e
parent46a24c12a41b7129459529626b799c66c8b6b8c5 (diff)
P-FP: support job migrations
When scheduling, make sure the currently scheduled task still belongs to this partition.
-rw-r--r--litmus/sched_pfp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c
index b59435e4e338..c6cd44183fbb 100644
--- a/litmus/sched_pfp.c
+++ b/litmus/sched_pfp.c
@@ -148,8 +148,7 @@ static struct task_struct* pfp_schedule(struct task_struct * prev)
148 pfp_domain_t* pfp = local_pfp; 148 pfp_domain_t* pfp = local_pfp;
149 struct task_struct* next; 149 struct task_struct* next;
150 150
151 int out_of_time, sleep, preempt, 151 int out_of_time, sleep, preempt, np, exists, blocks, resched, migrate;
152 np, exists, blocks, resched;
153 152
154 raw_spin_lock(&pfp->slock); 153 raw_spin_lock(&pfp->slock);
155 154
@@ -168,7 +167,8 @@ static struct task_struct* pfp_schedule(struct task_struct * prev)
168 budget_exhausted(pfp->scheduled); 167 budget_exhausted(pfp->scheduled);
169 np = exists && is_np(pfp->scheduled); 168 np = exists && is_np(pfp->scheduled);
170 sleep = exists && get_rt_flags(pfp->scheduled) == RT_F_SLEEP; 169 sleep = exists && get_rt_flags(pfp->scheduled) == RT_F_SLEEP;
171 preempt = fp_preemption_needed(&pfp->ready_queue, prev); 170 migrate = exists && get_partition(pfp->scheduled) != pfp->cpu;
171 preempt = migrate || fp_preemption_needed(&pfp->ready_queue, prev);
172 172
173 /* If we need to preempt do so. 173 /* If we need to preempt do so.
174 * The following checks set resched to 1 in case of special 174 * The following checks set resched to 1 in case of special
@@ -191,7 +191,7 @@ static struct task_struct* pfp_schedule(struct task_struct * prev)
191 * budget or wants to sleep completes. We may have to reschedule after 191 * budget or wants to sleep completes. We may have to reschedule after
192 * this. 192 * this.
193 */ 193 */
194 if (!np && (out_of_time || sleep) && !blocks) { 194 if (!np && (out_of_time || sleep) && !blocks && !migrate) {
195 job_completion(pfp->scheduled, !sleep); 195 job_completion(pfp->scheduled, !sleep);
196 resched = 1; 196 resched = 1;
197 } 197 }
@@ -207,7 +207,7 @@ static struct task_struct* pfp_schedule(struct task_struct * prev)
207 * release queue (if it completed). requeue() picks 207 * release queue (if it completed). requeue() picks
208 * the appropriate queue. 208 * the appropriate queue.
209 */ 209 */
210 if (pfp->scheduled && !blocks) 210 if (pfp->scheduled && !blocks && !migrate)
211 requeue(pfp->scheduled, pfp); 211 requeue(pfp->scheduled, pfp);
212 next = fp_prio_take(&pfp->ready_queue); 212 next = fp_prio_take(&pfp->ready_queue);
213 } else 213 } else