aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2017-04-23 21:20:14 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2017-04-23 21:20:14 -0400
commit882b5d8da76993321ae5bff46ab408d1ca9259b7 (patch)
tree2c3c279ca518bc79482864ede2deb4ccd23cff58
parentba55436349e1a0d41964966430e9c65eff35b1dc (diff)
deadlock patch
-rw-r--r--litmus/sched_mc2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/litmus/sched_mc2.c b/litmus/sched_mc2.c
index aa3d999d60ed..a000242d5045 100644
--- a/litmus/sched_mc2.c
+++ b/litmus/sched_mc2.c
@@ -1231,13 +1231,16 @@ static void mc2_task_resume(struct task_struct *tsk)
1231 1231
1232 TRACE_TASK(tsk, "thread wakes up at %llu\n", litmus_clock()); 1232 TRACE_TASK(tsk, "thread wakes up at %llu\n", litmus_clock());
1233 1233
1234 local_irq_save(flags); 1234 //local_irq_save(flags);
1235 TRACE_TASK(tsk, "preemptible?? %d\n", preemptible());
1236 preempt_disable();
1235 tinfo = get_mc2_state(tsk); 1237 tinfo = get_mc2_state(tsk);
1236 if (tinfo->cpu != -1) 1238 if (tinfo->cpu != -1)
1237 state = cpu_state_for(tinfo->cpu); 1239 state = cpu_state_for(tinfo->cpu);
1238 else 1240 else
1239 state = local_cpu_state(); 1241 state = local_cpu_state();
1240 1242 preempt_enable();
1243
1241 /* 9/20/2015 fix 1244 /* 9/20/2015 fix
1242 raw_spin_lock(&_global_env.lock); 1245 raw_spin_lock(&_global_env.lock);
1243 */ 1246 */
@@ -1271,6 +1274,7 @@ static void mc2_task_resume(struct task_struct *tsk)
1271 } 1274 }
1272 1275
1273 raw_spin_lock(&state->lock); 1276 raw_spin_lock(&state->lock);
1277 local_irq_save(flags);
1274 /* Assumption: litmus_clock() is synchronized across cores, 1278 /* Assumption: litmus_clock() is synchronized across cores,
1275 * since we might not actually be executing on tinfo->cpu 1279 * since we might not actually be executing on tinfo->cpu
1276 * at the moment. */ 1280 * at the moment. */
@@ -1290,13 +1294,14 @@ static void mc2_task_resume(struct task_struct *tsk)
1290 //task_arrives(state, tsk); 1294 //task_arrives(state, tsk);
1291 /* NOTE: drops state->lock */ 1295 /* NOTE: drops state->lock */
1292 TRACE_TASK(tsk, "mc2_resume()\n"); 1296 TRACE_TASK(tsk, "mc2_resume()\n");
1297 local_irq_restore(flags);
1293 mc2_update_timer_and_unlock(state); 1298 mc2_update_timer_and_unlock(state);
1294 } else { 1299 } else {
1295 TRACE_TASK(tsk, "resume event ignored, still scheduled\n"); 1300 TRACE_TASK(tsk, "resume event ignored, still scheduled\n");
1296 //raw_spin_unlock(&_global_env.lock); 1301 //raw_spin_unlock(&_global_env.lock);
1297 } 1302 }
1298 1303
1299 local_irq_restore(flags); 1304 //local_irq_restore(flags);
1300 1305
1301 //gmp_free_passed_event(); 1306 //gmp_free_passed_event();
1302 resume_legacy_task_model_updates(tsk); 1307 resume_legacy_task_model_updates(tsk);