diff options
Diffstat (limited to 'litmus/sched_pfp.c')
-rw-r--r-- | litmus/sched_pfp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c index 62be699629b1..b1d5b4326a0e 100644 --- a/litmus/sched_pfp.c +++ b/litmus/sched_pfp.c | |||
@@ -95,6 +95,12 @@ static void pfp_release_jobs(rt_domain_t* rt, struct bheap* tasks) | |||
95 | raw_spin_unlock_irqrestore(&pfp->slock, flags); | 95 | raw_spin_unlock_irqrestore(&pfp->slock, flags); |
96 | } | 96 | } |
97 | 97 | ||
98 | static void pfp_preempt_check(pfp_domain_t *pfp) | ||
99 | { | ||
100 | if (fp_higher_prio(fp_prio_peek(&pfp->ready_queue), pfp->scheduled)) | ||
101 | preempt(pfp); | ||
102 | } | ||
103 | |||
98 | static void pfp_domain_init(pfp_domain_t* pfp, | 104 | static void pfp_domain_init(pfp_domain_t* pfp, |
99 | int cpu) | 105 | int cpu) |
100 | { | 106 | { |
@@ -291,7 +297,7 @@ static void pfp_task_new(struct task_struct * t, int on_rq, int running) | |||
291 | } else { | 297 | } else { |
292 | requeue(t, pfp); | 298 | requeue(t, pfp); |
293 | /* maybe we have to reschedule */ | 299 | /* maybe we have to reschedule */ |
294 | preempt(pfp); | 300 | pfp_preempt_check(pfp); |
295 | } | 301 | } |
296 | raw_spin_unlock_irqrestore(&pfp->slock, flags); | 302 | raw_spin_unlock_irqrestore(&pfp->slock, flags); |
297 | } | 303 | } |
@@ -337,8 +343,10 @@ static void pfp_task_wake_up(struct task_struct *task) | |||
337 | * and won. Also, don't requeue if it is still queued, which can | 343 | * and won. Also, don't requeue if it is still queued, which can |
338 | * happen under the DPCP due wake-ups racing with migrations. | 344 | * happen under the DPCP due wake-ups racing with migrations. |
339 | */ | 345 | */ |
340 | if (pfp->scheduled != task) | 346 | if (pfp->scheduled != task) { |
341 | requeue(task, pfp); | 347 | requeue(task, pfp); |
348 | pfp_preempt_check(pfp); | ||
349 | } | ||
342 | 350 | ||
343 | out_unlock: | 351 | out_unlock: |
344 | raw_spin_unlock_irqrestore(&pfp->slock, flags); | 352 | raw_spin_unlock_irqrestore(&pfp->slock, flags); |