Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
taskset does not work with NUMA: access.redhat.com/site/documentation/en-US/… –  carillonator May 6 '13 at 21:28

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

share|improve this answer
    
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. –  Wade Mealing Aug 9 '11 at 2:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.