All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ali Gholami Rudi <ali@rudi.ir>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	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: Wed, 15 Apr 2009 01:34:56 -0700	[thread overview]
Message-ID: <20090415013456.cf5ce205.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090415081534.GA2894@lilem.mirepesht>

On Wed, 15 Apr 2009 12:45:34 +0430 Ali Gholami Rudi <ali@rudi.ir> wrote:

> Hi,
> 
> In today's tip (v2.6.30-rc2), when my cpu is idle (and the ondemand
> governor correctly uses the lowest frequency) the temperature of my CPU
> rises to above 50^C till the fan turns on (it used to be about 40^C
> before).  Git bisect points to this patch:
> 
>   commit 01599fca6758d2cd133e78f87426fc851c9ea725
>   Author: Andrew Morton <akpm@linux-foundation.org>
>   Date:   Mon Apr 13 10:27:49 2009 -0700
>   
>       cpufreq: use smp_call_function_[single|many]() in acpi-cpufreq.c
>       
>       Atttempting to rid us of the problematic work_on_cpu().  Just use
>       smp_call_fuction_single() here.
>       
>       This repairs a 10% sysbench(oltp)+mysql regression which Mike reported,
>       due to
>       
>         commit 6b44003e5ca66a3fffeb5bc90f40ada2c4340896
>         Author: Andrew Morton <akpm@linux-foundation.org>
>         Date:   Thu Apr 9 09:50:37 2009 -0600
>       
>             work_on_cpu(): rewrite it to create a kernel thread on demand
>       
>       It seems that the kernel calls these acpi-cpufreq functions at a quite
>       high frequency.
>       
>       Valdis Kletnieks also reports that this causes 70-90 forks per second on
>       his hardware.
>       
>       Cc: Valdis.Kletnieks@vt.edu
>       Cc: Rusty Russell <rusty@rustcorp.com.au>
>       Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
>       Cc: Len Brown <len.brown@intel.com>
>       Cc: Zhao Yakui <yakui.zhao@intel.com>
>       Acked-by: Dave Jones <davej@redhat.com>
>       Cc: Thomas Gleixner <tglx@linutronix.de>
>       Tested-by: Mike Galbraith <efault@gmx.de>
>       Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
>       Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>       Acked-by: Ingo Molnar <mingo@elte.hu>
>       [ Made it use smp_call_function_many() instead of looping over cpu's
>         with smp_call_function_single()    - Linus ]

<stares suspiciously at smp_call_function_many()>

 * smp_call_function_many(): Run a function on a set of other CPUs.

"other".  It refuses to call the function on *this* CPU.  Tricky.

Does this fix it up?

--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c~a
+++ a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -204,7 +204,10 @@ static void drv_read(struct drv_cmd *cmd
 
 static void drv_write(struct drv_cmd *cmd)
 {
-	smp_call_function_many(cmd->mask, do_drv_write, cmd, 1);
+	unsigned cpu;
+
+	for_each_cpu(cpu, cmd->mask)
+		smp_call_function_single(cpu, do_drv_write, cmd, 1);	
 }
 
 static u32 get_cur_val(const struct cpumask *mask)
_


  reply	other threads:[~2009-04-15  8:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10  9:22 mmotm 2009-04-10-02-21 uploaded akpm
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: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
2009-04-15  8:15         ` Ali Gholami Rudi
2009-04-15  8:34           ` Andrew Morton [this message]
2009-04-15  9:08             ` Ali Gholami Rudi
2009-04-15 14:45             ` Linus Torvalds
2009-04-15  8:34           ` Andrew Morton
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=20090415013456.cf5ce205.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=ali@rudi.ir \
    --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 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.