Linux – How to configure Linux for using only one CPU/core of a NUMA system

linuxnumaopteronscheduler

I'm currently working with an AMD Opteron-based NUMA system. For the needs of my current project, I'd like to make Linux and all of the system processes to utilize only the CPU0 (and preferably, only one of its cores), leaving all other cores for my own egoistic needs. I know that it will really impact system performance, but it is OK now.

So, I'd like to know if it is possible to achieve at all without messing with the kernel source code. Any links to the up-to-date articles about NUMA and SMP implementation details in Linux will be appreciated, too.

Best Answer

leaving all other cores for...

That implies that you want to actually use the other cores.

Before you start using using the other cores, use taskset to apply the affinity for all running user processes (including init). e.g.

taskset 0x00000001 1

Then set the affinity mask to everything else for the process which will launch your "egotistical needs", e.g.

taskset 0xFFFFFFFE $$

You can't force the kernel to run on only one CPU (and it would be stupid anyway) unless you set the boot options which will only allow the system to access a single CPU.