Re: To make a function get executed on cpu2

From: Dave Jones (
Date: Wed Jul 02 2003 - 07:21:37 EST

On Wed, Jul 02, 2003 at 08:02:19AM -0400, Zwane Mwaikambo wrote:
> On Wed, 2 Jul 2003, Herbert Xu wrote:
> > Surely you can emulate it using smp_call_function and make it return
> > straight away if it runs on the wrong CPU.
> Yes you can, i thought about the same thing, but it simply generates
> unecessary APIC bus traffic and just sounds horrid. Not to mention it
> doesn't sound all that friendly on larger systems.

See do_cpuid in arch/i386/kernel/cpuid.c for an example of how to do this
properly. It's a bit icky, but works. I've considered writing a generic
run_on_cpu() when I did the on_each_cpu() stuff, but asides from
cpuid.c, msr.c was the only other case I could find from a quick
grep around that really cared, so it didn't seem worth the effort.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:16 EST