Issue
I'm a kernel noob including schedulers. I understand that there is a IO scheduler and a task scheduler and according to this href="https://unix.stackexchange.com/questions/199265/relationship-between-io-scheduler-and-cpu-process-scheduler">post IO scheduler uses normal tasks that are handled by the task schedule in the end.
- So if I run an user space thread that was assigned to an isolated core (using isolcpus) and it will do some IO operation, will the the task created by the IO scheduler get executed on the isolated core ?
- Since CFS seems to favor user interaction does this mean that CPU intensive threads might get a lower CPU time in the long run? Isolating cores can help mitigate this issue?
- Isolating cores can decrease the scheduling latency (the time it takes for a thread that was marked as runnable to get executed ) for the threads that are pined to the isolated cores?
Solution
So if I run an user space thread that was assigned to an isolated core (using isolcpus) and it will do some IO operation, will the the task created by the IO scheduler get executed on the isolated core ?
What isolcpus
is doing is taking that particular core out of kernel list of cpu where it can schedule tasks. So once you isolate a cpu from kernel's list of cpus it will never schedule any task on that core, no matter whether that core is idle or is being used by some other process/thread.
Since CFS seems to favor user interaction does this mean that CPU intensive threads might get a lower CPU time in the long run? Isolating cores can help mitigate this issue?
Isolating cpu has a different use altogether in my opinion. Basically if your applications has both fast threads(threads with no system calls, and are latency sensitive) and slow threads(threads with system calls) you would want to have dedicated cpu cores for your fast threads so that they are not interrupted by kernel's scheduling process and hence can run to their completion without any noise. Fast threads are usually latency sensitive. On the other hand slow threads or threads which are not really latency sensitive and are doing supporting logic for your application need not have dedicated cpu cores. As mentioned earlier isloting cpu servers a different purpose. We do all this all the time in our organization.
Isolating cores can decrease the scheduling latency (the time it takes for a thread that was marked as runnable to get executed ) for the threads that are pined to the isolated cores?
Since you are taking cpus from kernel's list of cpus this will surely impact other threads and processes, but then again you would want to pay extra thought and attention to what really is your latency sensitive code and you would want to separate it from your non-latency sensitive code.
Hope it helps.
Answered By - Rohit Answer Checked By - Katrina (WPSolving Volunteer)