public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Valdis.Kletnieks@vt.edu, Mike Travis <travis@sgi.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	mm-commits@vger.kernel.org, Rusty Russell <rusty@rustcorp.com.au>,
	Dave Jones <davej@redhat.com>, Len Brown <lenb@kernel.org>
Subject: Re: mmotm 2009-04-10-02-21 uploaded - forkbombed by work_for_cpu
Date: Mon, 13 Apr 2009 17:31:13 -0700	[thread overview]
Message-ID: <20090413173113.24a61442.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0904131648290.26713@localhost.localdomain>

On Mon, 13 Apr 2009 16:50:45 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> So I applied this (commit 01599fca6758d2cd133e78f87426fc851c9ea725: 
> "cpufreq: use smp_call_function_[single|many]() in acpi-cpufreq.c"), but 
> just realized - because of a compiler warning - that this looks 
> suspicious:
> 
> On Mon, 13 Apr 2009, Andrew Morton wrote:
> > @@ -283,7 +280,7 @@ static unsigned int get_measured_perf(st
> >  	unsigned int perf_percent;
> >  	unsigned int retval;
> >  
> > -	if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin))
> > +	if (smp_call_function_single(cpu, read_measured_perf_ctrs, &cur, 1))
> >  		return 0;
> >  
> >  	cur.aperf.whole = readin.aperf.whole -
> 
> How and why did that "read_measured_perf_ctrs, &readin" become 
> "read_measured_perf_ctrs, &cur" when the work_on_cpu() was converted to 
> "smp_call_function_single()"?
> 
> Looks like a bug. But such an odd one that I wonder whether there was some 
> thought behind it? Andrew? 
> 

<scratches head>

OK, the acpi tree went and had conflicting changes merged into it after
I'd written the patch:

@@ -281,52 +279,57 @@ static long read_measured_perf_ctrs(void
 static unsigned int get_measured_perf(struct cpufreq_policy *policy,
 				      unsigned int cpu)
 {
-	struct perf_cur cur;
+	struct perf_pair readin, cur;
 	unsigned int perf_percent;
 	unsigned int retval;
 
-	if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur))
+	if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin))
 		return 0;
 
+	cur.aperf.whole = readin.aperf.whole -
+				per_cpu(drv_data, cpu)->saved_aperf;
+	cur.mperf.whole = readin.mperf.whole -
+				per_cpu(drv_data, cpu)->saved_mperf;
+	per_cpu(drv_data, cpu)->saved_aperf = readin.aperf.whole;
+	per_cpu(drv_data, cpu)->saved_mperf = readin.mperf.whole;
+

and it appears that I incorrectly reverted part of
18b2646fe3babeb40b34a0c1751e0bf5adfdc64c while fixing the resulting
rejects.

Switching it to `readin' looks correct.

  reply	other threads:[~2009-04-14  0:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200904100922.n3A9MOIV013828@imap1.linux-foundation.org>
2009-04-10 19:53 ` mmotm 2009-04-10-02-21 uploaded (shmem) Randy Dunlap
2009-04-10 20:00   ` Andrew Morton
2009-04-10 20:04     ` Randy Dunlap
2009-04-10 20:16     ` Hugh Dickins
2009-04-11 13:22 ` mmotm 2009-04-10-02-21 uploaded - forkbombed by work_for_cpu Valdis.Kletnieks
2009-04-13 16:04   ` Linus Torvalds
2009-04-13 16:34     ` Mike Galbraith
2009-04-13 17:18     ` Ingo Molnar
2009-04-13 17:27       ` Andrew Morton
2009-04-13 17:41         ` Ingo Molnar
2009-04-13 17:45         ` Linus Torvalds
2009-04-13 18:11           ` Ingo Molnar
2009-04-13 18:49           ` Andrew Morton
2009-04-13 19:03             ` Jeremy Fitzhardinge
2009-04-13 19:03             ` Dave Jones
2009-04-13 19:40               ` Ingo Molnar
2009-04-13 19:27         ` Valdis.Kletnieks
2009-04-13 23:50         ` Linus Torvalds
2009-04-14  0:31           ` Andrew Morton [this message]
2009-04-15  8:15         ` Ali Gholami Rudi
2009-04-15  8:34           ` Andrew Morton
2009-04-15  9:08             ` Ali Gholami Rudi
2009-04-15 14:45             ` Linus Torvalds
2009-04-14 12:42     ` Rusty Russell

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=20090413173113.24a61442.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=davej@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mm-commits@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@linux-foundation.org \
    --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