Messages in this thread | ![/](/images/icornerl.gif) | | Date | Sat, 8 Oct 2011 20:52:37 +0800 | Subject | Re: [PATCH v2] CPU hotplug, freezer: Fix bugs in CPU hotplug call path | From | Américo Wang <> |
| |
On Sat, Oct 8, 2011 at 4:56 AM, Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> wrote: > diff --git a/include/linux/freezer.h b/include/linux/freezer.h > index 1effc8b..75c65d6 100644 > --- a/include/linux/freezer.h > +++ b/include/linux/freezer.h > @@ -7,6 +7,9 @@ > #include <linux/wait.h> > > #ifdef CONFIG_FREEZER > + > +extern struct mutex freezer_lock; > + [...] > static inline int try_to_freeze(void) > { > if (freezing(current)) { > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 12b7458..b94c8f6 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -15,6 +15,7 @@ > #include <linux/stop_machine.h> > #include <linux/mutex.h> > #include <linux/gfp.h> > +#include <linux/freezer.h> > > #ifdef CONFIG_SMP > /* Serializes the updates to cpu_online_mask, cpu_present_mask */ > @@ -280,7 +281,9 @@ int __ref cpu_down(unsigned int cpu) > goto out; > } > > - err = _cpu_down(cpu, 0); > + mutex_lock(&freezer_lock); > + err = _cpu_down(cpu, tasks_are_frozen()); > + mutex_unlock(&freezer_lock); >
Can this even be compiled when CONFIG_FREEZER=n? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |