lkml.org 
[lkml]   [2009]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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/


\
 
 \ /
  Last update: 2009-03-16 20:31    [W:0.066 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site