diff options
| -rw-r--r-- | kernel/async.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/async.c b/kernel/async.c index 0c90d500ab68..078d5ed150d1 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
| @@ -54,6 +54,7 @@ asynchronous and synchronous parts of the kernel. | |||
| 54 | #include <linux/sched.h> | 54 | #include <linux/sched.h> |
| 55 | #include <linux/init.h> | 55 | #include <linux/init.h> |
| 56 | #include <linux/kthread.h> | 56 | #include <linux/kthread.h> |
| 57 | #include <linux/delay.h> | ||
| 57 | #include <asm/atomic.h> | 58 | #include <asm/atomic.h> |
| 58 | 59 | ||
| 59 | static async_cookie_t next_cookie = 1; | 60 | static async_cookie_t next_cookie = 1; |
| @@ -319,7 +320,11 @@ static int async_manager_thread(void *unused) | |||
| 319 | ec = atomic_read(&entry_count); | 320 | ec = atomic_read(&entry_count); |
| 320 | 321 | ||
| 321 | while (tc < ec && tc < MAX_THREADS) { | 322 | while (tc < ec && tc < MAX_THREADS) { |
| 322 | kthread_run(async_thread, NULL, "async/%i", tc); | 323 | if (IS_ERR(kthread_run(async_thread, NULL, "async/%i", |
| 324 | tc))) { | ||
| 325 | msleep(100); | ||
| 326 | continue; | ||
| 327 | } | ||
| 323 | atomic_inc(&thread_count); | 328 | atomic_inc(&thread_count); |
| 324 | tc++; | 329 | tc++; |
| 325 | } | 330 | } |
| @@ -334,7 +339,9 @@ static int async_manager_thread(void *unused) | |||
| 334 | static int __init async_init(void) | 339 | static int __init async_init(void) |
| 335 | { | 340 | { |
| 336 | if (async_enabled) | 341 | if (async_enabled) |
| 337 | kthread_run(async_manager_thread, NULL, "async/mgr"); | 342 | if (IS_ERR(kthread_run(async_manager_thread, NULL, |
| 343 | "async/mgr"))) | ||
| 344 | async_enabled = 0; | ||
| 338 | return 0; | 345 | return 0; |
| 339 | } | 346 | } |
| 340 | 347 | ||
