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

Matthew Dobson (colpatch@us.ibm.com)
Mon, 19 Nov 2001 12:23:42 -0800


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