diff options
author | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-10-26 20:51:46 -0400 |
---|---|---|
committer | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-10-26 20:51:46 -0400 |
commit | 28137f9dcd8661321530156308b496dcc2a8e31d (patch) | |
tree | 2133501c2cf6187313d926afa63881362c8a2e6d | |
parent | 307eb923ed6ea1c1b98e73c7c948fbacc044ca71 (diff) |
Updated how NP works in OMLP lock and forbidden zones
-rw-r--r-- | litmus/reservations/gedf_reservation.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/litmus/reservations/gedf_reservation.c b/litmus/reservations/gedf_reservation.c index ef9751542d0a..b73aa0f1c434 100644 --- a/litmus/reservations/gedf_reservation.c +++ b/litmus/reservations/gedf_reservation.c | |||
@@ -1066,9 +1066,6 @@ int gedf_env_omlp_lock(struct litmus_lock* l) | |||
1066 | spin_unlock_irqrestore(&sem->fifo_wait.lock, flags); | 1066 | spin_unlock_irqrestore(&sem->fifo_wait.lock, flags); |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | // Make the task non-preemptive until the lock is released | ||
1070 | make_np(t); | ||
1071 | |||
1072 | tsk_rt(t)->num_locks_held++; | 1069 | tsk_rt(t)->num_locks_held++; |
1073 | 1070 | ||
1074 | return 0; | 1071 | return 0; |
@@ -1135,6 +1132,10 @@ static int gedf_env_omlp_access_fz_check(struct litmus_lock* l, lt_t fz_len) | |||
1135 | 1132 | ||
1136 | TS_LOCK_RESUME; | 1133 | TS_LOCK_RESUME; |
1137 | } else { | 1134 | } else { |
1135 | if (likely(tsk_rt(t)->ctrl_page)) | ||
1136 | tsk_rt(t)->ctrl_page->sched.np.flag = 1; | ||
1137 | else | ||
1138 | TRACE_TASK(t, "Can't make task user-space np: no ctrl page\n"); | ||
1138 | spin_unlock_irqrestore(&gedf_env->fz_waiters[cpu].lock, flags); | 1139 | spin_unlock_irqrestore(&gedf_env->fz_waiters[cpu].lock, flags); |
1139 | } | 1140 | } |
1140 | 1141 | ||
@@ -1158,9 +1159,6 @@ static int gedf_env_omlp_unlock(struct litmus_lock* l) | |||
1158 | 1159 | ||
1159 | tsk_rt(t)->num_locks_held--; | 1160 | tsk_rt(t)->num_locks_held--; |
1160 | 1161 | ||
1161 | // Make the task preemptive again | ||
1162 | take_np(t); | ||
1163 | |||
1164 | /* check if there are jobs waiting for this resource */ | 1162 | /* check if there are jobs waiting for this resource */ |
1165 | next = omlp_dequeue(sem); | 1163 | next = omlp_dequeue(sem); |
1166 | if (next) { | 1164 | if (next) { |
@@ -1204,6 +1202,8 @@ static int gedf_env_omlp_unlock(struct litmus_lock* l) | |||
1204 | clear_priority_inheritance(t); | 1202 | clear_priority_inheritance(t); |
1205 | 1203 | ||
1206 | out: | 1204 | out: |
1205 | if (likely(tsk_rt(t)->ctrl_page)) | ||
1206 | tsk_rt(t)->ctrl_page->sched.np.flag = 0; | ||
1207 | spin_unlock_irqrestore(&sem->fifo_wait.lock, flags); | 1207 | spin_unlock_irqrestore(&sem->fifo_wait.lock, flags); |
1208 | 1208 | ||
1209 | return err; | 1209 | return err; |