* [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@ 2009-04-13 0:00 Rusty Russell
2009-04-13 0:16 ` Dave Jones
0 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2009-04-13 0:00 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Mike Galbraith, Ingo Molnar, Venkatesh Pallipadi,
Len Brown, Zhao Yakui, Dave Jones, Thomas Gleixner, Andrew Morton
From: Andrew Morton <akpm@linux-foundation.org>
Impact: fix sysbench(oltp)+mysql 10% regression with 2.6.30-rc1
Mike says:
It's kondemand, do_dbs_timer() is queueing work 9-14 times/sec/cpu.
Tested-by: Mike Galbraith <efault@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Zhao Yakui <yakui.zhao@intel.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (use rdmsr_on_cpu)
---
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
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
@@ -153,7 +153,8 @@ struct drv_cmd {
u32 val;
};
-static long do_drv_read(void *_cmd)
+/* Called via smp_call_function_single(), on the target CPU */
+static void do_drv_read(void *_cmd)
{
struct drv_cmd *cmd = _cmd;
u32 h;
@@ -170,10 +171,10 @@ static long do_drv_read(void *_cmd)
default:
break;
}
- return 0;
}
-static long do_drv_write(void *_cmd)
+/* Called via smp_call_function_single(), on the target CPU */
+static void do_drv_write(void *_cmd)
{
struct drv_cmd *cmd = _cmd;
u32 lo, hi;
@@ -192,23 +193,21 @@ static long do_drv_write(void *_cmd)
default:
break;
}
- return 0;
}
static void drv_read(struct drv_cmd *cmd)
{
cmd->val = 0;
- work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd);
+ smp_call_function_single(cpumask_any(cmd->mask), do_drv_read, cmd, 1);
}
static void drv_write(struct drv_cmd *cmd)
{
- unsigned int i;
+ unsigned int cpu;
- for_each_cpu(i, cmd->mask) {
- work_on_cpu(i, do_drv_write, cmd);
- }
+ 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)
@@ -253,14 +252,13 @@ struct perf_pair {
};
-static long read_measured_perf_ctrs(void *_cur)
+/* Called via smp_call_function_single(), on the target CPU */
+static void read_measured_perf_ctrs(void *_cur)
{
struct perf_pair *cur = _cur;
rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi);
rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);
-
- return 0;
}
/*
@@ -283,7 +281,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, &readin, 1))
return 0;
cur.aperf.whole = readin.aperf.whole -
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
2009-04-13 0:00 [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c Rusty Russell
@ 2009-04-13 0:16 ` Dave Jones
2009-04-13 3:40 ` Ingo Molnar
2009-04-14 9:05 ` Rusty Russell
0 siblings, 2 replies; 5+ messages in thread
From: Dave Jones @ 2009-04-13 0:16 UTC (permalink / raw)
To: Rusty Russell
Cc: Ingo Molnar, linux-kernel, Mike Galbraith, Ingo Molnar,
Venkatesh Pallipadi, Len Brown, Zhao Yakui, Thomas Gleixner,
Andrew Morton
On Mon, Apr 13, 2009 at 09:30:02AM +0930, Rusty Russell wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
>
> Impact: fix sysbench(oltp)+mysql 10% regression with 2.6.30-rc1
>
This, and the other cpufreq related patches in this series look sound to me.
Given the other non-cpufreq bits in the series, do you want to just
have these go through Andrew and onto Linus?
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
2009-04-13 0:16 ` Dave Jones
@ 2009-04-13 3:40 ` Ingo Molnar
2009-04-14 9:05 ` Rusty Russell
1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2009-04-13 3:40 UTC (permalink / raw)
To: Dave Jones, Rusty Russell, Ingo Molnar, linux-kernel,
Mike Galbraith, Venkatesh Pallipadi, Len Brown, Zhao Yakui,
Thomas Gleixner, Andrew Morton
* Dave Jones <davej@redhat.com> wrote:
> On Mon, Apr 13, 2009 at 09:30:02AM +0930, Rusty Russell wrote:
> > From: Andrew Morton <akpm@linux-foundation.org>
> >
> > Impact: fix sysbench(oltp)+mysql 10% regression with 2.6.30-rc1
> >
>
> This, and the other cpufreq related patches in this series look
> sound to me. Given the other non-cpufreq bits in the series, do
> you want to just have these go through Andrew and onto Linus?
the other x86 bits look good to me too. It would be best to do this
via -mm because the regression was introduced from there too so the
'lets do a revert and these patches in the next cycle' versus 'lets
do these fixes right now' decision should be driven from there too.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
2009-04-13 0:16 ` Dave Jones
2009-04-13 3:40 ` Ingo Molnar
@ 2009-04-14 9:05 ` Rusty Russell
2009-04-14 11:06 ` Ingo Molnar
1 sibling, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2009-04-14 9:05 UTC (permalink / raw)
To: Dave Jones
Cc: Ingo Molnar, linux-kernel, Mike Galbraith, Ingo Molnar,
Venkatesh Pallipadi, Len Brown, Zhao Yakui, Thomas Gleixner,
Andrew Morton
On Mon, 13 Apr 2009 09:46:57 am Dave Jones wrote:
> On Mon, Apr 13, 2009 at 09:30:02AM +0930, Rusty Russell wrote:
> > From: Andrew Morton <akpm@linux-foundation.org>
> >
> > Impact: fix sysbench(oltp)+mysql 10% regression with 2.6.30-rc1
> >
>
> This, and the other cpufreq related patches in this series look sound to me.
> Given the other non-cpufreq bits in the series, do you want to just
> have these go through Andrew and onto Linus?
Sure, that's certainly easiest for me. I'd assumed Ingo would snarf them,
but as he's suggested -mm, Andrew?
Thanks!
Rusty.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
2009-04-14 9:05 ` Rusty Russell
@ 2009-04-14 11:06 ` Ingo Molnar
0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2009-04-14 11:06 UTC (permalink / raw)
To: Rusty Russell
Cc: Dave Jones, Ingo Molnar, linux-kernel, Mike Galbraith,
Venkatesh Pallipadi, Len Brown, Zhao Yakui, Thomas Gleixner,
Andrew Morton
* Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Mon, 13 Apr 2009 09:46:57 am Dave Jones wrote:
> > On Mon, Apr 13, 2009 at 09:30:02AM +0930, Rusty Russell wrote:
> > > From: Andrew Morton <akpm@linux-foundation.org>
> > >
> > > Impact: fix sysbench(oltp)+mysql 10% regression with 2.6.30-rc1
> > >
> >
> > This, and the other cpufreq related patches in this series look
> > sound to me. Given the other non-cpufreq bits in the series, do
> > you want to just have these go through Andrew and onto Linus?
>
> Sure, that's certainly easiest for me. I'd assumed Ingo would
> snarf them, but as he's suggested -mm, Andrew?
I tend to let the snarfing be done by the tree which introduced a
regression to begin with ;-)
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-14 11:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-13 0:00 [PATCH 1/7] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c Rusty Russell
2009-04-13 0:16 ` Dave Jones
2009-04-13 3:40 ` Ingo Molnar
2009-04-14 9:05 ` Rusty Russell
2009-04-14 11:06 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox