Re: [Lse-tech] Re: Real Time Runqueue

Matthew Dobson
2001-11-19T20:28:30Z

george anzinger wrote:
> A couple of addition points. There should be an API to declare cpu
> affinity, and cpu affinity should be passed thru fork and exec. You may
> need to be god (root) to use the API however. (I think cpu affinity is
> currently passed thru fork and exec, by the way.)

There is... there is a launch_policy patch on
http://sourceforge.net/projects/lse, that offers 2 ways of setting a processes
CPU affinity. A process can muck around with its own affinity through prctl(),
and root can muck around with the CPU affinity of any process through
/proc/<pid>/cpus_allowed and /proc/<pid>/launch_policy. And the launch_policy
*is* inherited from parent to child.

The cpus_allowed part comes from Andrew Morton and controls the processes
affinity. I've extended that to include the launch_policy part which sets the
affinity to be passed on through fork/exec.

Enjoy!

-matt