Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 727
Arun Kp Avatar asked Oct 16 '25 23:10

Arun Kp


1 Answers

You can use the isolcpus command-line parameter of the kernel:

This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset.

like image 184
mkayaalp Avatar answered Oct 19 '25 12:10

mkayaalp