diff options
author | Namhoon Kim <namhoonk@cs.unc.edu> | 2017-04-23 23:16:37 -0400 |
---|---|---|
committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2017-04-23 23:16:37 -0400 |
commit | de945bf970cbb332c0540b2cd071ec3c7e4b7833 (patch) | |
tree | 8a616084f5467da652572646b31c22e2dd65d15c | |
parent | 882b5d8da76993321ae5bff46ab408d1ca9259b7 (diff) |
mode 0 fix
-rw-r--r-- | litmus/Kconfig | 2 | ||||
-rw-r--r-- | litmus/sched_mc2.c | 62 |
2 files changed, 18 insertions, 46 deletions
diff --git a/litmus/Kconfig b/litmus/Kconfig index babb43deffb5..2253be5e74eb 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig | |||
@@ -243,7 +243,7 @@ config SCHED_TASK_TRACE | |||
243 | config SCHED_TASK_TRACE_SHIFT | 243 | config SCHED_TASK_TRACE_SHIFT |
244 | int "Buffer size for sched_trace_xxx() events" | 244 | int "Buffer size for sched_trace_xxx() events" |
245 | depends on SCHED_TASK_TRACE | 245 | depends on SCHED_TASK_TRACE |
246 | range 8 13 | 246 | range 8 14 |
247 | default 9 | 247 | default 9 |
248 | help | 248 | help |
249 | 249 | ||
diff --git a/litmus/sched_mc2.c b/litmus/sched_mc2.c index a000242d5045..415e5fe3bf12 100644 --- a/litmus/sched_mc2.c +++ b/litmus/sched_mc2.c | |||
@@ -923,18 +923,20 @@ struct task_struct* mc2_dispatch(struct sup_reservation_environment* sup_env, st | |||
923 | } else { | 923 | } else { |
924 | //if (!is_init_finished(tsk)) { | 924 | //if (!is_init_finished(tsk)) { |
925 | TRACE_TASK(tsk, "num_sync_released = %d, mode = %d\n", num_sync_released, mode); | 925 | TRACE_TASK(tsk, "num_sync_released = %d, mode = %d\n", num_sync_released, mode); |
926 | if (num_sync_released != 0 && mode == 0) { | 926 | // if (num_sync_released != 0 && mode == 0) { |
927 | //ce = &state->crit_entries[lv]; | 927 | //ce = &state->crit_entries[lv]; |
928 | sup_scheduler_update_after(sup_env, res->cur_budget); | 928 | sup_scheduler_update_after(sup_env, res->cur_budget); |
929 | res->blocked_by_ghost = 0; | 929 | res->blocked_by_ghost = 0; |
930 | res->is_ghost = NO_CPU; | 930 | res->is_ghost = NO_CPU; |
931 | return tsk; | 931 | return tsk; |
932 | /* | ||
932 | } else if (res->mode == mode) { | 933 | } else if (res->mode == mode) { |
933 | sup_scheduler_update_after(sup_env, res->cur_budget); | 934 | sup_scheduler_update_after(sup_env, res->cur_budget); |
934 | res->blocked_by_ghost = 0; | 935 | res->blocked_by_ghost = 0; |
935 | res->is_ghost = NO_CPU; | 936 | res->is_ghost = NO_CPU; |
936 | return tsk; | 937 | return tsk; |
937 | } | 938 | } |
939 | */ | ||
938 | } | 940 | } |
939 | } | 941 | } |
940 | } | 942 | } |
@@ -961,47 +963,17 @@ struct task_struct* mc2_global_dispatch(struct mc2_cpu_state* state) | |||
961 | } | 963 | } |
962 | if (likely(tsk)) { | 964 | if (likely(tsk)) { |
963 | lv = get_task_crit_level(tsk); | 965 | lv = get_task_crit_level(tsk); |
964 | if (lv == NUM_CRIT_LEVELS) { | 966 | if (lv != CRIT_LEVEL_C) |
967 | BUG(); | ||
965 | #if BUDGET_ENFORCEMENT_AT_C | 968 | #if BUDGET_ENFORCEMENT_AT_C |
966 | gmp_add_event_after(_global_env, res->cur_budget, res->id, EVENT_DRAIN); | 969 | gmp_add_event_after(_global_env, res->cur_budget, res->id, EVENT_DRAIN); |
967 | #endif | ||
968 | res->event_added = 1; | ||
969 | res->blocked_by_ghost = 0; | ||
970 | res->is_ghost = NO_CPU; | ||
971 | res->scheduled_on = state->cpu; | ||
972 | raw_spin_unlock(&mode_lock); | ||
973 | return tsk; | ||
974 | } else { | ||
975 | //if (!is_init_finished(tsk)) { | ||
976 | if (num_sync_released != 0 && mode == 0) { | ||
977 | //ce = &state->crit_entries[lv]; | ||
978 | //if (likely(!ce->running)) { | ||
979 | #if BUDGET_ENFORCEMENT_AT_C | ||
980 | gmp_add_event_after(_global_env, res->cur_budget, res->id, EVENT_DRAIN); | ||
981 | #endif | ||
982 | res->event_added = 1; | ||
983 | res->blocked_by_ghost = 0; | ||
984 | res->is_ghost = NO_CPU; | ||
985 | res->scheduled_on = state->cpu; | ||
986 | raw_spin_unlock(&mode_lock); | ||
987 | return tsk; | ||
988 | } else if (res->mode == mode) { | ||
989 | #if BUDGET_ENFORCEMENT_AT_C | ||
990 | gmp_add_event_after(_global_env, res->cur_budget, res->id, EVENT_DRAIN); | ||
991 | #endif | 970 | #endif |
992 | res->event_added = 1; | 971 | res->event_added = 1; |
993 | res->blocked_by_ghost = 0; | 972 | res->blocked_by_ghost = 0; |
994 | res->is_ghost = NO_CPU; | 973 | res->is_ghost = NO_CPU; |
995 | res->scheduled_on = state->cpu; | 974 | res->scheduled_on = state->cpu; |
996 | raw_spin_unlock(&mode_lock); | 975 | raw_spin_unlock(&mode_lock); |
997 | return tsk; | 976 | return tsk; |
998 | } | ||
999 | //} else { | ||
1000 | // res->blocked_by_ghost = 1; | ||
1001 | // TRACE_TASK(ce->running, " is GHOST\n"); | ||
1002 | // return NULL; | ||
1003 | //} | ||
1004 | } | ||
1005 | } | 977 | } |
1006 | } | 978 | } |
1007 | } | 979 | } |