Re: [PATCH/RFC 0/4] Add stop_machine_get/put_threads to stop_machine infrastructrue.

From: Rusty Russell
Date: Tue Oct 07 2008 - 20:27:21 EST


On Wednesday 08 October 2008 02:38:54 Heiko Carstens wrote:
> On Tue, Oct 07, 2008 at 11:39:58AM +1000, Rusty Russell wrote:
> > That's exactly my idea. We kmalloc already because NR_CPUS might be too
> > big for the stack. This version would just kmalloc a struct containing
> > everything we need.
>
> Ok, I did that but the resulting code is astonishingly ugly, so I thought I
> should share it :)

Yeah, the diffstat tells the story.

> Another thing that comes to mind is cpu hotplug: if somebody issued
> stop_machine_prepare() and then a cpu hotplug operation gets started we
> need to create or kill a kstop thread. For that we need the "sm" so we can
> save/find the task_struct pointer of the thread.

Erk, good point. Suckage.

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?

Thanks,
Rusty.

--
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/