aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/fp_common.c
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:55 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2017-05-26 17:12:41 -0400
commitbda81b58bc0e67358d05eb096cc19a2cc22d228a (patch)
tree3708726335317dcaa0b31e1ef31866c3a639fac2 /litmus/fp_common.c
parentb410e1d8a4699e4a1c1edc0fc7d442032e1af7da (diff)
Add P-FP scheduler plugin
P-FP: fix wrong memset() P-FP: use sched_trace_last_suspension_as_completion() P-FP: use inferred_sporadic_job_release_at() P-FP: include np.h P-FP: improve debug tracing
Diffstat (limited to 'litmus/fp_common.c')
-rw-r--r--litmus/fp_common.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/litmus/fp_common.c b/litmus/fp_common.c
index 242542a510d3..595c7b8e561d 100644
--- a/litmus/fp_common.c
+++ b/litmus/fp_common.c
@@ -33,7 +33,6 @@ int fp_higher_prio(struct task_struct* first,
33 return 0; 33 return 0;
34 } 34 }
35 35
36
37 /* check for NULL tasks */ 36 /* check for NULL tasks */
38 if (!first || !second) 37 if (!first || !second)
39 return first && !second; 38 return first && !second;
@@ -51,6 +50,15 @@ int fp_higher_prio(struct task_struct* first,
51 if (unlikely(second->rt_param.inh_task)) 50 if (unlikely(second->rt_param.inh_task))
52 second_task = second->rt_param.inh_task; 51 second_task = second->rt_param.inh_task;
53 52
53 /* Comparisons to itself are only possible with
54 * priority inheritance when svc_preempt interrupt just
55 * before scheduling (and everything that could follow in the
56 * ready queue). Always favour the original job, as that one will just
57 * suspend itself to resolve this.
58 */
59 if(first_task == second_task)
60 return first_task == first;
61
54 /* Check for priority boosting. Tie-break by start of boosting. 62 /* Check for priority boosting. Tie-break by start of boosting.
55 */ 63 */
56 if (unlikely(is_priority_boosted(first_task))) { 64 if (unlikely(is_priority_boosted(first_task))) {
@@ -66,11 +74,10 @@ int fp_higher_prio(struct task_struct* first,
66 /* second_task is boosted, first is not*/ 74 /* second_task is boosted, first is not*/
67 return 0; 75 return 0;
68 76
69#endif 77#else
70 78 /* No locks, no priority inheritance, no comparisons to itself */
71 /* Comparisons to itself are not expected; priority inheritance
72 * should also not cause this to happen. */
73 BUG_ON(first_task == second_task); 79 BUG_ON(first_task == second_task);
80#endif
74 81
75 if (get_priority(first_task) < get_priority(second_task)) 82 if (get_priority(first_task) < get_priority(second_task))
76 return 1; 83 return 1;