diff options
author | Tanya Amert <tamert@cs.unc.edu> | 2020-12-10 15:45:11 -0500 |
---|---|---|
committer | Tanya Amert <tamert@cs.unc.edu> | 2020-12-10 15:45:11 -0500 |
commit | 687f818cf6f6724bd5621fe52fb54e6f85028b18 (patch) | |
tree | 91d9e38b0c96985abf7b48dbfcb2539789a5ecd3 | |
parent | e133e1f631a0673dc64e13ac87f377bf8750c878 (diff) |
Moved logic to make task NP when checking FZ to occur earlier.
-rw-r--r-- | litmus/reservations/gedf_reservation.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/litmus/reservations/gedf_reservation.c b/litmus/reservations/gedf_reservation.c index 7819ab90069f..65ca2b8c9fd6 100644 --- a/litmus/reservations/gedf_reservation.c +++ b/litmus/reservations/gedf_reservation.c | |||
@@ -1100,6 +1100,13 @@ static int gedf_env_omlp_access_fz_check(struct litmus_lock* l, lt_t fz_len) | |||
1100 | t_res = (struct reservation *) tsk_rt(t)->plugin_state; | 1100 | t_res = (struct reservation *) tsk_rt(t)->plugin_state; |
1101 | gedf_res = container_of(t_res, struct gedf_reservation, res); | 1101 | gedf_res = container_of(t_res, struct gedf_reservation, res); |
1102 | 1102 | ||
1103 | /* make task non-preemptive, even if it must suspend because | ||
1104 | * of a forbidden zone; will be cleared by a user-space call */ | ||
1105 | if (likely(tsk_rt(t)->ctrl_page)) | ||
1106 | tsk_rt(t)->ctrl_page->sched.np.flag = 1; | ||
1107 | else | ||
1108 | TRACE_TASK(t, "Can't make task user-space np: no ctrl page\n"); | ||
1109 | |||
1103 | /* if in a forbidden zone, wait until the next time slice */ | 1110 | /* if in a forbidden zone, wait until the next time slice */ |
1104 | /* note that we can't use t_res->par_env->res->cur_budget | 1111 | /* note that we can't use t_res->par_env->res->cur_budget |
1105 | * because it is only updated on a call to schedule(), and | 1112 | * because it is only updated on a call to schedule(), and |
@@ -1134,10 +1141,6 @@ static int gedf_env_omlp_access_fz_check(struct litmus_lock* l, lt_t fz_len) | |||
1134 | 1141 | ||
1135 | TS_LOCK_RESUME; | 1142 | TS_LOCK_RESUME; |
1136 | } else { | 1143 | } else { |
1137 | if (likely(tsk_rt(t)->ctrl_page)) | ||
1138 | tsk_rt(t)->ctrl_page->sched.np.flag = 1; | ||
1139 | else | ||
1140 | TRACE_TASK(t, "Can't make task user-space np: no ctrl page\n"); | ||
1141 | spin_unlock_irqrestore(&gedf_env->fz_waiters[cpu].lock, flags); | 1144 | spin_unlock_irqrestore(&gedf_env->fz_waiters[cpu].lock, flags); |
1142 | } | 1145 | } |
1143 | 1146 | ||