lkml.org 
[lkml]   [2011]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] CPU hotplug, freezer: Fix bugs in CPU hotplug call path
From
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/

\
 
 \ /
  Last update: 2011-10-08 14:55    [W:0.042 / U:2.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site