diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 23:45:13 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 23:57:07 -0400 |
commit | a66246f9e973a68fb9955a2fa7663a2e02afbd30 (patch) | |
tree | ebdf77a3cf491c0d0b77af3d9622f33013af5856 /litmus/sched_plugin.c | |
parent | 6ffc1fee98c4b995eb3a0285f4f8fb467cb0306e (diff) |
Change most LitmusRT spinlock_t in raw_spinlock_t
Adapt to new schema for spinlock:
(tglx 20091217)
spinlock - the weakest one, which might sleep in RT
raw_spinlock - spinlock which always spins even on RT
arch_spinlock - the hardware level architecture dependent implementation
----
Most probably, all the spinlocks changed by this commit will be true
spinning lock (raw_spinlock) in PreemptRT (so hopefully we'll need few
changes when porting Litmmus to PreemptRT).
There are a couple of spinlock that the kernel still defines as
spinlock_t (therefore no changes reported in this commit) that might cause
us troubles:
- wait_queue_t lock is defined as spinlock_t; it is used in:
* fmlp.c -- sem->wait.lock
* sync.c -- ts_release.wait.lock
- rwlock_t used in fifo implementation in sched_trace.c
* this need probably to be changed to something always spinning in RT
at the expense of increased locking time.
----
This commit also fixes warnings and errors due to the need to include
slab.h when using kmalloc() and friends.
----
This commit does not compile.
Diffstat (limited to 'litmus/sched_plugin.c')
-rw-r--r-- | litmus/sched_plugin.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c index 3767b30e610a..3543b7baff53 100644 --- a/litmus/sched_plugin.c +++ b/litmus/sched_plugin.c | |||
@@ -187,7 +187,7 @@ struct sched_plugin *litmus = &linux_sched_plugin; | |||
187 | 187 | ||
188 | /* the list of registered scheduling plugins */ | 188 | /* the list of registered scheduling plugins */ |
189 | static LIST_HEAD(sched_plugins); | 189 | static LIST_HEAD(sched_plugins); |
190 | static DEFINE_SPINLOCK(sched_plugins_lock); | 190 | static DEFINE_RAW_SPINLOCK(sched_plugins_lock); |
191 | 191 | ||
192 | #define CHECK(func) {\ | 192 | #define CHECK(func) {\ |
193 | if (!plugin->func) \ | 193 | if (!plugin->func) \ |
@@ -220,9 +220,9 @@ int register_sched_plugin(struct sched_plugin* plugin) | |||
220 | if (!plugin->release_at) | 220 | if (!plugin->release_at) |
221 | plugin->release_at = release_at; | 221 | plugin->release_at = release_at; |
222 | 222 | ||
223 | spin_lock(&sched_plugins_lock); | 223 | raw_spin_lock(&sched_plugins_lock); |
224 | list_add(&plugin->list, &sched_plugins); | 224 | list_add(&plugin->list, &sched_plugins); |
225 | spin_unlock(&sched_plugins_lock); | 225 | raw_spin_unlock(&sched_plugins_lock); |
226 | 226 | ||
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
@@ -234,7 +234,7 @@ struct sched_plugin* find_sched_plugin(const char* name) | |||
234 | struct list_head *pos; | 234 | struct list_head *pos; |
235 | struct sched_plugin *plugin; | 235 | struct sched_plugin *plugin; |
236 | 236 | ||
237 | spin_lock(&sched_plugins_lock); | 237 | raw_spin_lock(&sched_plugins_lock); |
238 | list_for_each(pos, &sched_plugins) { | 238 | list_for_each(pos, &sched_plugins) { |
239 | plugin = list_entry(pos, struct sched_plugin, list); | 239 | plugin = list_entry(pos, struct sched_plugin, list); |
240 | if (!strcmp(plugin->plugin_name, name)) | 240 | if (!strcmp(plugin->plugin_name, name)) |
@@ -243,7 +243,7 @@ struct sched_plugin* find_sched_plugin(const char* name) | |||
243 | plugin = NULL; | 243 | plugin = NULL; |
244 | 244 | ||
245 | out_unlock: | 245 | out_unlock: |
246 | spin_unlock(&sched_plugins_lock); | 246 | raw_spin_unlock(&sched_plugins_lock); |
247 | return plugin; | 247 | return plugin; |
248 | } | 248 | } |
249 | 249 | ||
@@ -253,13 +253,13 @@ int print_sched_plugins(char* buf, int max) | |||
253 | struct list_head *pos; | 253 | struct list_head *pos; |
254 | struct sched_plugin *plugin; | 254 | struct sched_plugin *plugin; |
255 | 255 | ||
256 | spin_lock(&sched_plugins_lock); | 256 | raw_spin_lock(&sched_plugins_lock); |
257 | list_for_each(pos, &sched_plugins) { | 257 | list_for_each(pos, &sched_plugins) { |
258 | plugin = list_entry(pos, struct sched_plugin, list); | 258 | plugin = list_entry(pos, struct sched_plugin, list); |
259 | count += snprintf(buf + count, max - count, "%s\n", plugin->plugin_name); | 259 | count += snprintf(buf + count, max - count, "%s\n", plugin->plugin_name); |
260 | if (max - count <= 0) | 260 | if (max - count <= 0) |
261 | break; | 261 | break; |
262 | } | 262 | } |
263 | spin_unlock(&sched_plugins_lock); | 263 | raw_spin_unlock(&sched_plugins_lock); |
264 | return count; | 264 | return count; |
265 | } | 265 | } |