2

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.

2 Answers2

1

There are 2 possible kernel parameters:

maxcpus

isolcpus

I think in your case, maxcpus is the better choice

Add

maxcpus=1

to the kernel boot option

derchris
  • 451
  • 2
  • 7
  • maxcpus limits the amount of cpu's detected by the operating system for use. I think that you will want to use "isolcpus=N" and then use taskset to migrate the tasks to the free cpus. If you're using red hat Enterprise Linux MRG, you can use "tuna" and taskset. – No Username Aug 09 '11 at 02:15
1

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.

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • 1
    taskset does not work with NUMA: https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_MRG/2/html/Realtime_Tuning_Guide/sect-Realtime_Tuning_Guide-General_System_Tuning-Interrupt_and_Process_Binding.html#orde-Realtime_Tuning_Guide-Interrupt_and_Process_Binding-Binding_Processes_to_CPUs_using_the_taskset_utility – carillonator May 06 '13 at 21:28
  • 1
    In the meantime it is possible by e.g. `echo "0" >/sys/devices/system/cpu/cpu1/online` to disable a core completely. – Kellerspeicher Jan 12 '16 at 11:56