diff options
Diffstat (limited to 'litmus/sched_gsn_edf.c')
-rw-r--r-- | litmus/sched_gsn_edf.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index f2c5f180e819..16f532d690cb 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -13,25 +13,22 @@ | |||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/uaccess.h> | 15 | #include <linux/uaccess.h> |
16 | 16 | #include <linux/module.h> | |
17 | |||
18 | #ifdef CONFIG_LITMUS_NESTED_LOCKING | ||
19 | #include <linux/uaccess.h> | ||
20 | #endif | ||
21 | 17 | ||
22 | #include <litmus/litmus.h> | 18 | #include <litmus/litmus.h> |
23 | #include <litmus/jobs.h> | 19 | #include <litmus/jobs.h> |
24 | #include <litmus/sched_plugin.h> | 20 | #include <litmus/sched_plugin.h> |
25 | #include <litmus/edf_common.h> | 21 | #include <litmus/edf_common.h> |
26 | #include <litmus/sched_trace.h> | 22 | #include <litmus/sched_trace.h> |
27 | #include <litmus/trace.h> | ||
28 | 23 | ||
29 | #include <litmus/preempt.h> | 24 | #include <litmus/preempt.h> |
30 | 25 | ||
31 | #include <litmus/bheap.h> | 26 | #include <litmus/bheap.h> |
32 | #include <litmus/binheap.h> | 27 | #include <litmus/binheap.h> |
33 | 28 | ||
29 | #ifdef CONFIG_LITMUS_LOCKING | ||
34 | #include <litmus/kfmlp_lock.h> | 30 | #include <litmus/kfmlp_lock.h> |
31 | #endif | ||
35 | 32 | ||
36 | #ifdef CONFIG_LITMUS_NESTED_LOCKING | 33 | #ifdef CONFIG_LITMUS_NESTED_LOCKING |
37 | #include <litmus/rsm_lock.h> | 34 | #include <litmus/rsm_lock.h> |
@@ -42,12 +39,6 @@ | |||
42 | #include <litmus/affinity.h> | 39 | #include <litmus/affinity.h> |
43 | #endif | 40 | #endif |
44 | 41 | ||
45 | #include <linux/module.h> | ||
46 | |||
47 | #ifdef CONFIG_SCHED_CPU_AFFINITY | ||
48 | #include <litmus/affinity.h> | ||
49 | #endif | ||
50 | |||
51 | #ifdef CONFIG_LITMUS_SOFTIRQD | 42 | #ifdef CONFIG_LITMUS_SOFTIRQD |
52 | #include <litmus/litmus_softirq.h> | 43 | #include <litmus/litmus_softirq.h> |
53 | #endif | 44 | #endif |
@@ -445,17 +436,24 @@ static void gsnedf_tick(struct task_struct* t) | |||
445 | static void __do_lit_tasklet(struct tasklet_struct* tasklet, unsigned long flushed) | 436 | static void __do_lit_tasklet(struct tasklet_struct* tasklet, unsigned long flushed) |
446 | { | 437 | { |
447 | if (!atomic_read(&tasklet->count)) { | 438 | if (!atomic_read(&tasklet->count)) { |
448 | sched_trace_tasklet_begin(tasklet->owner); | 439 | if(tasklet->owner) { |
440 | sched_trace_tasklet_begin(tasklet->owner); | ||
441 | } | ||
449 | 442 | ||
450 | if (!test_and_clear_bit(TASKLET_STATE_SCHED, &tasklet->state)) | 443 | if (!test_and_clear_bit(TASKLET_STATE_SCHED, &tasklet->state)) |
451 | { | 444 | { |
452 | BUG(); | 445 | BUG(); |
453 | } | 446 | } |
454 | TRACE("%s: Invoking tasklet with owner pid = %d (flushed = %d).\n", __FUNCTION__, tasklet->owner->pid, flushed); | 447 | TRACE("%s: Invoking tasklet with owner pid = %d (flushed = %d).\n", |
448 | __FUNCTION__, | ||
449 | (tasklet->owner) ? tasklet->owner->pid : -1, | ||
450 | (tasklet->owner) ? 0 : 1); | ||
455 | tasklet->func(tasklet->data); | 451 | tasklet->func(tasklet->data); |
456 | tasklet_unlock(tasklet); | 452 | tasklet_unlock(tasklet); |
457 | 453 | ||
458 | sched_trace_tasklet_end(tasklet->owner, flushed); | 454 | if(tasklet->owner) { |
455 | sched_trace_tasklet_end(tasklet->owner, flushed); | ||
456 | } | ||
459 | } | 457 | } |
460 | else { | 458 | else { |
461 | BUG(); | 459 | BUG(); |
@@ -1130,8 +1128,6 @@ static void __increase_priority_inheritance(struct task_struct* t, | |||
1130 | /* called with IRQs off */ | 1128 | /* called with IRQs off */ |
1131 | static void increase_priority_inheritance(struct task_struct* t, struct task_struct* prio_inh) | 1129 | static void increase_priority_inheritance(struct task_struct* t, struct task_struct* prio_inh) |
1132 | { | 1130 | { |
1133 | int i = 0; | ||
1134 | |||
1135 | raw_spin_lock(&gsnedf_lock); | 1131 | raw_spin_lock(&gsnedf_lock); |
1136 | 1132 | ||
1137 | __increase_priority_inheritance(t, prio_inh); | 1133 | __increase_priority_inheritance(t, prio_inh); |
@@ -1150,6 +1146,7 @@ static void increase_priority_inheritance(struct task_struct* t, struct task_str | |||
1150 | 1146 | ||
1151 | #if defined(CONFIG_LITMUS_PAI_SOFTIRQD) && defined(CONFIG_LITMUS_NVIDIA) | 1147 | #if defined(CONFIG_LITMUS_PAI_SOFTIRQD) && defined(CONFIG_LITMUS_NVIDIA) |
1152 | if(tsk_rt(t)->held_gpus) { | 1148 | if(tsk_rt(t)->held_gpus) { |
1149 | int i; | ||
1153 | for(i = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus)); | 1150 | for(i = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus)); |
1154 | i < NV_DEVICE_NUM; | 1151 | i < NV_DEVICE_NUM; |
1155 | i = find_next_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus), i+1)) { | 1152 | i = find_next_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus), i+1)) { |
@@ -1217,8 +1214,6 @@ static void __decrease_priority_inheritance(struct task_struct* t, | |||
1217 | static void decrease_priority_inheritance(struct task_struct* t, | 1214 | static void decrease_priority_inheritance(struct task_struct* t, |
1218 | struct task_struct* prio_inh) | 1215 | struct task_struct* prio_inh) |
1219 | { | 1216 | { |
1220 | int i; | ||
1221 | |||
1222 | raw_spin_lock(&gsnedf_lock); | 1217 | raw_spin_lock(&gsnedf_lock); |
1223 | __decrease_priority_inheritance(t, prio_inh); | 1218 | __decrease_priority_inheritance(t, prio_inh); |
1224 | 1219 | ||
@@ -1236,6 +1231,7 @@ static void decrease_priority_inheritance(struct task_struct* t, | |||
1236 | 1231 | ||
1237 | #if defined(CONFIG_LITMUS_PAI_SOFTIRQD) && defined(CONFIG_LITMUS_NVIDIA) | 1232 | #if defined(CONFIG_LITMUS_PAI_SOFTIRQD) && defined(CONFIG_LITMUS_NVIDIA) |
1238 | if(tsk_rt(t)->held_gpus) { | 1233 | if(tsk_rt(t)->held_gpus) { |
1234 | int i; | ||
1239 | for(i = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus)); | 1235 | for(i = find_first_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus)); |
1240 | i < NV_DEVICE_NUM; | 1236 | i < NV_DEVICE_NUM; |
1241 | i = find_next_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus), i+1)) { | 1237 | i = find_next_bit(&tsk_rt(t)->held_gpus, sizeof(tsk_rt(t)->held_gpus), i+1)) { |
@@ -1723,13 +1719,16 @@ static long gsnedf_allocate_affinity_observer( | |||
1723 | case KFMLP_SIMPLE_GPU_AFF_OBS: | 1719 | case KFMLP_SIMPLE_GPU_AFF_OBS: |
1724 | *aff_obs = kfmlp_simple_gpu_aff_obs_new(&gsnedf_kfmlp_affinity_ops, args); | 1720 | *aff_obs = kfmlp_simple_gpu_aff_obs_new(&gsnedf_kfmlp_affinity_ops, args); |
1725 | break; | 1721 | break; |
1722 | |||
1726 | case KFMLP_GPU_AFF_OBS: | 1723 | case KFMLP_GPU_AFF_OBS: |
1727 | *aff_obs = kfmlp_gpu_aff_obs_new(&gsnedf_kfmlp_affinity_ops, args); | 1724 | *aff_obs = kfmlp_gpu_aff_obs_new(&gsnedf_kfmlp_affinity_ops, args); |
1728 | break; | 1725 | break; |
1726 | |||
1729 | #ifdef CONFIG_LITMUS_NESTED_LOCKING | 1727 | #ifdef CONFIG_LITMUS_NESTED_LOCKING |
1730 | case IKGLP_SIMPLE_GPU_AFF_OBS: | 1728 | case IKGLP_SIMPLE_GPU_AFF_OBS: |
1731 | *aff_obs = ikglp_simple_gpu_aff_obs_new(&gsnedf_ikglp_affinity_ops, args); | 1729 | *aff_obs = ikglp_simple_gpu_aff_obs_new(&gsnedf_ikglp_affinity_ops, args); |
1732 | break; | 1730 | break; |
1731 | |||
1733 | case IKGLP_GPU_AFF_OBS: | 1732 | case IKGLP_GPU_AFF_OBS: |
1734 | *aff_obs = ikglp_gpu_aff_obs_new(&gsnedf_ikglp_affinity_ops, args); | 1733 | *aff_obs = ikglp_gpu_aff_obs_new(&gsnedf_ikglp_affinity_ops, args); |
1735 | break; | 1734 | break; |