Abruzzo Forte e Gentile
Abruzzo Forte e Gentile

Reputation: 14869

bind 1 single process on 1 cpu and moving all IRQs, deamins, rpci on other CPUS

I have a Linux machine with 16 cores in it.

// uname -a
Linux lndbxdev01 2.6.24.7-108.el5rt #1 SMP PREEMPT RT 
Mon Mar 23 10:58:10 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

// OS detail
Red Hat Enterprise Linux Server release 5.3 (Tikanga)

I would like to schedule process affinity so that 1 CPU will be entirely dedicated to 1 process.

When I say entirely dedicated I mean that I want really to bound any other running deamons, IRQ-nnnn, rpciod/nn, etc. to all CPUs available except for the one my process is interested. ( on my OS I can count around 500 processes ).

  1. by doing that is it safe or should I care for letting some of them on the CPU where they are currently running?
  2. If I bind at least IRQs will the performance be better?

Since these are connected to interrupts, which are triggered frequently, they induce a frequent process context switch since the kernel has to call those.

I am expecting the following benefits:

  1. because there will be one single process running a single CPU there will be NO process context switch at all.
  2. the time slice assigned to my process on that CPU will be increased so it will run longer before a process context switch ( if any ).

Kind Regards AFG

Upvotes: 2

Views: 1657

Answers (1)

Saman Barghi
Saman Barghi

Reputation: 354

I guess cpusets can help you overcome this problem. You can define an exclusive cpuset for one of the CPUs and bind the process to that specific cpuset.

http://www.kernel.org/doc/man-pages/online/pages/man7/cpuset.7.html

You might find cset usefule:

http://code.google.com/p/cpuset/

If you are not willing to use any of them, then you need to write your own c code to schedule the process on a specific cpu (using sched_setaffinity) and disable all interrupts on that specific cpu.

I hope it helps.

Upvotes: 1

Related Questions