diff options
-rw-r--r-- | arch/arm/kernel/calls.S | 10 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_table_32.S | 6 | ||||
-rw-r--r-- | include/litmus/sched_plugin.h | 17 | ||||
-rw-r--r-- | include/litmus/unistd_32.h | 18 | ||||
-rw-r--r-- | include/litmus/unistd_64.h | 24 | ||||
-rw-r--r-- | kernel/sched.c | 3 | ||||
-rw-r--r-- | litmus/fmlp.c | 54 | ||||
-rw-r--r-- | litmus/locking.c | 4 | ||||
-rw-r--r-- | litmus/sched_gsn_edf.c | 8 | ||||
-rw-r--r-- | litmus/sched_psn_edf.c | 11 | ||||
-rw-r--r-- | litmus/srp.c | 59 |
11 files changed, 30 insertions, 184 deletions
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 584a68349a41..b99087ac85b9 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -384,14 +384,12 @@ | |||
384 | CALL(sys_complete_job) | 384 | CALL(sys_complete_job) |
385 | CALL(sys_od_open) | 385 | CALL(sys_od_open) |
386 | CALL(sys_od_close) | 386 | CALL(sys_od_close) |
387 | /* 375 */ CALL(sys_fmlp_down) | 387 | /* 375 */ CALL(sys_litmus_lock) |
388 | CALL(sys_fmlp_up) | 388 | CALL(sys_litmus_unlock) |
389 | CALL(sys_srp_down) | ||
390 | CALL(sys_srp_up) | ||
391 | CALL(sys_query_job_no) | 389 | CALL(sys_query_job_no) |
392 | /* 380 */ CALL(sys_wait_for_job_release) | 390 | CALL(sys_wait_for_job_release) |
393 | CALL(sys_wait_for_ts_release) | 391 | CALL(sys_wait_for_ts_release) |
394 | CALL(sys_release_ts) | 392 | /* 380 */ CALL(sys_release_ts) |
395 | CALL(sys_null_call) | 393 | CALL(sys_null_call) |
396 | #ifndef syscalls_counted | 394 | #ifndef syscalls_counted |
397 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls | 395 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index d78c5ed5aef5..37702905f658 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -345,10 +345,8 @@ ENTRY(sys_call_table) | |||
345 | .long sys_complete_job | 345 | .long sys_complete_job |
346 | .long sys_od_open | 346 | .long sys_od_open |
347 | .long sys_od_close | 347 | .long sys_od_close |
348 | .long sys_fmlp_down | 348 | .long sys_litmus_lock |
349 | .long sys_fmlp_up | 349 | .long sys_litmus_unlock |
350 | .long sys_srp_down | ||
351 | .long sys_srp_up | ||
352 | .long sys_query_job_no | 350 | .long sys_query_job_no |
353 | .long sys_wait_for_job_release | 351 | .long sys_wait_for_job_release |
354 | .long sys_wait_for_ts_release | 352 | .long sys_wait_for_ts_release |
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index 27b719aebed9..8a3ed6d19a3c 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h | |||
@@ -105,23 +105,6 @@ int register_sched_plugin(struct sched_plugin* plugin); | |||
105 | struct sched_plugin* find_sched_plugin(const char* name); | 105 | struct sched_plugin* find_sched_plugin(const char* name); |
106 | int print_sched_plugins(char* buf, int max); | 106 | int print_sched_plugins(char* buf, int max); |
107 | 107 | ||
108 | static inline int srp_active(void) | ||
109 | { | ||
110 | #ifdef CONFIG_SRP | ||
111 | return litmus->srp_active; | ||
112 | #else | ||
113 | return 0; | ||
114 | #endif | ||
115 | } | ||
116 | static inline int fmlp_active(void) | ||
117 | { | ||
118 | #ifdef CONFIG_FMLP | ||
119 | return litmus->fmlp_active; | ||
120 | #else | ||
121 | return 0; | ||
122 | #endif | ||
123 | } | ||
124 | |||
125 | extern struct sched_plugin linux_sched_plugin; | 108 | extern struct sched_plugin linux_sched_plugin; |
126 | 109 | ||
127 | #endif | 110 | #endif |
diff --git a/include/litmus/unistd_32.h b/include/litmus/unistd_32.h index dbddc6523f8e..94264c27d9ac 100644 --- a/include/litmus/unistd_32.h +++ b/include/litmus/unistd_32.h | |||
@@ -10,14 +10,12 @@ | |||
10 | #define __NR_complete_job __LSC(2) | 10 | #define __NR_complete_job __LSC(2) |
11 | #define __NR_od_open __LSC(3) | 11 | #define __NR_od_open __LSC(3) |
12 | #define __NR_od_close __LSC(4) | 12 | #define __NR_od_close __LSC(4) |
13 | #define __NR_fmlp_down __LSC(5) | 13 | #define __NR_litmus_lock __LSC(5) |
14 | #define __NR_fmlp_up __LSC(6) | 14 | #define __NR_litmus_unlock __LSC(6) |
15 | #define __NR_srp_down __LSC(7) | 15 | #define __NR_query_job_no __LSC(7) |
16 | #define __NR_srp_up __LSC(8) | 16 | #define __NR_wait_for_job_release __LSC(8) |
17 | #define __NR_query_job_no __LSC(9) | 17 | #define __NR_wait_for_ts_release __LSC(9) |
18 | #define __NR_wait_for_job_release __LSC(10) | 18 | #define __NR_release_ts __LSC(10) |
19 | #define __NR_wait_for_ts_release __LSC(11) | 19 | #define __NR_null_call __LSC(11) |
20 | #define __NR_release_ts __LSC(12) | ||
21 | #define __NR_null_call __LSC(13) | ||
22 | 20 | ||
23 | #define NR_litmus_syscalls 14 | 21 | #define NR_litmus_syscalls 12 |
diff --git a/include/litmus/unistd_64.h b/include/litmus/unistd_64.h index f0618e75348d..d5ced0d2642c 100644 --- a/include/litmus/unistd_64.h +++ b/include/litmus/unistd_64.h | |||
@@ -15,23 +15,19 @@ __SYSCALL(__NR_complete_job, sys_complete_job) | |||
15 | __SYSCALL(__NR_od_open, sys_od_open) | 15 | __SYSCALL(__NR_od_open, sys_od_open) |
16 | #define __NR_od_close __LSC(4) | 16 | #define __NR_od_close __LSC(4) |
17 | __SYSCALL(__NR_od_close, sys_od_close) | 17 | __SYSCALL(__NR_od_close, sys_od_close) |
18 | #define __NR_fmlp_down __LSC(5) | 18 | #define __NR_litmus_lock __LSC(5) |
19 | __SYSCALL(__NR_fmlp_down, sys_fmlp_down) | 19 | __SYSCALL(__NR_litmus_lock, sys_litmus_lock) |
20 | #define __NR_fmlp_up __LSC(6) | 20 | #define __NR_litmus_unlock __LSC(6) |
21 | __SYSCALL(__NR_fmlp_up, sys_fmlp_up) | 21 | __SYSCALL(__NR_litmus_unlock, sys_litmus_unlock) |
22 | #define __NR_srp_down __LSC(7) | 22 | #define __NR_query_job_no __LSC(7) |
23 | __SYSCALL(__NR_srp_down, sys_srp_down) | ||
24 | #define __NR_srp_up __LSC(8) | ||
25 | __SYSCALL(__NR_srp_up, sys_srp_up) | ||
26 | #define __NR_query_job_no __LSC(9) | ||
27 | __SYSCALL(__NR_query_job_no, sys_query_job_no) | 23 | __SYSCALL(__NR_query_job_no, sys_query_job_no) |
28 | #define __NR_wait_for_job_release __LSC(10) | 24 | #define __NR_wait_for_job_release __LSC(8) |
29 | __SYSCALL(__NR_wait_for_job_release, sys_wait_for_job_release) | 25 | __SYSCALL(__NR_wait_for_job_release, sys_wait_for_job_release) |
30 | #define __NR_wait_for_ts_release __LSC(11) | 26 | #define __NR_wait_for_ts_release __LSC(9) |
31 | __SYSCALL(__NR_wait_for_ts_release, sys_wait_for_ts_release) | 27 | __SYSCALL(__NR_wait_for_ts_release, sys_wait_for_ts_release) |
32 | #define __NR_release_ts __LSC(12) | 28 | #define __NR_release_ts __LSC(10) |
33 | __SYSCALL(__NR_release_ts, sys_release_ts) | 29 | __SYSCALL(__NR_release_ts, sys_release_ts) |
34 | #define __NR_null_call __LSC(13) | 30 | #define __NR_null_call __LSC(11) |
35 | __SYSCALL(__NR_null_call, sys_null_call) | 31 | __SYSCALL(__NR_null_call, sys_null_call) |
36 | 32 | ||
37 | #define NR_litmus_syscalls 14 | 33 | #define NR_litmus_syscalls 12 |
diff --git a/kernel/sched.c b/kernel/sched.c index 5beefb2e7970..c5d775079027 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3887,8 +3887,7 @@ need_resched_nonpreemptible: | |||
3887 | if (need_resched()) | 3887 | if (need_resched()) |
3888 | goto need_resched; | 3888 | goto need_resched; |
3889 | 3889 | ||
3890 | if (srp_active()) | 3890 | srp_ceiling_block(); |
3891 | srp_ceiling_block(); | ||
3892 | } | 3891 | } |
3893 | EXPORT_SYMBOL(schedule); | 3892 | EXPORT_SYMBOL(schedule); |
3894 | 3893 | ||
diff --git a/litmus/fmlp.c b/litmus/fmlp.c index 1e4d544a9230..6e3ddadbc429 100644 --- a/litmus/fmlp.c +++ b/litmus/fmlp.c | |||
@@ -207,62 +207,8 @@ static void do_fmlp_up(struct pi_semaphore* sem) | |||
207 | spin_unlock_irqrestore(&sem->wait.lock, flags); | 207 | spin_unlock_irqrestore(&sem->wait.lock, flags); |
208 | } | 208 | } |
209 | 209 | ||
210 | asmlinkage long sys_fmlp_down(int sem_od) | ||
211 | { | ||
212 | long ret = 0; | ||
213 | struct pi_semaphore * sem; | ||
214 | int suspended = 0; | ||
215 | |||
216 | preempt_disable(); | ||
217 | TS_PI_DOWN_START; | ||
218 | |||
219 | sem = lookup_fmlp_sem(sem_od); | ||
220 | if (sem) | ||
221 | suspended = do_fmlp_down(sem); | ||
222 | else | ||
223 | ret = -EINVAL; | ||
224 | |||
225 | if (!suspended) { | ||
226 | TS_PI_DOWN_END; | ||
227 | preempt_enable(); | ||
228 | } | ||
229 | |||
230 | return ret; | ||
231 | } | ||
232 | |||
233 | asmlinkage long sys_fmlp_up(int sem_od) | ||
234 | { | ||
235 | long ret = 0; | ||
236 | struct pi_semaphore * sem; | ||
237 | |||
238 | preempt_disable(); | ||
239 | TS_PI_UP_START; | ||
240 | |||
241 | sem = lookup_fmlp_sem(sem_od); | ||
242 | if (sem) | ||
243 | do_fmlp_up(sem); | ||
244 | else | ||
245 | ret = -EINVAL; | ||
246 | |||
247 | |||
248 | TS_PI_UP_END; | ||
249 | preempt_enable(); | ||
250 | |||
251 | return ret; | ||
252 | } | ||
253 | |||
254 | #else | 210 | #else |
255 | 211 | ||
256 | struct fdso_ops fmlp_sem_ops = {}; | 212 | struct fdso_ops fmlp_sem_ops = {}; |
257 | 213 | ||
258 | asmlinkage long sys_fmlp_down(int sem_od) | ||
259 | { | ||
260 | return -ENOSYS; | ||
261 | } | ||
262 | |||
263 | asmlinkage long sys_fmlp_up(int sem_od) | ||
264 | { | ||
265 | return -ENOSYS; | ||
266 | } | ||
267 | |||
268 | #endif | 214 | #endif |
diff --git a/litmus/locking.c b/litmus/locking.c index 848407b79b4f..ab643475093f 100644 --- a/litmus/locking.c +++ b/litmus/locking.c | |||
@@ -75,6 +75,7 @@ asmlinkage long sys_litmus_lock(int lock_od) | |||
75 | entry = get_entry_for_od(lock_od); | 75 | entry = get_entry_for_od(lock_od); |
76 | if (entry && is_lock(entry)) { | 76 | if (entry && is_lock(entry)) { |
77 | l = get_lock(entry); | 77 | l = get_lock(entry); |
78 | TRACE_CUR("attempts to lock 0x%p\n", l); | ||
78 | err = l->ops->lock(l); | 79 | err = l->ops->lock(l); |
79 | } | 80 | } |
80 | 81 | ||
@@ -96,7 +97,8 @@ asmlinkage long sys_litmus_unlock(int lock_od) | |||
96 | entry = get_entry_for_od(lock_od); | 97 | entry = get_entry_for_od(lock_od); |
97 | if (entry && is_lock(entry)) { | 98 | if (entry && is_lock(entry)) { |
98 | l = get_lock(entry); | 99 | l = get_lock(entry); |
99 | err = l->ops->lock(l); | 100 | TRACE_CUR("attempts to unlock 0x%p\n", l); |
101 | err = l->ops->unlock(l); | ||
100 | } | 102 | } |
101 | 103 | ||
102 | /* Note: task my have been preempted in between! Take this into | 104 | /* Note: task my have been preempted in between! Take this into |
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index e9c5e531b1ae..4ad95dba4a04 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -594,7 +594,7 @@ static void gsnedf_task_exit(struct task_struct * t) | |||
594 | TRACE_TASK(t, "RIP\n"); | 594 | TRACE_TASK(t, "RIP\n"); |
595 | } | 595 | } |
596 | 596 | ||
597 | #ifdef CONFIG_FMLP | 597 | #if 0 |
598 | 598 | ||
599 | /* Update the queue position of a task that got it's priority boosted via | 599 | /* Update the queue position of a task that got it's priority boosted via |
600 | * priority inheritance. */ | 600 | * priority inheritance. */ |
@@ -795,12 +795,6 @@ static struct sched_plugin gsn_edf_plugin __cacheline_aligned_in_smp = { | |||
795 | .schedule = gsnedf_schedule, | 795 | .schedule = gsnedf_schedule, |
796 | .task_wake_up = gsnedf_task_wake_up, | 796 | .task_wake_up = gsnedf_task_wake_up, |
797 | .task_block = gsnedf_task_block, | 797 | .task_block = gsnedf_task_block, |
798 | #ifdef CONFIG_FMLP | ||
799 | .fmlp_active = 1, | ||
800 | .pi_block = gsnedf_pi_block, | ||
801 | .inherit_priority = gsnedf_inherit_priority, | ||
802 | .return_priority = gsnedf_return_priority, | ||
803 | #endif | ||
804 | .admit_task = gsnedf_admit_task, | 798 | .admit_task = gsnedf_admit_task, |
805 | .activate_plugin = gsnedf_activate_plugin, | 799 | .activate_plugin = gsnedf_activate_plugin, |
806 | }; | 800 | }; |
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index b89823d5c026..01f31e407082 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -309,7 +309,7 @@ static void psnedf_task_exit(struct task_struct * t) | |||
309 | raw_spin_unlock_irqrestore(&pedf->slock, flags); | 309 | raw_spin_unlock_irqrestore(&pedf->slock, flags); |
310 | } | 310 | } |
311 | 311 | ||
312 | #ifdef CONFIG_FMLP | 312 | #if 0 |
313 | static long psnedf_pi_block(struct pi_semaphore *sem, | 313 | static long psnedf_pi_block(struct pi_semaphore *sem, |
314 | struct task_struct *new_waiter) | 314 | struct task_struct *new_waiter) |
315 | { | 315 | { |
@@ -443,9 +443,6 @@ static long psnedf_admit_task(struct task_struct* tsk) | |||
443 | /* Plugin object */ | 443 | /* Plugin object */ |
444 | static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { | 444 | static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { |
445 | .plugin_name = "PSN-EDF", | 445 | .plugin_name = "PSN-EDF", |
446 | #ifdef CONFIG_SRP | ||
447 | .srp_active = 1, | ||
448 | #endif | ||
449 | .tick = psnedf_tick, | 446 | .tick = psnedf_tick, |
450 | .task_new = psnedf_task_new, | 447 | .task_new = psnedf_task_new, |
451 | .complete_job = complete_job, | 448 | .complete_job = complete_job, |
@@ -453,12 +450,6 @@ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { | |||
453 | .schedule = psnedf_schedule, | 450 | .schedule = psnedf_schedule, |
454 | .task_wake_up = psnedf_task_wake_up, | 451 | .task_wake_up = psnedf_task_wake_up, |
455 | .task_block = psnedf_task_block, | 452 | .task_block = psnedf_task_block, |
456 | #ifdef CONFIG_FMLP | ||
457 | .fmlp_active = 1, | ||
458 | .pi_block = psnedf_pi_block, | ||
459 | .inherit_priority = psnedf_inherit_priority, | ||
460 | .return_priority = psnedf_return_priority, | ||
461 | #endif | ||
462 | .admit_task = psnedf_admit_task | 453 | .admit_task = psnedf_admit_task |
463 | }; | 454 | }; |
464 | 455 | ||
diff --git a/litmus/srp.c b/litmus/srp.c index 4601b7dba812..b4c171e79fd4 100644 --- a/litmus/srp.c +++ b/litmus/srp.c | |||
@@ -189,55 +189,6 @@ static void do_srp_up(struct srp_semaphore* sem) | |||
189 | wake_up_all(&__get_cpu_var(srp).ceiling_blocked); | 189 | wake_up_all(&__get_cpu_var(srp).ceiling_blocked); |
190 | } | 190 | } |
191 | 191 | ||
192 | /* Adjust the system-wide priority ceiling if resource is claimed. */ | ||
193 | asmlinkage long sys_srp_down(int sem_od) | ||
194 | { | ||
195 | int cpu; | ||
196 | int ret = -EINVAL; | ||
197 | struct srp_semaphore* sem; | ||
198 | |||
199 | /* disabling preemptions is sufficient protection since | ||
200 | * SRP is strictly per CPU and we don't interfere with any | ||
201 | * interrupt handlers | ||
202 | */ | ||
203 | preempt_disable(); | ||
204 | TS_SRP_DOWN_START; | ||
205 | |||
206 | cpu = smp_processor_id(); | ||
207 | sem = lookup_srp_sem(sem_od); | ||
208 | if (sem && sem->cpu == cpu) { | ||
209 | do_srp_down(sem); | ||
210 | ret = 0; | ||
211 | } | ||
212 | |||
213 | TS_SRP_DOWN_END; | ||
214 | preempt_enable(); | ||
215 | return ret; | ||
216 | } | ||
217 | |||
218 | /* Adjust the system-wide priority ceiling if resource is freed. */ | ||
219 | asmlinkage long sys_srp_up(int sem_od) | ||
220 | { | ||
221 | int cpu; | ||
222 | int ret = -EINVAL; | ||
223 | struct srp_semaphore* sem; | ||
224 | |||
225 | preempt_disable(); | ||
226 | TS_SRP_UP_START; | ||
227 | |||
228 | cpu = smp_processor_id(); | ||
229 | sem = lookup_srp_sem(sem_od); | ||
230 | |||
231 | if (sem && sem->cpu == cpu) { | ||
232 | do_srp_up(sem); | ||
233 | ret = 0; | ||
234 | } | ||
235 | |||
236 | TS_SRP_UP_END; | ||
237 | preempt_enable(); | ||
238 | return ret; | ||
239 | } | ||
240 | |||
241 | static int srp_wake_up(wait_queue_t *wait, unsigned mode, int sync, | 192 | static int srp_wake_up(wait_queue_t *wait, unsigned mode, int sync, |
242 | void *key) | 193 | void *key) |
243 | { | 194 | { |
@@ -303,16 +254,6 @@ void srp_ceiling_block(void) | |||
303 | 254 | ||
304 | #else | 255 | #else |
305 | 256 | ||
306 | asmlinkage long sys_srp_down(int sem_od) | ||
307 | { | ||
308 | return -ENOSYS; | ||
309 | } | ||
310 | |||
311 | asmlinkage long sys_srp_up(int sem_od) | ||
312 | { | ||
313 | return -ENOSYS; | ||
314 | } | ||
315 | |||
316 | struct fdso_ops srp_sem_ops = {}; | 257 | struct fdso_ops srp_sem_ops = {}; |
317 | 258 | ||
318 | #endif | 259 | #endif |