Re: [PATCH] cpusets: rework guarantee_online_cpus() to fix deadlock with cpu_down()

Lai Jiangshan
2009-08-04T07:35:32Z

Oleg Nesterov wrote:
> On 08/02, Lai Jiangshan wrote:
>> Oleg Nesterov wrote:
>>
>>> - do NOT scan cs->parent cpusets. If there are no online CPUs in
>>> cs->cpus_allowed, we use cpu_online_mask. This is only possible
>>> when we are called by cpu_down() hooks, in that case
>>> cpuset_track_online_cpus(CPU_DEAD) will fix things later.
>>>
>>
>> We must scan cs->parent cpusets.
>> A task is constrained by a cpuset,
>
> Yes, the task esacpes its cpuset. With or without this patch.
> Because cs->cpus_allowed has no online CPUs.
>
>> it must be constrained
>> this cpuset's parent too.
>
> It will be constained again, after scan_for_empty_cpusets(), no?

cpuset_cpus_allowed() is not only used for CPU offline.

sched_setaffinity() also uses it. The task will not be constained again.
Or I missed something.

Lai