aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-07-01 10:45:20 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-07-01 10:45:20 -0400
commit9b070bc6b676c62d4988da8699f0a731e733b318 (patch)
treea672d1b726cdce756f9a67786f0262cca776d3fe
parent0291b7547359c8e01ca1146ca8f2d5f321338ff8 (diff)
make inclusion of SRP support optional2008.1
we can disable it to improve performance when it is not needed
-rw-r--r--include/litmus/litmus.h4
-rw-r--r--include/litmus/sched_plugin.h6
-rw-r--r--litmus/Kconfig19
-rw-r--r--litmus/litmus.c3
-rw-r--r--litmus/sched_psn_edf.c2
-rw-r--r--litmus/srp.c22
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)
172#define make_np(t) do {t->rt_param.kernel_np++;} while(0); 172#define make_np(t) do {t->rt_param.kernel_np++;} while(0);
173#define take_np(t) do {t->rt_param.kernel_np--;} while(0); 173#define take_np(t) do {t->rt_param.kernel_np--;} while(0);
174 174
175#ifdef CONFIG_SRP
175void srp_ceiling_block(void); 176void srp_ceiling_block(void);
177#else
178#define srp_ceiling_block() /* nothing */
179#endif
176 180
177#define heap2task(hn) ((struct task_struct*) hn->value) 181#define heap2task(hn) ((struct task_struct*) hn->value)
178 182
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 {
87 struct list_head list; 87 struct list_head list;
88 /* basic info */ 88 /* basic info */
89 char *plugin_name; 89 char *plugin_name;
90#ifdef CONFIG_SRP
90 unsigned int srp_active; 91 unsigned int srp_active;
92#endif
91 93
92 /* scheduler invocation */ 94 /* scheduler invocation */
93 scheduler_tick_t tick; 95 scheduler_tick_t tick;
@@ -124,7 +126,11 @@ int print_sched_plugins(char* buf, int max);
124 126
125static inline int srp_active(void) 127static inline int srp_active(void)
126{ 128{
129#ifdef CONFIG_SRP
127 return litmus->srp_active; 130 return litmus->srp_active;
131#else
132 return 0;
133#endif
128} 134}
129static inline int fmlp_active(void) 135static inline int fmlp_active(void)
130{ 136{
diff --git a/litmus/Kconfig b/litmus/Kconfig
index 0b8e348554..9a2ab90dec 100644
--- a/litmus/Kconfig
+++ b/litmus/Kconfig
@@ -1,28 +1,39 @@
1menu "LITMUS^RT" 1menu "LITMUS^RT"
2 2
3menu "Real-Time Synchronization"
4
3config NP_SECTION 5config NP_SECTION
4 bool "Non-preemptive section support" 6 bool "Non-preemptive section support"
5 depends on !SPARC64 7 depends on !SPARC64
6 default y 8 default n
7 help 9 help
8 Include support for flag-based non-preemptive section signaling 10 Include support for flag-based non-preemptive section signaling
9 from userspace. 11 from userspace.
10 12
11 (currently broken on SPARC64) 13 (currently broken on SPARC64)
12 14
13 Say Yes if in doubt. 15 Say Yes if you want FMLP short critical section synchronization support.
14 16
15 17
18config SRP
19 bool "Stack Resource Policy (SRP)"
20 default n
21 help
22 Include support for Baker's Stack Resource Policy.
23
24 Say Yes if you want FMLP local long critical section synchronization support.
25
16config FMLP 26config FMLP
17 bool "FMLP support" 27 bool "FMLP support"
18 depends on NP_SECTION 28 depends on NP_SECTION
19 default y 29 default n
20 help 30 help
21 Include support for deterministic multiprocessor real-time 31 Include support for deterministic multiprocessor real-time
22 synchronization support. 32 synchronization support.
23 33
24 Say Yes if in doubt. 34 Say Yes if you want FMLP long critical section synchronization support.
25 35
36endmenu
26 37
27menu "Tracing" 38menu "Tracing"
28 39
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)
132 132
133} 133}
134 134
135/* implemented in kernel/litmus_sem.c */
136void srp_ceiling_block(void);
137
138/* 135/*
139 * This is the crucial function for periodic task implementation, 136 * This is the crucial function for periodic task implementation,
140 * It checks if a task is periodic, checks if such kind of sleep 137 * 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)
416/* Plugin object */ 416/* Plugin object */
417static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { 417static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = {
418 .plugin_name = "PSN-EDF", 418 .plugin_name = "PSN-EDF",
419#ifdef CONFIG_SRP
419 .srp_active = 1, 420 .srp_active = 1,
421#endif
420 .tick = psnedf_tick, 422 .tick = psnedf_tick,
421 .task_new = psnedf_task_new, 423 .task_new = psnedf_task_new,
422 .complete_job = complete_job, 424 .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 @@
12#include <litmus/trace.h> 12#include <litmus/trace.h>
13 13
14 14
15#ifdef CONFIG_SRP
16
15struct srp_priority { 17struct srp_priority {
16 struct list_head list; 18 struct list_head list;
17 unsigned int period; 19 unsigned int period;
@@ -164,7 +166,7 @@ struct fdso_ops srp_sem_ops = {
164}; 166};
165 167
166 168
167void do_srp_down(struct srp_semaphore* sem) 169static void do_srp_down(struct srp_semaphore* sem)
168{ 170{
169 /* Update ceiling. */ 171 /* Update ceiling. */
170 srp_add_prio(&__get_cpu_var(srp), &sem->ceiling); 172 srp_add_prio(&__get_cpu_var(srp), &sem->ceiling);
@@ -173,7 +175,7 @@ void do_srp_down(struct srp_semaphore* sem)
173 TRACE_CUR("acquired srp 0x%p\n", sem); 175 TRACE_CUR("acquired srp 0x%p\n", sem);
174} 176}
175 177
176void do_srp_up(struct srp_semaphore* sem) 178static void do_srp_up(struct srp_semaphore* sem)
177{ 179{
178 /* Determine new system priority ceiling for this CPU. */ 180 /* Determine new system priority ceiling for this CPU. */
179 WARN_ON(!in_list(&sem->ceiling.list)); 181 WARN_ON(!in_list(&sem->ceiling.list));
@@ -298,3 +300,19 @@ void srp_ceiling_block(void)
298 preempt_enable(); 300 preempt_enable();
299} 301}
300 302
303
304#else
305
306asmlinkage long sys_srp_down(int sem_od)
307{
308 return -ENOSYS;
309}
310
311asmlinkage long sys_srp_up(int sem_od)
312{
313 return -ENOSYS;
314}
315
316struct fdso_ops srp_sem_ops = {};
317
318#endif