Messages in this thread Patch in this message | | | Date | Mon, 16 Mar 2009 20:29:04 +0100 (CET) | From | Stefan Richter <> | Subject | Re: [PATCH] async: remove the temporary (2.6.29) "async is off by default" code |
| |
On 15 Mar, Arjan van de Ven wrote: > --- a/kernel/async.c > +++ b/kernel/async.c > @@ -391,16 +391,8 @@ static int __init async_init(void) > if (IS_ERR(kthread_run(async_manager_thread, NULL, > "async/mgr"))) > async_enabled = 0; > - return 0; > -} > - > -static int __init setup_async(char *str) > -{ > async_enabled = 1; > - return 1; > + return 0; > } > > -__setup("fastboot", setup_async); > - > - > core_initcall(async_init);
From: Stefan Richter <stefanr@s5r6.in-berlin.de> Subject: async: enable it for real
Fix 'async: remove the temporary (2.6.29) "async is off by default" code'.
Also warn if the thread couldn't be started. A start failure may have serious side effects when more code starts to use <linux/async.h>.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> ---
Only compile-tested.
kernel/async.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux/kernel/async.c =================================================================== --- linux.orig/kernel/async.c +++ linux/kernel/async.c @@ -49,6 +49,7 @@ asynchronous and synchronous parts of th */ #include <linux/async.h> +#include <linux/bug.h> #include <linux/module.h> #include <linux/wait.h> #include <linux/sched.h> @@ -387,11 +388,10 @@ static int async_manager_thread(void *un static int __init async_init(void) { - if (async_enabled) - if (IS_ERR(kthread_run(async_manager_thread, NULL, - "async/mgr"))) - async_enabled = 0; - async_enabled = 1; + async_enabled = + !IS_ERR(kthread_run(async_manager_thread, NULL, "async/mgr")); + + WARN_ON(!async_enabled); return 0; }
-- Stefan Richter -=====-==--= --== =---- http://arcgraph.de/sr/
| |