public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kthread: convert stop_machine into a kthread
Date: Mon, 19 Jun 2006 20:14:50 -0700	[thread overview]
Message-ID: <20060619201450.3434f72f.akpm@osdl.org> (raw)
In-Reply-To: <20060615144331.GB16046@sergelap.austin.ibm.com>

On Thu, 15 Jun 2006 09:43:31 -0500
"Serge E. Hallyn" <serue@us.ibm.com> wrote:

> 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++;
>  	}
>  

OK.  But if we're going to convert to the kthread API then stopmachine()
really whould be switched to the more efficient kthread_bind().


  reply	other threads:[~2006-06-20  3:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-15 14:43 [PATCH] kthread: convert stop_machine into a kthread Serge E. Hallyn
2006-06-20  3:14 ` Andrew Morton [this message]
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
2006-06-21  3:15       ` [PATCH] kthread: move kernel-doc and put it into DocBook Randy.Dunlap
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060619201450.3434f72f.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serue@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox