Search code examples
linuxlinux-kernelschedulerscheduling

How to restrict a CPU core to only 2 applications using Linux scheduler?


I would like to study the interaction between two applications on a CPU core, one is persistent application (NVM resident) and another is regular (DRAM resident). For this I want to only schedule these 2 applications on a core and nothing else. I am looking at Linux scheduler to accomplish this. Can someone please help me with a direction to achieve this? Can I achieve this using sched or do I need to modify the scheduler code of kernel so that scheduler does not schedule applications to the core of my interest.


Solution

  • isolcpus is a solution but the linux kernel documentation declares it as deprecated:

    isolcpus= [KNL,SMP,ISOL] Isolate a given set of CPUs from disturbance.
    [Deprecated - use cpusets instead]

    The cpuset sub-system of the cgroups is preferable. A tool like partrt is based on this principle to divide the CPU cores in two subsets: nrt where all the processes run and rt into which you can move your applications. Hence, the applications are isolated on some CPU cores.