title: SCHED_FIFO higher priority thread is getting preempted by the SCHED_FIFO lower priority thread?
body: <p>I am testing my multithreaded application in Linux RT multicore machine.</p>
  <p>However during testing, we are observing that scheduling (created with SCHED_FIFO scheduling policy ) in Linux RT is not happening according to the SCHED_FIFO policy.
  We could see in multiple places that the higher priority thread execution is getting preempted by a lower priority thread.</p>
  <p>Based on some research we did on the internet, we found that the following kernel parameters need to be changed from</p>
  <pre><code>/proc/sys/kernel/sched_rt_period_us containing 1000000
  /proc/sys/kernel/sched_rt_runtime_us containing 950000
  </code></pre>
  <p>to</p>
  <pre><code>/proc/sys/kernel/sched_rt_period_us containing 1000000
  /proc/sys/kernel/sched_rt_runtime_us containing 1000000
  </code></pre>
  <p>or</p>
  <pre><code>/proc/sys/kernel/sched_rt_period_us containing -1
  /proc/sys/kernel/sched_rt_runtime_us containing -1
  </code></pre>
  <p>We tried doing both but still we are facing the problem sometimes. We are facing the issue even when higher priority thread is not suspended by any system call.</p>
  <p>It would be great if you could let us know if you are aware of such problems in Linux RT scheduling and/or have any solutions to make the Linux RT scheduling deterministic based on priority.</p>
  <p>There are no printfs or any system calls in the higher priority thread but still the higher priority thread is getting preempted by the lower priority thread.</p>
  <p>Also I have made sure all the threads in the process are running on a single core using taskset command.</p>