diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-07-01 10:45:20 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-07-01 10:45:20 -0400 |
commit | 9b070bc6b676c62d4988da8699f0a731e733b318 (patch) | |
tree | a672d1b726cdce756f9a67786f0262cca776d3fe | |
parent | 0291b7547359c8e01ca1146ca8f2d5f321338ff8 (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.h | 4 | ||||
-rw-r--r-- | include/litmus/sched_plugin.h | 6 | ||||
-rw-r--r-- | litmus/Kconfig | 19 | ||||
-rw-r--r-- | litmus/litmus.c | 3 | ||||
-rw-r--r-- | litmus/sched_psn_edf.c | 2 | ||||
-rw-r--r-- | 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) | |||
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 | ||
175 | void srp_ceiling_block(void); | 176 | void 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 | ||
125 | static inline int srp_active(void) | 127 | static 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 | } |
129 | static inline int fmlp_active(void) | 135 | static 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 @@ | |||
1 | menu "LITMUS^RT" | 1 | menu "LITMUS^RT" |
2 | 2 | ||
3 | menu "Real-Time Synchronization" | ||
4 | |||
3 | config NP_SECTION | 5 | config 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 | ||
18 | config 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 | |||
16 | config FMLP | 26 | config 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 | ||
36 | endmenu | ||
26 | 37 | ||
27 | menu "Tracing" | 38 | menu "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 */ | ||
136 | void 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 */ |
417 | static struct sched_plugin psn_edf_plugin __cacheline_aligned_in_smp = { | 417 | static 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 | |||
15 | struct srp_priority { | 17 | struct 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 | ||
167 | void do_srp_down(struct srp_semaphore* sem) | 169 | static 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 | ||
176 | void do_srp_up(struct srp_semaphore* sem) | 178 | static 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 | |||
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 = {}; | ||
317 | |||
318 | #endif | ||