2003-07-15 11:25:46

by Shaheed

[permalink] [raw]
Subject: [HOWTO] Emulate processor sets (pset) for linux kernel 2.5/2.6


A while ago, I was banging on about kernel patches and whatnot to implement the
equivalent of "pset" functionality. After some shoves/pointers from Robert and
Miquel, I found that init(8) has the concept of an initscript(5), so that the
trivial solution to my problem is to say:

#
# initscript Executed by init(8) for every program it
# wants to spawn like this:
#
# /bin/sh /etc/initscript <id> <level> <action> <process>
#
taskset -p 1 $$
eval exec "$4"

and then modify the relevant programs to set their affinity to the other
processors as required. Bingo!

Hope this helps, Shaheed