diff options
Diffstat (limited to 'litmus/fp_common.c')
-rw-r--r-- | litmus/fp_common.c | 17 |
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; |