aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sched_pfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/sched_pfp.c')
-rw-r--r--litmus/sched_pfp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/litmus/sched_pfp.c b/litmus/sched_pfp.c
index a435ed6621cf..fdcf8a41684a 100644
--- a/litmus/sched_pfp.c
+++ b/litmus/sched_pfp.c
@@ -194,7 +194,7 @@ static struct task_struct* pfp_schedule(struct task_struct * prev)
194 np = exists && is_np(pfp->scheduled); 194 np = exists && is_np(pfp->scheduled);
195 sleep = exists && is_completed(pfp->scheduled); 195 sleep = exists && is_completed(pfp->scheduled);
196 migrate = exists && get_partition(pfp->scheduled) != pfp->cpu; 196 migrate = exists && get_partition(pfp->scheduled) != pfp->cpu;
197 preempt = migrate || fp_preemption_needed(&pfp->ready_queue, prev); 197 preempt = !blocks && (migrate || fp_preemption_needed(&pfp->ready_queue, prev));
198 198
199 /* If we need to preempt do so. 199 /* If we need to preempt do so.
200 * The following checks set resched to 1 in case of special 200 * The following checks set resched to 1 in case of special
@@ -1107,8 +1107,10 @@ static void pcp_priority_inheritance(void)
1107 fp_set_prio_inh(pfp, blocker, blocked); 1107 fp_set_prio_inh(pfp, blocker, blocked);
1108 } 1108 }
1109 1109
1110 /* check if anything changed */ 1110 /* Check if anything changed. If the blocked job is current, then it is
1111 if (fp_higher_prio(fp_prio_peek(&pfp->ready_queue), pfp->scheduled)) 1111 * just blocking and hence is going to call the scheduler anyway. */
1112 if (blocked != current &&
1113 fp_higher_prio(fp_prio_peek(&pfp->ready_queue), pfp->scheduled))
1112 preempt(pfp); 1114 preempt(pfp);
1113 1115
1114 raw_spin_unlock_irqrestore(&pfp->slock, flags); 1116 raw_spin_unlock_irqrestore(&pfp->slock, flags);
@@ -1219,10 +1221,10 @@ static void pcp_lower_ceiling(struct pcp_semaphore* sem)
1219 1221
1220 TRACE_CUR("PCP released sem %p\n", sem); 1222 TRACE_CUR("PCP released sem %p\n", sem);
1221 1223
1224 pcp_priority_inheritance();
1225
1222 /* Wake up all ceiling-blocked jobs that now pass the ceiling. */ 1226 /* Wake up all ceiling-blocked jobs that now pass the ceiling. */
1223 pcp_resume_unblocked(); 1227 pcp_resume_unblocked();
1224
1225 pcp_priority_inheritance();
1226} 1228}
1227 1229
1228static void pcp_update_prio_ceiling(struct pcp_semaphore* sem, 1230static void pcp_update_prio_ceiling(struct pcp_semaphore* sem,