diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2009-01-09 16:23:45 -0500 |
---|---|---|
committer | Arjan van de Ven <arjan@linux.intel.com> | 2009-01-09 16:23:45 -0500 |
commit | cdb80f630be5cbc23d82331f24dc4704f75b64f4 (patch) | |
tree | 537545e474b5906e4887aaa28e4e832134a97fa3 /kernel/async.c | |
parent | b32714ba29358a688ef337d5297bf4bdc9f596dc (diff) |
async: make async a command line option for now
... and have it default off.
This does allow people to work with it for testing.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Diffstat (limited to 'kernel/async.c')
-rw-r--r-- | kernel/async.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/async.c b/kernel/async.c index 64cc916299a5..f286e9f2b736 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
@@ -65,6 +65,8 @@ static LIST_HEAD(async_pending); | |||
65 | static LIST_HEAD(async_running); | 65 | static LIST_HEAD(async_running); |
66 | static DEFINE_SPINLOCK(async_lock); | 66 | static DEFINE_SPINLOCK(async_lock); |
67 | 67 | ||
68 | static int async_enabled = 0; | ||
69 | |||
68 | struct async_entry { | 70 | struct async_entry { |
69 | struct list_head list; | 71 | struct list_head list; |
70 | async_cookie_t cookie; | 72 | async_cookie_t cookie; |
@@ -169,7 +171,7 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct l | |||
169 | * If we're out of memory or if there's too much work | 171 | * If we're out of memory or if there's too much work |
170 | * pending already, we execute synchronously. | 172 | * pending already, we execute synchronously. |
171 | */ | 173 | */ |
172 | if (!entry || atomic_read(&entry_count) > MAX_WORK) { | 174 | if (!async_enabled || !entry || atomic_read(&entry_count) > MAX_WORK) { |
173 | kfree(entry); | 175 | kfree(entry); |
174 | spin_lock_irqsave(&async_lock, flags); | 176 | spin_lock_irqsave(&async_lock, flags); |
175 | newcookie = next_cookie++; | 177 | newcookie = next_cookie++; |
@@ -316,8 +318,18 @@ static int async_manager_thread(void *unused) | |||
316 | 318 | ||
317 | static int __init async_init(void) | 319 | static int __init async_init(void) |
318 | { | 320 | { |
319 | kthread_run(async_manager_thread, NULL, "async/mgr"); | 321 | if (async_enabled) |
322 | kthread_run(async_manager_thread, NULL, "async/mgr"); | ||
320 | return 0; | 323 | return 0; |
321 | } | 324 | } |
322 | 325 | ||
326 | static int __init setup_async(char *str) | ||
327 | { | ||
328 | async_enabled = 1; | ||
329 | return 1; | ||
330 | } | ||
331 | |||
332 | __setup("fastboot", setup_async); | ||
333 | |||
334 | |||
323 | core_initcall(async_init); | 335 | core_initcall(async_init); |