diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/interrupt.h | 6 | ||||
-rw-r--r-- | include/litmus/aux_tasks.h | 10 | ||||
-rw-r--r-- | include/litmus/litmus_softirq.h | 164 | ||||
-rw-r--r-- | include/litmus/nvidia_info.h | 35 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 70 | ||||
-rw-r--r-- | include/litmus/sched_plugin.h | 11 | ||||
-rw-r--r-- | include/litmus/signal.h | 2 | ||||
-rw-r--r-- | include/litmus/unistd_32.h | 5 | ||||
-rw-r--r-- | include/litmus/unistd_64.h | 6 |
9 files changed, 143 insertions, 166 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 57a7bc8807be..9fc31289a1bb 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -507,6 +507,12 @@ struct tasklet_struct | |||
507 | #endif | 507 | #endif |
508 | }; | 508 | }; |
509 | 509 | ||
510 | struct tasklet_head | ||
511 | { | ||
512 | struct tasklet_struct *head; | ||
513 | struct tasklet_struct **tail; | ||
514 | }; | ||
515 | |||
510 | #define DECLARE_TASKLET(name, func, data) \ | 516 | #define DECLARE_TASKLET(name, func, data) \ |
511 | struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } | 517 | struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } |
512 | 518 | ||
diff --git a/include/litmus/aux_tasks.h b/include/litmus/aux_tasks.h index 87745c1c0df0..255bbafcc6b7 100644 --- a/include/litmus/aux_tasks.h +++ b/include/litmus/aux_tasks.h | |||
@@ -3,9 +3,6 @@ | |||
3 | 3 | ||
4 | struct task_struct; | 4 | struct task_struct; |
5 | 5 | ||
6 | /* admit an aux task with default parameters */ | ||
7 | //int admit_aux_task(struct task_struct *t); | ||
8 | |||
9 | int make_aux_task_if_required(struct task_struct *t); | 6 | int make_aux_task_if_required(struct task_struct *t); |
10 | 7 | ||
11 | /* call on an aux task when it exits real-time */ | 8 | /* call on an aux task when it exits real-time */ |
@@ -17,13 +14,6 @@ long enable_aux_task_owner(struct task_struct *t); | |||
17 | /* call when an aux_owner exits real-time */ | 14 | /* call when an aux_owner exits real-time */ |
18 | long disable_aux_task_owner(struct task_struct *t); | 15 | long disable_aux_task_owner(struct task_struct *t); |
19 | 16 | ||
20 | |||
21 | /* collectivelly make all aux tasks in the process of leader inherit from hp */ | ||
22 | //int aux_tasks_increase_priority(struct task_struct *leader, struct task_struct *hp); | ||
23 | |||
24 | /* collectivelly make all aux tasks in the process of leader inherit from hp */ | ||
25 | //int aux_tasks_decrease_priority(struct task_struct *leader, struct task_struct *hp); | ||
26 | |||
27 | /* call when an aux_owner increases its priority */ | 17 | /* call when an aux_owner increases its priority */ |
28 | int aux_task_owner_increase_priority(struct task_struct *t); | 18 | int aux_task_owner_increase_priority(struct task_struct *t); |
29 | 19 | ||
diff --git a/include/litmus/litmus_softirq.h b/include/litmus/litmus_softirq.h index 46fe89148505..52e3f7e74ab1 100644 --- a/include/litmus/litmus_softirq.h +++ b/include/litmus/litmus_softirq.h | |||
@@ -5,129 +5,113 @@ | |||
5 | #include <linux/workqueue.h> | 5 | #include <linux/workqueue.h> |
6 | 6 | ||
7 | /* | 7 | /* |
8 | Threaded tasklet handling for Litmus. Tasklets | 8 | Threaded tasklet/workqueue handling for Litmus. |
9 | are scheduled with the priority of the tasklet's | 9 | Items are scheduled in the following order: hi-tasklet, |
10 | owner---that is, the RT task on behalf the tasklet | 10 | lo-tasklet, workqueue. Items are scheduled in FIFO order |
11 | runs. | 11 | within each of these classes. |
12 | |||
13 | Tasklets are current scheduled in FIFO order with | ||
14 | NO priority inheritance for "blocked" tasklets. | ||
15 | 12 | ||
16 | klmirqd assumes the priority of the owner of the | 13 | klmirqd assumes the priority of the owner of the |
17 | tasklet when the tasklet is next to execute. | 14 | tasklet when the tasklet is next to execute. |
18 | 15 | ||
19 | Currently, hi-tasklets are scheduled before | 16 | The base-priority of a klimirqd thread is below all regular |
20 | low-tasklets, regardless of priority of low-tasklets. | 17 | real-time tasks, but above all other Linux scheduling |
21 | And likewise, low-tasklets are scheduled before work | 18 | classes (klmirqd threads are within the SHCED_LITMUS class). |
22 | queue objects. This priority inversion probably needs | 19 | Regular real-time tasks may increase the priority of |
23 | to be fixed, though it is not an issue if our work with | 20 | a klmirqd thread, but klmirqd is unaware of this |
24 | GPUs as GPUs are owned (and associated klmirqds) for | 21 | (this was not the case in prior incarnations of klmirqd). |
25 | exclusive time periods, thus no inversions can | ||
26 | occur. | ||
27 | */ | 22 | */ |
28 | 23 | ||
29 | 24 | ||
30 | 25 | /* Initialize klmirqd */ | |
31 | #define NR_LITMUS_SOFTIRQD CONFIG_NR_LITMUS_SOFTIRQD | 26 | void init_klmirqd(void); |
32 | |||
33 | /* Spawns NR_LITMUS_SOFTIRQD klmirqd daemons. | ||
34 | Actual launch of threads is deffered to kworker's | ||
35 | workqueue, so daemons will likely not be immediately | ||
36 | running when this function returns, though the required | ||
37 | data will be initialized. | ||
38 | |||
39 | @affinity_set: an array expressing the processor affinity | ||
40 | for each of the NR_LITMUS_SOFTIRQD daemons. May be set | ||
41 | to NULL for global scheduling. | ||
42 | |||
43 | - Examples - | ||
44 | 8-CPU system with two CPU clusters: | ||
45 | affinity[] = {0, 0, 0, 0, 3, 3, 3, 3} | ||
46 | NOTE: Daemons not actually bound to specified CPU, but rather | ||
47 | cluster in which the CPU resides. | ||
48 | |||
49 | 8-CPU system, partitioned: | ||
50 | affinity[] = {0, 1, 2, 3, 4, 5, 6, 7} | ||
51 | |||
52 | FIXME: change array to a CPU topology or array of cpumasks | ||
53 | |||
54 | */ | ||
55 | void spawn_klmirqd(int* affinity); | ||
56 | |||
57 | 27 | ||
58 | /* Raises a flag to tell klmirqds to terminate. | 28 | /* Raises a flag to tell klmirqds to terminate. |
59 | Termination is async, so some threads may be running | 29 | Termination is async, so some threads may be running |
60 | after function return. */ | 30 | after function return. */ |
61 | void kill_klmirqd(void); | 31 | void kill_klmirqd(void); |
62 | 32 | ||
33 | void kill_klmirqd_thread(struct task_struct* klmirqd_thread); | ||
63 | 34 | ||
64 | /* Returns 1 if all NR_LITMUS_SOFTIRQD klitirqs are ready | 35 | /* Returns 1 if all NR_LITMUS_SOFTIRQD klitirqs are ready |
65 | to handle tasklets. 0, otherwise.*/ | 36 | to handle tasklets. 0, otherwise.*/ |
66 | int klmirqd_is_ready(void); | 37 | int klmirqd_is_ready(void); |
67 | 38 | ||
68 | /* Returns 1 if no NR_LITMUS_SOFTIRQD klitirqs are ready | 39 | /* Returns 1 if no NR_LITMUS_SOFTIRQD klitirqs are ready |
69 | to handle tasklets. 0, otherwise.*/ | 40 | to handle tasklets. 0, otherwise.*/ |
70 | int klmirqd_is_dead(void); | 41 | int klmirqd_is_dead(void); |
71 | 42 | ||
72 | /* Flushes all pending work out to the OS for regular | 43 | |
73 | * tasklet/work processing of the specified 'owner' | 44 | typedef int (*klmirqd_cb_t) (void *arg); |
74 | * | 45 | |
75 | * PRECOND: klmirqd_thread must have a clear entry | 46 | typedef struct |
76 | * in the GPU registry, otherwise this call will become | 47 | { |
77 | * a no-op as work will loop back to the klmirqd_thread. | 48 | klmirqd_cb_t func; |
78 | * | 49 | void* arg; |
79 | * Pass NULL for owner to flush ALL pending items. | 50 | } klmirqd_callback_t; |
51 | |||
52 | /* Launches a klmirqd thread with the provided affinity. | ||
53 | |||
54 | Actual launch of threads is deffered to kworker's | ||
55 | workqueue, so daemons will likely not be immediately | ||
56 | running when this function returns, though the required | ||
57 | data will be initialized. | ||
58 | |||
59 | cpu == -1 for no affinity | ||
80 | */ | 60 | */ |
81 | void flush_pending(struct task_struct* klmirqd_thread, | 61 | int launch_klmirqd_thread(int cpu, klmirqd_callback_t* cb); |
82 | struct task_struct* owner); | ||
83 | 62 | ||
84 | struct task_struct* get_klmirqd(unsigned int k_id); | ||
85 | 63 | ||
64 | /* Flushes all pending work out to the OS for regular | ||
65 | * tasklet/work processing. | ||
66 | */ | ||
67 | void flush_pending(struct task_struct* klmirqd_thread); | ||
86 | 68 | ||
87 | extern int __litmus_tasklet_schedule( | 69 | extern int __litmus_tasklet_schedule( |
88 | struct tasklet_struct *t, | 70 | struct tasklet_struct *t, |
89 | unsigned int k_id); | 71 | struct task_struct *klmirqd_thread); |
90 | 72 | ||
91 | /* schedule a tasklet on klmirqd #k_id */ | 73 | /* schedule a tasklet on klmirqd #k_id */ |
92 | static inline int litmus_tasklet_schedule( | 74 | static inline int litmus_tasklet_schedule( |
93 | struct tasklet_struct *t, | 75 | struct tasklet_struct *t, |
94 | unsigned int k_id) | 76 | struct task_struct *klmirqd_thread) |
95 | { | 77 | { |
96 | int ret = 0; | 78 | int ret = 0; |
97 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | 79 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { |
98 | ret = __litmus_tasklet_schedule(t, k_id); | 80 | ret = __litmus_tasklet_schedule(t, klmirqd_thread); |
81 | } | ||
99 | return(ret); | 82 | return(ret); |
100 | } | 83 | } |
101 | 84 | ||
102 | /* for use by __tasklet_schedule() */ | 85 | /* for use by __tasklet_schedule() */ |
103 | static inline int _litmus_tasklet_schedule( | 86 | static inline int _litmus_tasklet_schedule( |
104 | struct tasklet_struct *t, | 87 | struct tasklet_struct *t, |
105 | unsigned int k_id) | 88 | struct task_struct *klmirqd_thread) |
106 | { | 89 | { |
107 | return(__litmus_tasklet_schedule(t, k_id)); | 90 | return(__litmus_tasklet_schedule(t, klmirqd_thread)); |
108 | } | 91 | } |
109 | 92 | ||
110 | 93 | ||
111 | 94 | ||
112 | 95 | ||
113 | extern int __litmus_tasklet_hi_schedule(struct tasklet_struct *t, | 96 | extern int __litmus_tasklet_hi_schedule(struct tasklet_struct *t, |
114 | unsigned int k_id); | 97 | struct task_struct *klmirqd_thread); |
115 | 98 | ||
116 | /* schedule a hi tasklet on klmirqd #k_id */ | 99 | /* schedule a hi tasklet on klmirqd #k_id */ |
117 | static inline int litmus_tasklet_hi_schedule(struct tasklet_struct *t, | 100 | static inline int litmus_tasklet_hi_schedule(struct tasklet_struct *t, |
118 | unsigned int k_id) | 101 | struct task_struct *klmirqd_thread) |
119 | { | 102 | { |
120 | int ret = 0; | 103 | int ret = 0; |
121 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | 104 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { |
122 | ret = __litmus_tasklet_hi_schedule(t, k_id); | 105 | ret = __litmus_tasklet_hi_schedule(t, klmirqd_thread); |
106 | } | ||
123 | return(ret); | 107 | return(ret); |
124 | } | 108 | } |
125 | 109 | ||
126 | /* for use by __tasklet_hi_schedule() */ | 110 | /* for use by __tasklet_hi_schedule() */ |
127 | static inline int _litmus_tasklet_hi_schedule(struct tasklet_struct *t, | 111 | static inline int _litmus_tasklet_hi_schedule(struct tasklet_struct *t, |
128 | unsigned int k_id) | 112 | struct task_struct *klmirqd_thread) |
129 | { | 113 | { |
130 | return(__litmus_tasklet_hi_schedule(t, k_id)); | 114 | return(__litmus_tasklet_hi_schedule(t, klmirqd_thread)); |
131 | } | 115 | } |
132 | 116 | ||
133 | 117 | ||
@@ -136,26 +120,27 @@ static inline int _litmus_tasklet_hi_schedule(struct tasklet_struct *t, | |||
136 | 120 | ||
137 | extern int __litmus_tasklet_hi_schedule_first( | 121 | extern int __litmus_tasklet_hi_schedule_first( |
138 | struct tasklet_struct *t, | 122 | struct tasklet_struct *t, |
139 | unsigned int k_id); | 123 | struct task_struct *klmirqd_thread); |
140 | 124 | ||
141 | /* schedule a hi tasklet on klmirqd #k_id on next go-around */ | 125 | /* schedule a hi tasklet on klmirqd #k_id on next go-around */ |
142 | /* PRECONDITION: Interrupts must be disabled. */ | 126 | /* PRECONDITION: Interrupts must be disabled. */ |
143 | static inline int litmus_tasklet_hi_schedule_first( | 127 | static inline int litmus_tasklet_hi_schedule_first( |
144 | struct tasklet_struct *t, | 128 | struct tasklet_struct *t, |
145 | unsigned int k_id) | 129 | struct task_struct *klmirqd_thread) |
146 | { | 130 | { |
147 | int ret = 0; | 131 | int ret = 0; |
148 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | 132 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { |
149 | ret = __litmus_tasklet_hi_schedule_first(t, k_id); | 133 | ret = __litmus_tasklet_hi_schedule_first(t, klmirqd_thread); |
134 | } | ||
150 | return(ret); | 135 | return(ret); |
151 | } | 136 | } |
152 | 137 | ||
153 | /* for use by __tasklet_hi_schedule_first() */ | 138 | /* for use by __tasklet_hi_schedule_first() */ |
154 | static inline int _litmus_tasklet_hi_schedule_first( | 139 | static inline int _litmus_tasklet_hi_schedule_first( |
155 | struct tasklet_struct *t, | 140 | struct tasklet_struct *t, |
156 | unsigned int k_id) | 141 | struct task_struct *klmirqd_thread) |
157 | { | 142 | { |
158 | return(__litmus_tasklet_hi_schedule_first(t, k_id)); | 143 | return(__litmus_tasklet_hi_schedule_first(t, klmirqd_thread)); |
159 | } | 144 | } |
160 | 145 | ||
161 | 146 | ||
@@ -164,36 +149,13 @@ static inline int _litmus_tasklet_hi_schedule_first( | |||
164 | 149 | ||
165 | extern int __litmus_schedule_work( | 150 | extern int __litmus_schedule_work( |
166 | struct work_struct* w, | 151 | struct work_struct* w, |
167 | unsigned int k_id); | 152 | struct task_struct *klmirqd_thread); |
168 | 153 | ||
169 | static inline int litmus_schedule_work( | 154 | static inline int litmus_schedule_work( |
170 | struct work_struct* w, | 155 | struct work_struct* w, |
171 | unsigned int k_id) | 156 | struct task_struct *klmirqd_thread) |
172 | { | 157 | { |
173 | return(__litmus_schedule_work(w, k_id)); | 158 | return(__litmus_schedule_work(w, klmirqd_thread)); |
174 | } | 159 | } |
175 | 160 | ||
176 | |||
177 | |||
178 | ///////////// mutex operations for client threads. | ||
179 | |||
180 | void down_and_set_stat(struct task_struct* t, | ||
181 | enum klmirqd_sem_status to_set, | ||
182 | struct mutex* sem); | ||
183 | |||
184 | void __down_and_reset_and_set_stat(struct task_struct* t, | ||
185 | enum klmirqd_sem_status to_reset, | ||
186 | enum klmirqd_sem_status to_set, | ||
187 | struct mutex* sem); | ||
188 | |||
189 | void up_and_set_stat(struct task_struct* t, | ||
190 | enum klmirqd_sem_status to_set, | ||
191 | struct mutex* sem); | ||
192 | |||
193 | |||
194 | |||
195 | void release_klmirqd_lock(struct task_struct* t); | ||
196 | |||
197 | int reacquire_klmirqd_lock(struct task_struct* t); | ||
198 | |||
199 | #endif | 161 | #endif |
diff --git a/include/litmus/nvidia_info.h b/include/litmus/nvidia_info.h index 97c9577141db..6f354c8b00ac 100644 --- a/include/litmus/nvidia_info.h +++ b/include/litmus/nvidia_info.h | |||
@@ -6,10 +6,9 @@ | |||
6 | 6 | ||
7 | #include <litmus/litmus_softirq.h> | 7 | #include <litmus/litmus_softirq.h> |
8 | 8 | ||
9 | |||
10 | //#define NV_DEVICE_NUM NR_LITMUS_SOFTIRQD | ||
11 | #define NV_DEVICE_NUM CONFIG_NV_DEVICE_NUM | 9 | #define NV_DEVICE_NUM CONFIG_NV_DEVICE_NUM |
12 | #define NV_MAX_SIMULT_USERS CONFIG_NV_MAX_SIMULT_USERS | 10 | |
11 | /* Functions used for decoding NVIDIA blobs. */ | ||
13 | 12 | ||
14 | int init_nvidia_info(void); | 13 | int init_nvidia_info(void); |
15 | void shutdown_nvidia_info(void); | 14 | void shutdown_nvidia_info(void); |
@@ -18,29 +17,33 @@ int is_nvidia_func(void* func_addr); | |||
18 | 17 | ||
19 | void dump_nvidia_info(const struct tasklet_struct *t); | 18 | void dump_nvidia_info(const struct tasklet_struct *t); |
20 | 19 | ||
21 | |||
22 | // Returns the Nvidia device # associated with provided tasklet and work_struct. | 20 | // Returns the Nvidia device # associated with provided tasklet and work_struct. |
23 | u32 get_tasklet_nv_device_num(const struct tasklet_struct *t); | 21 | u32 get_tasklet_nv_device_num(const struct tasklet_struct *t); |
24 | u32 get_work_nv_device_num(const struct work_struct *t); | 22 | u32 get_work_nv_device_num(const struct work_struct *t); |
25 | 23 | ||
26 | 24 | ||
27 | int init_nv_device_reg(void); | ||
28 | //int get_nv_device_id(struct task_struct* owner); | ||
29 | 25 | ||
30 | 26 | /* Functions for figuring out the priority of GPU-using tasks */ | |
31 | int reg_nv_device(int reg_device_id, int register_device, struct task_struct *t); | ||
32 | 27 | ||
33 | struct task_struct* get_nv_max_device_owner(u32 target_device_id); | 28 | struct task_struct* get_nv_max_device_owner(u32 target_device_id); |
34 | //int is_nv_device_owner(u32 target_device_id); | ||
35 | |||
36 | void lock_nv_registry(u32 reg_device_id, unsigned long* flags); | ||
37 | void unlock_nv_registry(u32 reg_device_id, unsigned long* flags); | ||
38 | 29 | ||
39 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD | 30 | #ifdef CONFIG_LITMUS_SOFTIRQD |
40 | void pai_check_priority_increase(struct task_struct *t, int reg_device_id); | 31 | struct task_struct* get_nv_klmirqd_thread(u32 target_device_id); |
41 | void pai_check_priority_decrease(struct task_struct *t, int reg_device_id); | ||
42 | #endif | 32 | #endif |
43 | 33 | ||
44 | //void increment_nv_int_count(u32 device); | 34 | /* call when the GPU-holding task, t, blocks */ |
35 | long enable_gpu_owner(struct task_struct *t); | ||
36 | |||
37 | /* call when the GPU-holding task, t, resumes */ | ||
38 | long disable_gpu_owner(struct task_struct *t); | ||
39 | |||
40 | /* call when the GPU-holding task, t, increases its priority */ | ||
41 | int gpu_owner_increase_priority(struct task_struct *t); | ||
42 | |||
43 | /* call when the GPU-holding task, t, decreases its priority */ | ||
44 | int gpu_owner_decrease_priority(struct task_struct *t); | ||
45 | |||
46 | |||
47 | int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t); | ||
45 | 48 | ||
46 | #endif | 49 | #endif |
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 47301c04d862..c8ee64569dbb 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -128,6 +128,10 @@ struct control_page { | |||
128 | #include <litmus/binheap.h> | 128 | #include <litmus/binheap.h> |
129 | #include <linux/semaphore.h> | 129 | #include <linux/semaphore.h> |
130 | 130 | ||
131 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
132 | #include <linux/interrupt.h> | ||
133 | #endif | ||
134 | |||
131 | struct _rt_domain; | 135 | struct _rt_domain; |
132 | struct bheap_node; | 136 | struct bheap_node; |
133 | struct release_heap; | 137 | struct release_heap; |
@@ -205,6 +209,38 @@ typedef struct avg_est{ | |||
205 | lt_t avg; | 209 | lt_t avg; |
206 | } avg_est_t; | 210 | } avg_est_t; |
207 | 211 | ||
212 | |||
213 | |||
214 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
215 | //struct tasklet_head | ||
216 | //{ | ||
217 | // struct tasklet_struct *head; | ||
218 | // struct tasklet_struct **tail; | ||
219 | //}; | ||
220 | |||
221 | struct klmirqd_info | ||
222 | { | ||
223 | struct task_struct* klmirqd; | ||
224 | struct task_struct* current_owner; | ||
225 | unsigned int terminating:1; | ||
226 | |||
227 | raw_spinlock_t lock; | ||
228 | |||
229 | u32 pending; | ||
230 | atomic_t num_hi_pending; | ||
231 | atomic_t num_low_pending; | ||
232 | atomic_t num_work_pending; | ||
233 | |||
234 | /* in order of priority */ | ||
235 | struct tasklet_head pending_tasklets_hi; | ||
236 | struct tasklet_head pending_tasklets; | ||
237 | struct list_head worklist; | ||
238 | |||
239 | struct list_head klmirqd_reg; | ||
240 | }; | ||
241 | #endif | ||
242 | |||
243 | |||
208 | /* RT task parameters for scheduling extensions | 244 | /* RT task parameters for scheduling extensions |
209 | * These parameters are inherited during clone and therefore must | 245 | * These parameters are inherited during clone and therefore must |
210 | * be explicitly set up before the task set is launched. | 246 | * be explicitly set up before the task set is launched. |
@@ -221,34 +257,21 @@ struct rt_param { | |||
221 | 257 | ||
222 | #ifdef CONFIG_LITMUS_SOFTIRQD | 258 | #ifdef CONFIG_LITMUS_SOFTIRQD |
223 | /* proxy threads have minimum priority by default */ | 259 | /* proxy threads have minimum priority by default */ |
224 | unsigned int is_proxy_thread:1; | 260 | unsigned int is_interrupt_thread:1; |
225 | |||
226 | /* pointer to klmirqd currently working on this | ||
227 | task_struct's behalf. only set by the task pointed | ||
228 | to by klmirqd. | ||
229 | 261 | ||
230 | ptr only valid if is_proxy_thread == 0 | 262 | /* pointer to data used by klmirqd thread. |
231 | */ | 263 | * |
232 | struct task_struct* cur_klmirqd; | 264 | * ptr only valid if is_interrupt_thread == 1 |
233 | |||
234 | /* Used to implement mutual execution exclusion between | ||
235 | * job and klmirqd execution. Job must always hold | ||
236 | * it's klmirqd_sem to execute. klmirqd instance | ||
237 | * must hold the semaphore before executing on behalf | ||
238 | * of a job. | ||
239 | */ | ||
240 | struct mutex klmirqd_sem; | ||
241 | |||
242 | /* status of held klmirqd_sem, even if the held klmirqd_sem is from | ||
243 | another task (only proxy threads do this though). | ||
244 | */ | 265 | */ |
245 | atomic_t klmirqd_sem_stat; | 266 | struct klmirqd_info* klmirqd_info; |
246 | #endif | 267 | #endif |
247 | 268 | ||
248 | #ifdef CONFIG_LITMUS_NVIDIA | 269 | #ifdef CONFIG_LITMUS_NVIDIA |
249 | /* number of top-half interrupts handled on behalf of current job */ | 270 | /* number of top-half interrupts handled on behalf of current job */ |
250 | atomic_t nv_int_count; | 271 | atomic_t nv_int_count; |
251 | long unsigned int held_gpus; // bitmap of held GPUs. | 272 | long unsigned int held_gpus; // bitmap of held GPUs. |
273 | struct binheap_node gpu_owner_node; // just one GPU for now... | ||
274 | unsigned int hide_from_gpu:1; | ||
252 | 275 | ||
253 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING | 276 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING |
254 | avg_est_t gpu_migration_est[MIG_LAST+1]; | 277 | avg_est_t gpu_migration_est[MIG_LAST+1]; |
@@ -370,6 +393,13 @@ struct rt_param { | |||
370 | struct control_page * ctrl_page; | 393 | struct control_page * ctrl_page; |
371 | }; | 394 | }; |
372 | 395 | ||
396 | //#ifdef CONFIG_LITMUS_SOFTIRQD | ||
397 | //struct klmirqd_data | ||
398 | //{ | ||
399 | // struct binheap klmirqd_users; | ||
400 | //}; | ||
401 | //#endif | ||
402 | |||
373 | #ifdef CONFIG_REALTIME_AUX_TASKS | 403 | #ifdef CONFIG_REALTIME_AUX_TASKS |
374 | struct aux_data | 404 | struct aux_data |
375 | { | 405 | { |
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index e8127f427d56..a13d1a2992fe 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h | |||
@@ -79,12 +79,6 @@ typedef void (*nested_increase_prio_t)(struct task_struct* t, struct task_struct | |||
79 | typedef void (*nested_decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh, | 79 | typedef void (*nested_decrease_prio_t)(struct task_struct* t, struct task_struct* prio_inh, |
80 | raw_spinlock_t *to_unlock, unsigned long irqflags); | 80 | raw_spinlock_t *to_unlock, unsigned long irqflags); |
81 | 81 | ||
82 | typedef void (*increase_prio_klitirq_t)(struct task_struct* klmirqd, | ||
83 | struct task_struct* old_owner, | ||
84 | struct task_struct* new_owner); | ||
85 | typedef void (*decrease_prio_klmirqd_t)(struct task_struct* klmirqd, | ||
86 | struct task_struct* old_owner); | ||
87 | |||
88 | 82 | ||
89 | typedef int (*enqueue_pai_tasklet_t)(struct tasklet_struct* tasklet); | 83 | typedef int (*enqueue_pai_tasklet_t)(struct tasklet_struct* tasklet); |
90 | typedef void (*change_prio_pai_tasklet_t)(struct task_struct *old_prio, | 84 | typedef void (*change_prio_pai_tasklet_t)(struct task_struct *old_prio, |
@@ -166,11 +160,6 @@ struct sched_plugin { | |||
166 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING | 160 | #ifdef CONFIG_LITMUS_AFFINITY_LOCKING |
167 | allocate_affinity_observer_t allocate_aff_obs; | 161 | allocate_affinity_observer_t allocate_aff_obs; |
168 | #endif | 162 | #endif |
169 | |||
170 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
171 | increase_prio_klitirq_t increase_prio_klmirqd; | ||
172 | decrease_prio_klmirqd_t decrease_prio_klmirqd; | ||
173 | #endif | ||
174 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD | 163 | #ifdef CONFIG_LITMUS_PAI_SOFTIRQD |
175 | enqueue_pai_tasklet_t enqueue_pai_tasklet; | 164 | enqueue_pai_tasklet_t enqueue_pai_tasklet; |
176 | change_prio_pai_tasklet_t change_prio_pai_tasklet; | 165 | change_prio_pai_tasklet_t change_prio_pai_tasklet; |
diff --git a/include/litmus/signal.h b/include/litmus/signal.h index b3d82b294984..38c3207951e0 100644 --- a/include/litmus/signal.h +++ b/include/litmus/signal.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | /* Signals used by Litmus to asynchronously communicate events | 10 | /* Signals used by Litmus to asynchronously communicate events |
11 | * to real-time tasks. | 11 | * to real-time tasks. |
12 | * | 12 | * |
13 | * Signal values overlap with [SIGRTMIN, SIGRTMAX], so beware of | 13 | * Signal values overlap with [SIGRTMIN, SIGRTMAX], so beware of |
14 | * application-level conflicts when dealing with COTS user-level | 14 | * application-level conflicts when dealing with COTS user-level |
15 | * code. | 15 | * code. |
diff --git a/include/litmus/unistd_32.h b/include/litmus/unistd_32.h index c86b743408ed..7265ffadf555 100644 --- a/include/litmus/unistd_32.h +++ b/include/litmus/unistd_32.h | |||
@@ -19,8 +19,7 @@ | |||
19 | #define __NR_null_call __LSC(11) | 19 | #define __NR_null_call __LSC(11) |
20 | #define __NR_litmus_dgl_lock __LSC(12) | 20 | #define __NR_litmus_dgl_lock __LSC(12) |
21 | #define __NR_litmus_dgl_unlock __LSC(13) | 21 | #define __NR_litmus_dgl_unlock __LSC(13) |
22 | #define __NR_register_nv_device __LSC(14) | ||
23 | 22 | ||
24 | #define __NR_set_aux_tasks _LSC(15) | 23 | #define __NR_set_aux_tasks _LSC(14) |
25 | 24 | ||
26 | #define NR_litmus_syscalls 16 | 25 | #define NR_litmus_syscalls 15 |
diff --git a/include/litmus/unistd_64.h b/include/litmus/unistd_64.h index 3825bc129dbd..51e730124dde 100644 --- a/include/litmus/unistd_64.h +++ b/include/litmus/unistd_64.h | |||
@@ -33,10 +33,8 @@ __SYSCALL(__NR_null_call, sys_null_call) | |||
33 | __SYSCALL(__NR_litmus_dgl_lock, sys_litmus_dgl_lock) | 33 | __SYSCALL(__NR_litmus_dgl_lock, sys_litmus_dgl_lock) |
34 | #define __NR_litmus_dgl_unlock __LSC(13) | 34 | #define __NR_litmus_dgl_unlock __LSC(13) |
35 | __SYSCALL(__NR_litmus_dgl_unlock, sys_litmus_dgl_unlock) | 35 | __SYSCALL(__NR_litmus_dgl_unlock, sys_litmus_dgl_unlock) |
36 | #define __NR_register_nv_device __LSC(14) | ||
37 | __SYSCALL(__NR_register_nv_device, sys_register_nv_device) | ||
38 | 36 | ||
39 | #define __NR_set_aux_tasks __LSC(15) | 37 | #define __NR_set_aux_tasks __LSC(14) |
40 | __SYSCALL(__NR_set_aux_tasks, sys_set_aux_tasks) | 38 | __SYSCALL(__NR_set_aux_tasks, sys_set_aux_tasks) |
41 | 39 | ||
42 | #define NR_litmus_syscalls 16 | 40 | #define NR_litmus_syscalls 15 |