diff options
author | Namhoon Kim <namhoonk@cs.unc.edu> | 2014-11-04 05:01:31 -0500 |
---|---|---|
committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2014-11-04 05:01:31 -0500 |
commit | cef9a08794f4ecdd0d1ea80ef4035f2bc9e234ce (patch) | |
tree | c8103a770f5a4fb19dab4628e2483258f3e23207 | |
parent | 3805cbc73a63f74166c65446395785390d7ad44b (diff) |
Add MC2 plugin
-rw-r--r-- | litmus/Makefile | 4 | ||||
-rw-r--r-- | litmus/litmus.c | 2 | ||||
-rw-r--r-- | litmus/reservation.c | 6 | ||||
-rw-r--r-- | litmus/sched_mc2.c | 4 |
4 files changed, 11 insertions, 5 deletions
diff --git a/litmus/Makefile b/litmus/Makefile index 05021f553eda..997524f91363 100644 --- a/litmus/Makefile +++ b/litmus/Makefile | |||
@@ -19,6 +19,7 @@ obj-y = sched_plugin.o litmus.o \ | |||
19 | binheap.o \ | 19 | binheap.o \ |
20 | ctrldev.o \ | 20 | ctrldev.o \ |
21 | uncachedev.o \ | 21 | uncachedev.o \ |
22 | cache_proc.o \ | ||
22 | sched_gsn_edf.o \ | 23 | sched_gsn_edf.o \ |
23 | sched_psn_edf.o \ | 24 | sched_psn_edf.o \ |
24 | sched_pfp.o | 25 | sched_pfp.o |
@@ -35,4 +36,5 @@ obj-$(CONFIG_SCHED_OVERHEAD_TRACE) += trace.o | |||
35 | 36 | ||
36 | obj-y += reservation.o polling_reservations.o | 37 | obj-y += reservation.o polling_reservations.o |
37 | 38 | ||
38 | obj-y += sched_pres.o \ No newline at end of file | 39 | obj-y += sched_pres.o |
40 | obj-y += mc2_common.o sched_mc2.o | ||
diff --git a/litmus/litmus.c b/litmus/litmus.c index 0b87e040cb73..8a2446f26f72 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -646,7 +646,7 @@ static void __init litmus_enable_perfcounters_v7(void *_ignore) | |||
646 | asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(enable_val)); | 646 | asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(enable_val)); |
647 | 647 | ||
648 | /* enables counters (cycle counter and event 1) */ | 648 | /* enables counters (cycle counter and event 1) */ |
649 | asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(0x80000001)); | 649 | asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(0x80000001)); |
650 | } | 650 | } |
651 | 651 | ||
652 | static void __init litmus_enable_perfcounters(void) | 652 | static void __init litmus_enable_perfcounters(void) |
diff --git a/litmus/reservation.c b/litmus/reservation.c index 0bc551e2e67b..0e43479ff2e1 100644 --- a/litmus/reservation.c +++ b/litmus/reservation.c | |||
@@ -211,7 +211,7 @@ static void sup_charge_budget( | |||
211 | /* stop at the first ACTIVE reservation */ | 211 | /* stop at the first ACTIVE reservation */ |
212 | break; | 212 | break; |
213 | } | 213 | } |
214 | TRACE("finished charging budgets\n"); | 214 | //TRACE("finished charging budgets\n"); |
215 | } | 215 | } |
216 | 216 | ||
217 | static void sup_replenish_budgets(struct sup_reservation_environment* sup_env) | 217 | static void sup_replenish_budgets(struct sup_reservation_environment* sup_env) |
@@ -228,7 +228,7 @@ static void sup_replenish_budgets(struct sup_reservation_environment* sup_env) | |||
228 | break; | 228 | break; |
229 | } | 229 | } |
230 | } | 230 | } |
231 | TRACE("finished replenishing budgets\n"); | 231 | //TRACE("finished replenishing budgets\n"); |
232 | 232 | ||
233 | /* request a scheduler update at the next replenishment instant */ | 233 | /* request a scheduler update at the next replenishment instant */ |
234 | res = list_first_entry_or_null(&sup_env->depleted_reservations, | 234 | res = list_first_entry_or_null(&sup_env->depleted_reservations, |
@@ -246,7 +246,7 @@ void sup_update_time( | |||
246 | /* If the time didn't advance, there is nothing to do. | 246 | /* If the time didn't advance, there is nothing to do. |
247 | * This check makes it safe to call sup_advance_time() potentially | 247 | * This check makes it safe to call sup_advance_time() potentially |
248 | * multiple times (e.g., via different code paths. */ | 248 | * multiple times (e.g., via different code paths. */ |
249 | TRACE("(sup_update_time) now: %llu, current_time: %llu\n", now, sup_env->env.current_time); | 249 | //TRACE("(sup_update_time) now: %llu, current_time: %llu\n", now, sup_env->env.current_time); |
250 | if (unlikely(now <= sup_env->env.current_time)) | 250 | if (unlikely(now <= sup_env->env.current_time)) |
251 | return; | 251 | return; |
252 | 252 | ||
diff --git a/litmus/sched_mc2.c b/litmus/sched_mc2.c index ab35008668d6..1e5b28ba0ac3 100644 --- a/litmus/sched_mc2.c +++ b/litmus/sched_mc2.c | |||
@@ -381,6 +381,8 @@ static void mc2_task_new(struct task_struct *tsk, int on_runqueue, | |||
381 | task_new_legacy_task_model_updates(tsk); | 381 | task_new_legacy_task_model_updates(tsk); |
382 | } | 382 | } |
383 | 383 | ||
384 | static long mc2_reservation_destroy(unsigned int reservation_id, int cpu); | ||
385 | |||
384 | static void mc2_task_exit(struct task_struct *tsk) | 386 | static void mc2_task_exit(struct task_struct *tsk) |
385 | { | 387 | { |
386 | unsigned long flags; | 388 | unsigned long flags; |
@@ -404,6 +406,8 @@ static void mc2_task_exit(struct task_struct *tsk) | |||
404 | } else | 406 | } else |
405 | raw_spin_unlock_irqrestore(&state->lock, flags); | 407 | raw_spin_unlock_irqrestore(&state->lock, flags); |
406 | 408 | ||
409 | mc2_reservation_destroy(tsk->pid, tinfo->cpu); | ||
410 | |||
407 | kfree(tsk_rt(tsk)->plugin_state); | 411 | kfree(tsk_rt(tsk)->plugin_state); |
408 | tsk_rt(tsk)->plugin_state = NULL; | 412 | tsk_rt(tsk)->plugin_state = NULL; |
409 | } | 413 | } |