From: Rusty Russell <rusty@rustcorp.com.au>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: jens.axboe@oracle.com, schwidefsky@de.ibm.com,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH/RFC 0/4] Add stop_machine_get/put_threads to stop_machine infrastructrue.
Date: Thu, 9 Oct 2008 11:18:27 +1100 [thread overview]
Message-ID: <200810091118.27464.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20081008101450.GA2954@osiris.boeblingen.de.ibm.com>
On Wednesday 08 October 2008 21:14:50 Heiko Carstens wrote:
> On Wed, Oct 08, 2008 at 10:27:04AM +1000, Rusty Russell wrote:
> > OK, idea #2. Let's just always have a kstopmachine thread running on
> > every online cpu. Is there a sane way to reuse the workqueue threads for
> > this?
>
> That's a very good idea and what the patch below does. It even simplifies
> the stop_machine code and it does work on an otherwise idle system.
> The only thing that needs to be addressed is that workqueue threads aka
> stop_machine threads are no real time threads now.
> We would need something like create_workqueue_prio() or
> create_workqueue_rt(). Would that be acceptable?
Hmm, I was hoping to reuse the kevent threads rather than create YA set
of threads. But hey, everyone else is doing it.
> +static struct workqueue_struct *stop_machine_wq;
> +static struct work_struct *stop_machine_work;
> +static struct stop_machine_data active, idle;
> +static cpumask_t active_cpus;
Hmm, please make active cpus a const cpumask_t pointer. I'm trying to
get rid of these kind of decls in another patch series :)
> /* This is the actual thread which stops the CPU. It exits by itself rather
> * than waiting for kthread_stop(), because it's easier for hotplug CPU. */
This comment is no longer valid...
> +static int __init stop_machine_init(void)
> +{
> + stop_machine_wq = create_workqueue("kstop");
> + stop_machine_work = kcalloc(NR_CPUS, sizeof(struct work_struct),
> + GFP_KERNEL);
Perhaps make stop_machine_work a per-cpu array of struct work_struct
instead of initializing it here. Or at least make it a percpu pointer and
only alloc possible cpus.
Does it break cpu hotplug BTW? That's usually the problem.
But it looks nice!
Rusty.
next prev parent reply other threads:[~2008-10-09 0:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 10:56 Heiko Carstens
2008-10-03 10:56 ` [PATCH/RFC 1/4] stop_machine: atomic update for combined return value Heiko Carstens
2008-10-03 10:56 ` [PATCH/RFC 2/4] stop_machine: add stop_machine_get/put_threads interface Heiko Carstens
2008-10-03 10:56 ` [PATCH/RFC 3/4] s390: convert etr/stp to stop_machine interface Heiko Carstens
2008-10-03 10:56 ` [PATCH/RFC 4/4] s390: convert to generic IPI infrstructure Heiko Carstens
2008-10-06 4:42 ` [PATCH/RFC 0/4] Add stop_machine_get/put_threads to stop_machine infrastructrue Rusty Russell
2008-10-06 20:16 ` Heiko Carstens
2008-10-07 1:39 ` Rusty Russell
2008-10-07 15:38 ` Heiko Carstens
2008-10-08 0:27 ` Rusty Russell
2008-10-08 10:14 ` Heiko Carstens
2008-10-09 0:18 ` Rusty Russell [this message]
2008-10-09 16:25 ` Heiko Carstens
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=200810091118.27464.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=schwidefsky@de.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
Powered by JetHome