Re: [PATCH 3/4] 2.6.2-rc2-mm2 CPU Hotplug: The Core

Rusty Russell
2004-02-02T11:12:14Z

In message <Pine.LNX.4.58.0402020353240.25194@devserv.devel.redhat.com> you write:
> the sched.c bits look good. A question: why is the migrate_all_tasks()
> code nonatomic? If you run this code in the context of the migration
> thread of the downed CPU then all of the migration can be done in one big
> atomic locked section which holds all runqueue locks and just moves all
> tasks off the current CPU. If it were done this way then eg. the
> __migrate_task() race-avoidance check (cpu_is_offline()) could go away and
> the whole thing would be more robust i believe.

Hmm...

I can code it up and we can see what it looks like.

Unfortunately the __migrate_task() check won't go away: someone may
have asked to move from CPU 0 to 1, and by the time migration thread
on 0 gets to the request, 1 has gone down. We don't want all the
callers to hold the cpucontrol lock, because now the NUMA scheduler
uses migration as a common case 8(

Thanks,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.