0

I've tried to search for a solution, but all I found was how to pin processes to CPU using taskset or sched_setaffinity. But it looks like this won't give the process exclusive access to the CPU, i.e., scheduler may assign some other process on this CPU. Is there any way or command by which we can ensure that the CPU is dedicated to the process? With taskset we can make sure a particular process runs only on particular CPU, but I want it to be other way too, where CPU is binded to that process. I've found questions like How to allocate a process specific amount of CPU power? and How to limit a process to one CPU core in Linux? but they got marked as duplicate of How can I set the processor affinity of a process on Linux? which is not what I want.

  • If you pin all processes to other cores, your special process will be the olny one to run on that specific core. But that's probably not what you want. Maybe to need to explain your usage. Applications with a high performance task and guaranteed response times hide a core from the OS and run a bare metal process on that core, for example. – Philippos Jul 17 at 6:51
  • Hmm... Yeah, something like that. I don't have access to the machine. I want everything to happen automatically with, maybe a shell script or c code of the process – user41965 Jul 17 at 7:00
1

You Need to exclude one CPU from the Overall scheduling, afterwards you can assign the process to it via

taskset

as you already found out. To exclude a CPU, add the boot Parameter

isolcpus=N

The Number (N) is 0-based.

  • Thank you very much for the answer, I think it'll work. What is N? I didn't understand what you wrote. I'm really sorry. – user41965 Jul 17 at 7:02
  • N is a number from 0 to (number-of-CPUs -1) – gerhard d. Jul 17 at 7:10
  • Hey, thank you very much. Just a question. Is there any way to achieve this without having to reboot the system? At least something that'll act like this if not being able to completely isolate the core. Thank you. – user41965 Jul 22 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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