[Cbe-oss-dev] [RFC/PATCH]: User-space access to Cell bookmark registers
Anton Blanchard
anton at samba.org
Thu Aug 9 22:51:49 EST 2007
Hi Kevin,
> Well, smp_call_function_single() will only call smp_call_function_map() if you
> are not targetting the current CPU, but it doesn't directly run the desired
> routine if you are targetting the current CPU. So we'd need to do something like:
It was a recent addition:
if (cpu != get_cpu())
ret = smp_call_function_map(func,info,nonatomic,wait,map);
else {
local_irq_disable();
func(info);
local_irq_enable();
}
> Would that be preferrable to the set_cpus_allowed() method?
I did the same affinity trick in arch/powerpc/kernel/sysfs.c. The thing
that always bothered me is that if you have a real time process, or are
using cpusets or isolcpus then you might not be able to schedule on the
target cpu. Bad.
smp_call_function_map would be safer although it brings up one
interesting question. If you are running a real time process on your
isolated cpu you probably dont want a user process on another cpu to be
able to disturb you. Im not sure anyone except for SGI use isolcpus, so
I may be worrying about nothing :)
Anton
More information about the cbe-oss-dev
mailing list