You said that you weren't aware of any problems that could arise that are
fixed with this added check in set_cpus_allowed(), so I asked that you
setup a cpuset that doesn't have access to cpu 0 and move the watchdog/0
thread to it.
The fix is more general than just the cpusets case, even though it is
probably the only user in the kernel of set_cpus_allowed() that allows
bound kthreads to be moved.
The idea is to expressly deny kthreads that have called kthread_bind()
from changing their cpus_allowed via set_cpus_allowed(). Cpusets should
handle that gracefully, but my fix is more general: it adds the check to
set_cpus_allowed() instead of in the cpusets code.
This is a little difficult with the current way that cpusets calls
set_cpus_allowed() since its attach function is void and does not return
error or success to the cgroup interface, yet my patch prevents the soft
lockups and kernel crashes that can occur when cpusets changes the
cpus_allowed of watchdog or migration threads that is obviously in error.
David
--