From cc602187d4466374bca031039e145aa1b89aca96 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Fri, 28 Jan 2011 16:41:16 -0500 Subject: Litmus core: replace FMLP & SRP system calls with generic syscalls This renders the FMLP and SRP unfunctional until they are ported to the new locking API. --- arch/arm/kernel/calls.S | 10 +++---- arch/x86/kernel/syscall_table_32.S | 6 ++-- include/litmus/sched_plugin.h | 17 ----------- include/litmus/unistd_32.h | 18 ++++++------ include/litmus/unistd_64.h | 24 +++++++--------- kernel/sched.c | 3 +- litmus/fmlp.c | 54 ---------------------------------- litmus/locking.c | 4 ++- litmus/sched_gsn_edf.c | 8 +----- litmus/sched_psn_edf.c | 11 +------ 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 @@ CALL(sys_complete_job) CALL(sys_od_open) CALL(sys_od_close) -/* 375 */ CALL(sys_fmlp_down) - CALL(sys_fmlp_up) - CALL(sys_srp_down) - CALL(sys_srp_up) +/* 375 */ CALL(sys_litmus_lock) + CALL(sys_litmus_unlock) CALL(sys_query_job_no) -/* 380 */ CALL(sys_wait_for_job_release) + CALL(sys_wait_for_job_release) CALL(sys_wait_for_ts_release) - CALL(sys_release_ts) +/* 380 */ CALL(sys_release_ts) CALL(sys_null_call) #ifndef syscalls_counted .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) .long sys_complete_job .long sys_od_open .long sys_od_close - .long sys_fmlp_down - .long sys_fmlp_up - .long sys_srp_down - .long sys_srp_up + .long sys_litmus_lock + .long sys_litmus_unlock .long sys_query_job_no .long sys_wait_for_job_release .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); struct sched_plugin* find_sched_plugin(const char* name); int print_sched_plugins(char* buf, int max); -static inline int srp_active(void) -{ -#ifdef CONFIG_SRP - return litmus->srp_active; -#else - return 0; -#endif -} -static inline int fmlp_active(void) -{ -#ifdef CONFIG_FMLP - return litmus->fmlp_active; -#else - return 0; -#endif -} - extern struct sched_plugin linux_sched_plugin; #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 @@ #define __NR_complete_job __LSC(2) #define __NR_od_open __LSC(3) #define __NR_od_close __LSC(4) -#define __NR_fmlp_down __LSC(5) -#define __NR_fmlp_up __LSC(6) -#define __NR_srp_down __LSC(7) -#define __NR_srp_up __LSC(8) -#define __NR_query_job_no __LSC(9) -#define __NR_wait_for_job_release __LSC(10) -#define __NR_wait_for_ts_release __LSC(11) -#define __NR_release_ts __LSC(12) -#define __NR_null_call __LSC(13) +#define __NR_litmus_lock __LSC(5) +#define __NR_litmus_unlock __LSC(6) +#define __NR_query_job_no __LSC(7) +#define __NR_wait_for_job_release __LSC(8) +#define __NR_wait_for_ts_release __LSC(9) +#define __NR_release_ts __LSC(10) +#define __NR_null_call __LSC(11) -#define NR_litmus_syscalls 14 +#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) __SYSCALL(__NR_od_open, sys_od_open) #define __NR_od_close __LSC(4) __SYSCALL(__NR_od_close, sys_od_close) -#define __NR_fmlp_down __LSC(5) -__SYSCALL(__NR_fmlp_down, sys_fmlp_down) -#define __NR_fmlp_up __LSC(6) -__SYSCALL(__NR_fmlp_up, sys_fmlp_up) -#define __NR_srp_down __LSC(7) -__SYSCALL(__NR_srp_down, sys_srp_down) -#define __NR_srp_up __LSC(8) -__SYSCALL(__NR_srp_up, sys_srp_up) -#define __NR_query_job_no __LSC(9) +#define __NR_litmus_lock __LSC(5) +__SYSCALL(__NR_litmus_lock, sys_litmus_lock) +#define __NR_litmus_unlock __LSC(6) +__SYSCALL(__NR_litmus_unlock, sys_litmus_unlock) +#define __NR_query_job_no __LSC(7) __SYSCALL(__NR_query_job_no, sys_query_job_no) -#define __NR_wait_for_job_release __LSC(10) +#define __NR_wait_for_job_release __LSC(8) __SYSCALL(__NR_wait_for_job_release, sys_wait_for_job_release) -#define __NR_wait_for_ts_release __LSC(11) +#define __NR_wait_for_ts_release __LSC(9) __SYSCALL(__NR_wait_for_ts_release, sys_wait_for_ts_release) -#define __NR_release_ts __LSC(12) +#define __NR_release_ts __LSC(10) __SYSCALL(__NR_release_ts, sys_release_ts) -#define __NR_null_call __LSC(13) +#define __NR_null_call __LSC(11) __SYSCALL(__NR_null_call, sys_null_call) -#define NR_litmus_syscalls 14 +#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: if (need_resched()) goto need_resched; - if (srp_active()) - srp_ceiling_block(); + srp_ceiling_block(); } EXPORT_SYMBOL(schedule); 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) spin_unlock_irqrestore(&sem->wait.lock, flags); } -asmlinkage long sys_fmlp_down(int sem_od) -{ - long ret = 0; - struct pi_semaphore * sem; - int suspended = 0; - - preempt_disable(); - TS_PI_DOWN_START; - - sem = lookup_fmlp_sem(sem_od); - if (sem) - suspended = do_fmlp_down(sem); - else - ret = -EINVAL; - - if (!suspended) { - TS_PI_DOWN_END; - preempt_enable(); - } - - return ret; -} - -asmlinkage long sys_fmlp_up(int sem_od) -{ - long ret = 0; - struct pi_semaphore * sem; - - preempt_disable(); - TS_PI_UP_START; - - sem = lookup_fmlp_sem(sem_od); - if (sem) - do_fmlp_up(sem); - else - ret = -EINVAL; - - - TS_PI_UP_END; - preempt_enable(); - - return ret; -} - #else struct fdso_ops fmlp_sem_ops = {}; -asmlinkage long sys_fmlp_down(int sem_od) -{ - return -ENOSYS; -} - -asmlinkage long sys_fmlp_up(int sem_od) -{ - return -ENOSYS; -} - #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) entry = get_entry_for_od(lock_od); if (entry && is_lock(entry)) { l = get_lock(entry); + TRACE_CUR("attempts to lock 0x%p\n", l); err = l->ops->lock(l); } @@ -96,7 +97,8 @@ asmlinkage long sys_litmus_unlock(int lock_od) entry = get_entry_for_od(lock_od); if (entry && is_lock(entry)) { l = get_lock(entry); - err = l->ops->lock(l); + TRACE_CUR("attempts to unlock 0x%p\n", l); + err = l->ops->unlock(l); } /* 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) TRACE_TASK(t, "RIP\n"); } -#ifdef CONFIG_FMLP +#if 0 /* Update the queue position of a task that got it's priority boosted via * priority inheritance. */ @@ -795,12 +795,6 @@ static struct sched_plugin gsn_edf_plugin __cacheline_aligned_in_smp = { .schedule = gsnedf_schedule, .task_wake_up = gsnedf_task_wake_up, .task_block = gsnedf_task_block, -#ifdef CONFIG_FMLP - .fmlp_active = 1, - .pi_block = gsnedf_pi_block, - .inherit_priority = gsnedf_inherit_priority, - .return_priority = gsnedf_return_priority, -#endif .admit_task = gsnedf_admit_task, .activate_plugin = gsnedf_activate_plugin, }; 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) raw_spin_unlock_irqrestore(&pedf->slock, flags); } -#ifdef CONFIG_FMLP +#if 0 static long psnedf_pi_block(struct pi_semaphore *sem, struct task_struct *new_waiter) { @@ -443,9 +443,6 @@ static long psnedf_admit_task(struct task_struct* tsk) /* Plugin object */ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { .plugin_name = "PSN-EDF", -#ifdef CONFIG_SRP - .srp_active = 1, -#endif .tick = psnedf_tick, .task_new = psnedf_task_new, .complete_job = complete_job, @@ -453,12 +450,6 @@ static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { .schedule = psnedf_schedule, .task_wake_up = psnedf_task_wake_up, .task_block = psnedf_task_block, -#ifdef CONFIG_FMLP - .fmlp_active = 1, - .pi_block = psnedf_pi_block, - .inherit_priority = psnedf_inherit_priority, - .return_priority = psnedf_return_priority, -#endif .admit_task = psnedf_admit_task }; 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) wake_up_all(&__get_cpu_var(srp).ceiling_blocked); } -/* Adjust the system-wide priority ceiling if resource is claimed. */ -asmlinkage long sys_srp_down(int sem_od) -{ - int cpu; - int ret = -EINVAL; - struct srp_semaphore* sem; - - /* disabling preemptions is sufficient protection since - * SRP is strictly per CPU and we don't interfere with any - * interrupt handlers - */ - preempt_disable(); - TS_SRP_DOWN_START; - - cpu = smp_processor_id(); - sem = lookup_srp_sem(sem_od); - if (sem && sem->cpu == cpu) { - do_srp_down(sem); - ret = 0; - } - - TS_SRP_DOWN_END; - preempt_enable(); - return ret; -} - -/* Adjust the system-wide priority ceiling if resource is freed. */ -asmlinkage long sys_srp_up(int sem_od) -{ - int cpu; - int ret = -EINVAL; - struct srp_semaphore* sem; - - preempt_disable(); - TS_SRP_UP_START; - - cpu = smp_processor_id(); - sem = lookup_srp_sem(sem_od); - - if (sem && sem->cpu == cpu) { - do_srp_up(sem); - ret = 0; - } - - TS_SRP_UP_END; - preempt_enable(); - return ret; -} - static int srp_wake_up(wait_queue_t *wait, unsigned mode, int sync, void *key) { @@ -303,16 +254,6 @@ void srp_ceiling_block(void) #else -asmlinkage long sys_srp_down(int sem_od) -{ - return -ENOSYS; -} - -asmlinkage long sys_srp_up(int sem_od) -{ - return -ENOSYS; -} - struct fdso_ops srp_sem_ops = {}; #endif -- cgit v1.2.2