linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* To make a function get executed on cpu2
@ 2003-07-01  6:20 Raghava Raju
  2003-07-01 16:33 ` Zwane Mwaikambo
  0 siblings, 1 reply; 6+ messages in thread
From: Raghava Raju @ 2003-07-01  6:20 UTC (permalink / raw)
  To: linux-kernel


Hi,

In multicpu systems in kernel version 2.4.19, how 
can we specify that a function be executed on 
a cpu of our choice(say cpu_2). Moreover if I call a
function from cpu_1 to be executed on cpu_2, I dont
want to wait in cpu_1 until complete execution of
function on cpu_2 . Is it possible?????

Any example would be really helpful. Please 
mail back to vraghava_raju@yahoo.com.

Regards
Raghava.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: To make a function get executed on cpu2
  2003-07-01  6:20 To make a function get executed on cpu2 Raghava Raju
@ 2003-07-01 16:33 ` Zwane Mwaikambo
  2003-07-02 10:03   ` Herbert Xu
  0 siblings, 1 reply; 6+ messages in thread
From: Zwane Mwaikambo @ 2003-07-01 16:33 UTC (permalink / raw)
  To: Raghava Raju; +Cc: linux-kernel

On Mon, 30 Jun 2003, Raghava Raju wrote:

> In multicpu systems in kernel version 2.4.19, how 
> can we specify that a function be executed on 
> a cpu of our choice(say cpu_2). Moreover if I call a
> function from cpu_1 to be executed on cpu_2, I dont
> want to wait in cpu_1 until complete execution of
> function on cpu_2 . Is it possible?????
> 
> Any example would be really helpful. Please 
> mail back to vraghava_raju@yahoo.com.

You can't really do it portably across all architectures, Alpha has 
smp_call_function_on_cpu which would allow you to do this. If you're 
really desperate you could always do something like the following;

http://www.osdl.org/projects/irqapi/results/patch-cpu_hotplug-smp_call_function_on_cpu_i386

Good luck,
	Zwane
-- 
function.linuxpower.ca

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: To make a function get executed on cpu2
  2003-07-01 16:33 ` Zwane Mwaikambo
@ 2003-07-02 10:03   ` Herbert Xu
  2003-07-02 12:02     ` Zwane Mwaikambo
  0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2003-07-02 10:03 UTC (permalink / raw)
  To: Zwane Mwaikambo, linux-kernel

Zwane Mwaikambo <zwane@arm.linux.org.uk> wrote:
> On Mon, 30 Jun 2003, Raghava Raju wrote:
> 
>> In multicpu systems in kernel version 2.4.19, how 
>> can we specify that a function be executed on 
>> a cpu of our choice(say cpu_2). Moreover if I call a
>> function from cpu_1 to be executed on cpu_2, I dont
>> want to wait in cpu_1 until complete execution of
>> function on cpu_2 . Is it possible?????
>> 
>> Any example would be really helpful. Please 
>> mail back to vraghava_raju@yahoo.com.
> 
> You can't really do it portably across all architectures, Alpha has 
> smp_call_function_on_cpu which would allow you to do this. If you're 

Surely you can emulate it using smp_call_function and make it return
straight away if it runs on the wrong CPU.
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: To make a function get executed on cpu2
  2003-07-02 10:03   ` Herbert Xu
@ 2003-07-02 12:02     ` Zwane Mwaikambo
  2003-07-02 12:21       ` Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Zwane Mwaikambo @ 2003-07-02 12:02 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-kernel

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. But if you're using 
smp_call_function you're not really all that speed critical anyway, so 
this should suffice.

	Zwane
-- 
function.linuxpower.ca

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: To make a function get executed on cpu2
  2003-07-02 12:02     ` Zwane Mwaikambo
@ 2003-07-02 12:21       ` Dave Jones
  2003-07-02 12:29         ` Zwane Mwaikambo
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jones @ 2003-07-02 12:21 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Herbert Xu, linux-kernel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: To make a function get executed on cpu2
  2003-07-02 12:21       ` Dave Jones
@ 2003-07-02 12:29         ` Zwane Mwaikambo
  0 siblings, 0 replies; 6+ messages in thread
From: Zwane Mwaikambo @ 2003-07-02 12:29 UTC (permalink / raw)
  To: Dave Jones; +Cc: Herbert Xu, linux-kernel

On Wed, 2 Jul 2003, Dave Jones wrote:

> 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.

I wrote come code which required such and ended up doing something 
similar. I also reckoned the actual function was generic enough i can't 
possibly be the only person needing such.

	Zwane
-- 
function.linuxpower.ca

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-07-02 12:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-01  6:20 To make a function get executed on cpu2 Raghava Raju
2003-07-01 16:33 ` Zwane Mwaikambo
2003-07-02 10:03   ` Herbert Xu
2003-07-02 12:02     ` Zwane Mwaikambo
2003-07-02 12:21       ` Dave Jones
2003-07-02 12:29         ` Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).