All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] Thermal: Fix lockup of cpu_down()
Date: Tue, 16 Jul 2013 11:34:06 -0700	[thread overview]
Message-ID: <51E5921E.6060702@linux.intel.com> (raw)
In-Reply-To: <1373997748.6458.26.camel@gandalf.local.home>

On 07/16/2013 11:02 AM, Steven Rostedt wrote:
> Commit f1a18a105 "Thermal: CPU Package temperature thermal" had code
> that did a get_online_cpus(), run a loop and then do a
> put_online_cpus(). The problem is that the loop had an error exit that
> would skip the put_online_cpus() part.
>
> In the error exit part of the function, it also did a get_online_cpus(),
> run a loop and then put_online_cpus(). The only way to get to the error
> exit part is with get_online_cpus() already performed. If this error
> condition is hit, the system will be prevented from taking CPUs offline.
> The process taking the CPU offline will lock up hard.
>
> Removing the get_online_cpus() removes the lockup as the hotplug CPU
> refcount is back to zero.
>
> This was bisected with ktest.
>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>
> diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c
> index 5de56f6..d47624c 100644
> --- a/drivers/thermal/x86_pkg_temp_thermal.c
> +++ b/drivers/thermal/x86_pkg_temp_thermal.c
> @@ -592,7 +592,6 @@ static int __init pkg_temp_thermal_init(void)
>   	return 0;
>   
>   err_ret:
> -	get_online_cpus();
>   	for_each_online_cpu(i)
>   		put_core_offline(i);
>   	put_online_cpus();
>
Agreed.
>


      parent reply	other threads:[~2013-07-16 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 18:02 [PATCH] Thermal: Fix lockup of cpu_down() Steven Rostedt
2013-07-16 18:19 ` Srinivas Pandruvada
2013-07-16 18:33   ` Steven Rostedt
2013-07-16 18:44     ` Srinivas Pandruvada
2013-07-16 18:34 ` Srinivas Pandruvada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E5921E.6060702@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rui.zhang@intel.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.