Re: [Lse-tech] Re: [PATCH] cpusets+hotplug+preepmt broken

Nathan Lynch
2005-05-13T21:34:16Z

On Fri, May 13, 2005 at 06:02:17PM +0530, Dinakar Guniguntala wrote:
> On Wed, May 11, 2005 at 02:51:56PM -0500, Nathan Lynch wrote:
>
> > This trace is what should be fixed -- we're trying to schedule while
> > the machine is "stopped" (all cpus except for one spinning with
> > interrupts off). I'm not too familiar with the cpusets code but I
> > would like to stay away from nesting these semaphores if at all
> > possible.
>
> Vatsa pointed out another scenario where cpusets+hotplug is currently
> broken. attach_task in cpuset.c is called without holding the hotplug
> lock and it is possible to call set_cpus_allowed for a task with no
> online cpus.
> Given this I think the patch I sent first is the most appropriate
> patch.

Your original patch is deadlocky since cpuset_cpus_allowed() does
task_lock() while write_lock_irq(&tasklist_lock) is already held by
migrate_live_tasks().

Nathan