From: Andrew M. <an...@uo...> - 2001-02-14 03:27:36
|
Rajagopal Ananthanarayanan wrote: > > Tim Wright wrote: > > > > Hi Bill, > > I'm pretty sure there's no exported interface in the standard kernels. > > I'm sure I've seen code out there to do it somewhere. I thought it might have > > been in a SGI patch. SGI guys, do you know ? > > > > I'm cc:ing Nick Pollitt on this mail who did the patch under discussion. > No, there is no interface in the standard kernel. Nick, can you please > elaborate? I did a patch against 2.4.1. It creates /proc/<pid>/cpus_allowed, which is exactly what you're after. http://www.uow.edu.au/~andrewm/linux/#cpus_allowed Note that if a process calls schedule() in state TASK_RUNNING, it does not honour new settings of cpus_allowed. A process must pass through a sleeping state before is picks up the new setting. I think this is reasonable behaviour, actually. If you grab http://www.uow.edu.au/~andrewm/linux/zc.tar.gz you'll find a little proglet in there called `run_on_cpu' which allows you to run another program on a selected CPU set. |