From 9b070bc6b676c62d4988da8699f0a731e733b318 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Tue, 1 Jul 2008 10:45:20 -0400 Subject: make inclusion of SRP support optional we can disable it to improve performance when it is not needed --- include/litmus/litmus.h | 4 ++++ include/litmus/sched_plugin.h | 6 ++++++ litmus/Kconfig | 19 +++++++++++++++---- litmus/litmus.c | 3 --- litmus/sched_psn_edf.c | 2 ++ litmus/srp.c | 22 ++++++++++++++++++++-- 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 8a4c44999f..de2a3c2547 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h @@ -172,7 +172,11 @@ static inline lt_t litmus_clock(void) #define make_np(t) do {t->rt_param.kernel_np++;} while(0); #define take_np(t) do {t->rt_param.kernel_np--;} while(0); +#ifdef CONFIG_SRP void srp_ceiling_block(void); +#else +#define srp_ceiling_block() /* nothing */ +#endif #define heap2task(hn) ((struct task_struct*) hn->value) diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index c26af80da8..aba75222fc 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h @@ -87,7 +87,9 @@ struct sched_plugin { struct list_head list; /* basic info */ char *plugin_name; +#ifdef CONFIG_SRP unsigned int srp_active; +#endif /* scheduler invocation */ scheduler_tick_t tick; @@ -124,7 +126,11 @@ 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) { diff --git a/litmus/Kconfig b/litmus/Kconfig index 0b8e348554..9a2ab90dec 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig @@ -1,28 +1,39 @@ menu "LITMUS^RT" +menu "Real-Time Synchronization" + config NP_SECTION bool "Non-preemptive section support" depends on !SPARC64 - default y + default n help Include support for flag-based non-preemptive section signaling from userspace. (currently broken on SPARC64) - Say Yes if in doubt. + Say Yes if you want FMLP short critical section synchronization support. +config SRP + bool "Stack Resource Policy (SRP)" + default n + help + Include support for Baker's Stack Resource Policy. + + Say Yes if you want FMLP local long critical section synchronization support. + config FMLP bool "FMLP support" depends on NP_SECTION - default y + default n help Include support for deterministic multiprocessor real-time synchronization support. - Say Yes if in doubt. + Say Yes if you want FMLP long critical section synchronization support. +endmenu menu "Tracing" diff --git a/litmus/litmus.c b/litmus/litmus.c index 852559468d..979985e4a3 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c @@ -132,9 +132,6 @@ asmlinkage long sys_get_rt_task_param(pid_t pid, struct rt_task __user * param) } -/* implemented in kernel/litmus_sem.c */ -void srp_ceiling_block(void); - /* * This is the crucial function for periodic task implementation, * It checks if a task is periodic, checks if such kind of sleep diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index 50fc95d749..0e9c9dd80a 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c @@ -416,7 +416,9 @@ 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, diff --git a/litmus/srp.c b/litmus/srp.c index cbad091d48..6e670f9138 100644 --- a/litmus/srp.c +++ b/litmus/srp.c @@ -12,6 +12,8 @@ #include +#ifdef CONFIG_SRP + struct srp_priority { struct list_head list; unsigned int period; @@ -164,7 +166,7 @@ struct fdso_ops srp_sem_ops = { }; -void do_srp_down(struct srp_semaphore* sem) +static void do_srp_down(struct srp_semaphore* sem) { /* Update ceiling. */ srp_add_prio(&__get_cpu_var(srp), &sem->ceiling); @@ -173,7 +175,7 @@ void do_srp_down(struct srp_semaphore* sem) TRACE_CUR("acquired srp 0x%p\n", sem); } -void do_srp_up(struct srp_semaphore* sem) +static void do_srp_up(struct srp_semaphore* sem) { /* Determine new system priority ceiling for this CPU. */ WARN_ON(!in_list(&sem->ceiling.list)); @@ -298,3 +300,19 @@ void srp_ceiling_block(void) preempt_enable(); } + +#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