Re: Regression in 2.6.27-rc1 for set_cpus_allowed_ptr

From: Ingo Molnar
Date: Mon Aug 11 2008 - 08:30:59 EST



* Dmitry Adamushko <dmitry.adamushko@xxxxxxxxx> wrote:

> 2008/8/8 Rafael J. Wysocki <rjw@xxxxxxx>:
> > [Adding CCs]
> >
> > On Friday, 8 of August 2008, Langsdorf, Mark wrote:
> >> One of my co-workers noticed that the powernow-k8
> >> driver no longer restarts when a CPU core is
> >> hot-disabled and then hot-enabled on AMD quad-core
> >> systems.
> >>
> >> The following comands work fine on 2.6.26 and fail
> >> on 2.6.27-rc1:
> >>
> >> echo 0 > /sys/devices/system/cpu/cpu3/online
> >> echo 1 > /sys/devices/system/cpu/cpu3/online
> >> find /sys -name cpufreq
> >>
> >> For 2.6.26, the find will return a cpufreq
> >> directory for each processor. In 2.6.27-rc1,
> >> the cpu3 directory is missing.
> >>
> >> After digging through the code, the following
> >> logic is failing when the core is hot-enabled
> >> at runtime. The code works during the boot
> >> sequence.
> >>
> >> cpumask_t = current->cpus_allowed;
> >> set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
> >> if (smp_processor_id() != cpu)
> >> return -ENODEV;
> >>
>
>
> 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).

i've queued up the fix below in tip/sched/urgent.

Ingo

------------------------>