Re: To make a function get executed on cpu2

Dave Jones (davej@codemonkey.org.uk)
Wed, 2 Jul 2003 13:21:37 +0100


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.

Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/