Re: [PATCH] async: remove the temporary (2.6.29) "async is off bydefault" code

From: Stefan Richter
Date: Mon Mar 16 2009 - 15:29:21 EST


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@xxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxx>
---

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/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/