If a multi-threaded program or code is run on a set of isolated cores using 'taskset' then all the program threads run on only one core.
Issue
-
On a multi-CPU system, if more than one CPUs are isolated and if a multi-threaded program is run on it, then it has been observed that the program and all its child threads run only on a single CPU.
-
It has been observed that the above statement is true if a multi-threaded program is run using non-RT scheduling policies like
SCHED_OTHER,SCHED_IDLE. -
But if the same application is run using RT scheduling policies like
SCHED_FIFO,SCHED_RR, then it has been observed that the multiple threads will be spread over isolated CPUs correctly. -
Here are brief examples of both the conditions :
-
If say CPUs 5 and 7 are isolated, then using normal scheduling policies (On RHEL default scheduling policy is
SCHED_OTHER) will run the application 'fork' only on CPU 5.
# taskset -c 5-7 ./fork
- But if RT scheduling policies are used (here
SCHED_RRis selected), then the application will run on both the isolated CPUs.
# taskset -c 5-7 chrt -r 1 ./fork
Environment
- This is a generic observation, not limited to any specific RHEL (or Kernel) version.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
