I have a 6-core system and I would like to change the affinity of all processes to restrict them to use only the first four cores. I know what I'm doing, and I'll use the last two cores for a special purpose. I created a new init script under /etc/init.d/affty and here is its contents:
Code: Select all
#!/sbin/runscript
description="Set processor affinity"
depend() {
before *
}
start() {
/usr/bin/taskset -cp 0,1,2,3 1
/usr/bin/taskset -cp 0,1,2,3 $$
}
Code: Select all
rc-update add /etc/init.d/affty sysinit Code: Select all
taskset -p 1Code: Select all
rc-status sysinit
Any ideas? I've been stuck with this for over two days already.


