we need cpuset_lock() to move T. please look at _cpu_down().
OK.
A task T holds callback_mutex, and it is bound to CPU 1.
_cpu_down(cpu => 1) is called by the task X.
_cpu_down()->stop_machine() spawns rt-threads for each cpu,
a thread running on CPU 1 preempts T and calls take_cpu_down()
which removes CPU 1 from online/active masks.
X continues, and does raw_notifier_call_chain(CPU_DEAD), this
calls migration_call(CPU_DEAD), and _this_ is what move the
tasks from the dead CPU.
migration_call(CPU_DEAD) calls cpuset_lock() and deadlocks.
See?
Oleg.
--