diff options
author | Namhoon Kim <namhoonk@cs.unc.edu> | 2016-04-19 15:57:24 -0400 |
---|---|---|
committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2016-04-19 15:57:24 -0400 |
commit | 01badda6e746d36d43b35bc847459d6103865dd7 (patch) | |
tree | 59798fbbf90217fd1db95d5bd43ccc1d3668c869 /litmus | |
parent | fbd02670f0fef4b1b47585d670a56af33a267399 (diff) |
Add NP support for MC2
Diffstat (limited to 'litmus')
-rw-r--r-- | litmus/sched_mc2.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/litmus/sched_mc2.c b/litmus/sched_mc2.c index 0ff27135c825..e4b5e607c7cc 100644 --- a/litmus/sched_mc2.c +++ b/litmus/sched_mc2.c | |||
@@ -766,6 +766,7 @@ static inline void post_schedule(struct task_struct *next, int cpu) | |||
766 | */ | 766 | */ |
767 | static struct task_struct* mc2_schedule(struct task_struct * prev) | 767 | static struct task_struct* mc2_schedule(struct task_struct * prev) |
768 | { | 768 | { |
769 | int np, blocks, exists; | ||
769 | /* next == NULL means "schedule background work". */ | 770 | /* next == NULL means "schedule background work". */ |
770 | lt_t now; | 771 | lt_t now; |
771 | struct mc2_cpu_state *state = local_cpu_state(); | 772 | struct mc2_cpu_state *state = local_cpu_state(); |
@@ -784,6 +785,11 @@ static struct task_struct* mc2_schedule(struct task_struct * prev) | |||
784 | if (state->scheduled && !is_realtime(prev)) | 785 | if (state->scheduled && !is_realtime(prev)) |
785 | ; //printk(KERN_ALERT "BUG2!!!!!!!! \n"); | 786 | ; //printk(KERN_ALERT "BUG2!!!!!!!! \n"); |
786 | 787 | ||
788 | /* (0) Determine state */ | ||
789 | exists = state->scheduled != NULL; | ||
790 | blocks = exists && !is_current_running(); | ||
791 | np = exists && is_np(state->scheduled); | ||
792 | |||
787 | /* update time */ | 793 | /* update time */ |
788 | state->sup_env.will_schedule = true; | 794 | state->sup_env.will_schedule = true; |
789 | 795 | ||
@@ -806,10 +812,9 @@ static struct task_struct* mc2_schedule(struct task_struct * prev) | |||
806 | } | 812 | } |
807 | 813 | ||
808 | /* figure out what to schedule next */ | 814 | /* figure out what to schedule next */ |
809 | state->scheduled = mc2_dispatch(&state->sup_env, state); | 815 | if (!np) |
810 | /* if (state->scheduled && is_realtime(state->scheduled)) | 816 | state->scheduled = mc2_dispatch(&state->sup_env, state); |
811 | TRACE_TASK(state->scheduled, "mc2_dispatch picked me!\n"); | 817 | |
812 | */ | ||
813 | if (!state->scheduled) { | 818 | if (!state->scheduled) { |
814 | raw_spin_lock(&_global_env.lock); | 819 | raw_spin_lock(&_global_env.lock); |
815 | gmp_update_time(&_global_env, now); | 820 | gmp_update_time(&_global_env, now); |