public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: Maciej Rutecki <maciej.rutecki@gmail.com>,
	Dieter Ries <clip2@gmx.de>,
	travis@sgi.com, linux-kernel@vger.kernel.org
Subject: Re: 2.6.29-rc1 does not boot
Date: Wed, 14 Jan 2009 11:46:03 +1030	[thread overview]
Message-ID: <200901141146.04563.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090112112608.GB19388@elte.hu>

On Monday 12 January 2009 21:56:08 Ingo Molnar wrote:
> work_on_cpu() needs to be reworked to be more generally usable.

Yes, but how?  If we don't take the hotplug lock, we are relying on the
callers to "prove" the cpu can't go away.  But we've already shown that
we can't find this by inspection :(

> The commit introduces work_on_cpu() use into the cpufreq code,
> but that is subtly problematic from a lock hierarchy POV: the
> hotplug-cpu lock is an highlevel lock that is taken before
> lowlevel locks, and in this codepath we are called with the
> policy lock taken.

The easiest thing to do in this case is to use smp_call_function_single(),
since the thing we want to do is just rdmsr and wrmsr.

How about this instead of reverting?
Rusty.

fix: use smp_call_function_single() not work_on_cpu in acpi-cpufreq.c

get_measured_perf() gets called through twisty chains, and
work_on_cpu() has issues being called here as it takes the cpu hotplug
lock.

So we just use smp_call_function_single() which should work fine for
this case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -255,7 +255,7 @@ struct perf_cur {
 };
 
 
-static long read_measured_perf_ctrs(void *_cur)
+static void read_measured_perf_ctrs(void *_cur)
 {
 	struct perf_cur *cur = _cur;
 
@@ -264,8 +264,6 @@ static long read_measured_perf_ctrs(void
 
 	wrmsr(MSR_IA32_APERF, 0, 0);
 	wrmsr(MSR_IA32_MPERF, 0, 0);
-
-	return 0;
 }
 
 /*
@@ -288,7 +286,7 @@ static unsigned int get_measured_perf(st
 	unsigned int perf_percent;
 	unsigned int retval;
 
-	if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur))
+	if (smp_call_function_single(cpu, read_measured_perf_ctrs, &cur, 1))
 		return 0;
 
 #ifdef __i386__

  parent reply	other threads:[~2009-01-14  1:16 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 14:55 2.6.29-rc1 does not boot Dieter Ries
2009-01-11 15:19 ` Ingo Molnar
2009-01-11 15:30   ` Dieter Ries
2009-01-11 15:35     ` Ingo Molnar
2009-01-11 15:41       ` Dieter Ries
2009-01-11 18:50       ` Dieter Ries
2009-01-11 19:02         ` Mike Travis
2009-01-11 19:30           ` Dieter Ries
2009-01-12 10:00           ` Ingo Molnar
2009-01-12 17:53             ` Mike Travis
2009-01-12 18:55               ` Ingo Molnar
2009-01-15  0:54             ` Rusty Russell
2009-01-11 19:02         ` Ingo Molnar
2009-01-11 19:14           ` Mike Travis
2009-01-11 23:19             ` Mike Travis
2009-01-12  1:01             ` H. Peter Anvin
2009-01-12 11:22         ` Maciej Rutecki
2009-01-12 11:26           ` Ingo Molnar
2009-01-12 11:28             ` Maciej Rutecki
2009-01-12 12:10             ` Dieter Ries
2009-01-12 12:21               ` Ingo Molnar
2009-01-12 16:37                 ` Dieter Ries
2009-01-12 18:59                   ` Ingo Molnar
2009-01-13  4:45                     ` Michal Jaegermann
2009-01-12 17:22             ` 2.6.29-rc1 does not boot and fails to resume Rafael J. Wysocki
2009-01-14  1:16             ` Rusty Russell [this message]
2009-01-14 11:30               ` 2.6.29-rc1 does not boot Ingo Molnar
2009-01-14 12:47               ` Dieter Ries
2009-01-15 20:01         ` Mike Travis
2009-01-15 21:03           ` Dieter Ries
2009-01-15 21:48             ` Maciej Rutecki
2009-01-15 21:54               ` Mike Travis
2009-01-15 23:04                 ` Maciej Rutecki
2009-01-15 23:31                   ` Mike Travis
2009-01-15 21:54             ` Mike Travis
2009-01-15 23:02               ` Dieter Ries
2009-01-15 23:30                 ` Mike Travis

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=200901141146.04563.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=clip2@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=mingo@elte.hu \
    --cc=travis@sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox