diff options
-rw-r--r-- | include/litmus/debug_trace.h | 7 | ||||
-rw-r--r-- | litmus/fdso.c | 2 | ||||
-rw-r--r-- | litmus/sched_pfp.c | 12 |
3 files changed, 14 insertions, 7 deletions
diff --git a/include/litmus/debug_trace.h b/include/litmus/debug_trace.h index 48d086d5a44c..1266ac6a760c 100644 --- a/include/litmus/debug_trace.h +++ b/include/litmus/debug_trace.h | |||
@@ -28,8 +28,11 @@ extern atomic_t __log_seq_no; | |||
28 | TRACE_ARGS, ## args) | 28 | TRACE_ARGS, ## args) |
29 | 29 | ||
30 | #define TRACE_TASK(t, fmt, args...) \ | 30 | #define TRACE_TASK(t, fmt, args...) \ |
31 | TRACE("(%s/%d:%d) " fmt, (t)->comm, (t)->pid, \ | 31 | TRACE("(%s/%d:%d) " fmt, \ |
32 | (t)->rt_param.job_params.job_no, ##args) | 32 | t ? (t)->comm : "null", \ |
33 | t ? (t)->pid : 0, \ | ||
34 | t ? (t)->rt_param.job_params.job_no : 0, \ | ||
35 | ##args) | ||
33 | 36 | ||
34 | #define TRACE_CUR(fmt, args...) \ | 37 | #define TRACE_CUR(fmt, args...) \ |
35 | TRACE_TASK(current, fmt, ## args) | 38 | TRACE_TASK(current, fmt, ## args) |
diff --git a/litmus/fdso.c b/litmus/fdso.c index 709be3cc8992..3749d6beb107 100644 --- a/litmus/fdso.c +++ b/litmus/fdso.c | |||
@@ -46,6 +46,8 @@ static const struct fdso_ops* fdso_ops[] = { | |||
46 | 46 | ||
47 | static int fdso_create(void** obj_ref, obj_type_t type, void* __user config) | 47 | static int fdso_create(void** obj_ref, obj_type_t type, void* __user config) |
48 | { | 48 | { |
49 | BUILD_BUG_ON(ARRAY_SIZE(fdso_ops) != MAX_OBJ_TYPE + 1); | ||
50 | |||
49 | if (fdso_ops[type]->create) | 51 | if (fdso_ops[type]->create) |
50 | return fdso_ops[type]->create(obj_ref, type, config); | 52 | return fdso_ops[type]->create(obj_ref, type, config); |
51 | else | 53 | else |
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 | ||
1228 | static void pcp_update_prio_ceiling(struct pcp_semaphore* sem, | 1230 | static void pcp_update_prio_ceiling(struct pcp_semaphore* sem, |