public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kthread: convert stop_machine into a kthread
@ 2006-06-15 14:43 Serge E. Hallyn
  2006-06-20  3:14 ` Andrew Morton
  0 siblings, 1 reply; 16+ messages in thread
From: Serge E. Hallyn @ 2006-06-15 14:43 UTC (permalink / raw)
  To: lkml

Update stop_machine.c to spawn stop_machine as kthreads rather
than the deprecated kernel_threads.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>

---

 kernel/stop_machine.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

ce04ccc88ac3e2e6c3942fe2c8c4b2d5492d8397
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index dcfb5d7..2dd5a48 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -4,6 +4,7 @@ #include <linux/sched.h>
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/syscalls.h>
+#include <linux/kthread.h>
 #include <asm/atomic.h>
 #include <asm/semaphore.h>
 #include <asm/uaccess.h>
@@ -96,11 +97,14 @@ static int stop_machine(void)
 	stopmachine_state = STOPMACHINE_WAIT;
 
 	for_each_online_cpu(i) {
+		struct task_struct *tsk;
 		if (i == raw_smp_processor_id())
 			continue;
-		ret = kernel_thread(stopmachine, (void *)(long)i,CLONE_KERNEL);
-		if (ret < 0)
+		tsk = kthread_run(stopmachine, (void *)(long)i, "stopmachine");
+		if (IS_ERR(tsk)) {
+			ret = PTR_ERR(tsk);
 			break;
+		}
 		stopmachine_num_threads++;
 	}
 
-- 
1.3.3


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-06-21  1:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <17553.56625.612931.136018@cargo.ozlabs.ibm.com>
2006-06-16  1:04 ` [PATCH] kthread: convert stop_machine into a kthread Rusty Russell
2006-06-16  3:04   ` Serge E. Hallyn
2006-06-16  3:54     ` Paul Mackerras
2006-06-16  4:00     ` Rusty Russell
2006-06-16 12:54       ` Serge E. Hallyn
2006-06-18 12:12         ` Eric W. Biederman
2006-06-15 14:43 Serge E. Hallyn
2006-06-20  3:14 ` Andrew Morton
2006-06-20  3:20   ` Erik Ohrnberger
2006-06-20  8:27   ` Serge E. Hallyn
2006-06-20  8:40     ` Andrew Morton
2006-06-20 16:27       ` Serge E. Hallyn
2006-06-20 22:42         ` Andrew Morton
2006-06-21  0:52           ` Serge E. Hallyn
2006-06-21  1:18             ` Andrew Morton
2006-06-21  1:44               ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox