* [PATCH 3/10] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@ 2009-03-05 6:57 Rusty Russell
0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2009-03-05 6:57 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Ingo Molnar, Venkatesh Pallipadi, Len Brown,
Zhao Yakui, Dave Jones, Thomas Gleixner, Andrew Morton
From: Andrew Morton <akpm@linux-foundation.org>
Attempting to rid us of the problematic work_on_cpu(). Just use
smp_call_function_single() here.
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>
---
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff -puN arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c~arch-x86-kernel-cpu-cpufreq-acpi-cpufreqc-avoid-using-work_on_cpu arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c~arch-x86-kernel-cpu-cpufreq-acpi-cpufreqc-avoid-using-work_on_cpu
+++ a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -150,7 +150,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;
@@ -167,10 +168,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;
@@ -189,23 +190,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)
@@ -250,7 +249,8 @@ struct perf_cur {
};
-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_cur *cur = _cur;
@@ -259,8 +259,6 @@ static long read_measured_perf_ctrs(void
wrmsr(MSR_IA32_APERF, 0, 0);
wrmsr(MSR_IA32_MPERF, 0, 0);
-
- 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, &cur))
+ if (smp_call_function_single(cpu, read_measured_perf_ctrs, &cur, 1))
return 0;
#ifdef __i386__
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-06 5:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-05 6:57 [PATCH 3/10] use smp_call_function_single() in arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox