if it gets called from any of the cpu-hotplug handlers, it won't work
now (x86-microcode is another victim).
Please give a try to the following patch: http://lkml.org/lkml/2008/7/30/171
does it help?
(the explanation is also available in this thread).
well, provided we may guarantee that load-balancing has been
initialized (it's ok in our case) by the moment CPU_ONLINE gets
called, this approach is not that bad perhaps... (and it looks like
there is plenty of code that relies on set_cpus_allowed_ptr() being
workable in cpu-hotplug-handlers).
Although, I personally don't like that much this particular use-case
of set_cpus_allowed_ptr() (I posted patches for x86-microcode). btw.,
last time I briefly looked at various places, there seemed to be a few
where
old_mask = p->cpus_allowed;
set_cpus_allowed_ptr(p, target_cpu);
// do something
set_cpus_allowed_ptr(p, old_mask);
is used just wrongly. e.g. it may race with sched_setaffinity() and
negate its effect.
--
Best regards,
Dmitry Adamushko
--