Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Adamushko
Date: Friday, August 8, 2008 - 2:31 pm

2008/8/8 Rafael J. Wysocki <rjw@sisk.pl>:


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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Langsdorf, Mark, (Fri Aug 8, 12:44 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Rafael J. Wysocki, (Fri Aug 8, 2:03 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Dmitry Adamushko, (Fri Aug 8, 2:31 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Ingo Molnar, (Mon Aug 11, 5:30 am)
RE: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Langsdorf, Mark, (Mon Aug 11, 7:01 am)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Ingo Molnar, (Mon Aug 11, 7:20 am)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Dmitry Adamushko, (Mon Aug 11, 7:28 am)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Linus Torvalds, (Mon Aug 11, 3:03 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Ingo Molnar, (Mon Aug 11, 3:10 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Max Krasnyansky, (Mon Aug 11, 3:14 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Ingo Molnar, (Mon Aug 11, 3:46 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Max Krasnyansky, (Mon Aug 11, 3:49 pm)
Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr, Ingo Molnar, (Mon Aug 11, 3:55 pm)