Linux, set affinity for init

affinityinitlinux

What is a most convenient way to set affinity mask for init process in linux (debian) on the startup the system?

I know about taskset, but i want set affinity mask for init on it's startup, so all processes will inherit it.

Thank you.

Best Answer

Try the "isolcpus" kernel boot arg. You can list the CPUs you want the scheduler to ignore; the CPUs not listed will effectively form a mask for init and all its children. You can then place a process on the ignored CPUs by running it via taskset.