Re: [Experimental CPU Hotplug PATCH] - Move migrate_all_tasks to CPU_DEAD handling

From: Srivatsa Vaddagiri
Date: Wed Apr 07 2004 - 09:17:47 EST


On Wed, Apr 07, 2004 at 03:32:12PM +1000, Rusty Russell wrote:
> But other tasks can do a getaffinity() on it and see the wrong affinity.
> Probably not a big issue.

hmm .. the fact that getaffinity reads the cpus_allowed mask w/o doing
lock_cpu_hotplug makes it already racy wrt setaffinity?

Maybe it needs to take CPU hotplug sem before it reads the mask?

> I agree with Ingo: it's clever, well done. Minor nitpicks:
>
> +void migrate_all_tasks(int cpu)
> {
> struct task_struct *tsk, *t;
> int dest_cpu, src_cpu;
> unsigned int node;
>
> - /* We're nailed to this CPU. */
> - src_cpu = smp_processor_id();
> + src_cpu = cpu;
>
> Just make the parameter name "src_cpu"?

[snip]

> This comment's very big. They don't need to know all the things we
> don't do. I'd prefer:
>
> /* Force idle task to run as soon as we yield: it should
> immediately notice cpu is offline and die quickly. */

Sure, I will change as per your comments.

I would like to run my stress tests for longer time before I send it
for inclusion (i would be on vacation till next tuesday ..so maybe i will send
in the patch after that!)

--


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017
-
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/