title: Ratio of sched_rt_runtime_us to sched_rt_period_us is NOT shown in 'top' in Linux
body: <p>I am checking the impact of Linux's <code>sched_rt_runtime_us</code>.<br />
  My understanding of the Linux RT scheduling is <code>sched_rt_period_us</code> defines scheduling period of RT process, and <code>sched_rt_runtime_us</code> defines how much the RT process can run within that period.</p>
  <p>In my Linux-4.18.20, the <code>kernel.sched_rt_period_us = 1000000, kernel.sched_rt_runtime_us = 950000</code>, so in each second, 95% time is used by RT process, 5% is for SCHED_OTHER processes.</p>
  <p>By changing the <code>kernel.sched_rt_runtime_us</code>, the CPU usage of RT process shown in <code>top</code> should be proportional with <code>sched_rt_runtime_us/sched_rt_period_us</code>.<br />
  But my testing does NOT get the expected results, and what I got is as follows,</p>
  <pre><code>                                               %CPU
  kernel.sched_rt_runtime_us = 50000  
  2564 root      rt   0    4516    748    684 R  19.9  0.0   0:37.82 testsched_top  
  kernel.sched_rt_runtime_us = 100000  
  2564 root      rt   0    4516    748    684 R  40.5  0.0   0:23.16 testsched_top  
  kernel.sched_rt_runtime_us = 150000  
  2564 root      rt   0    4516    748    684 R  60.1  0.0   0:53.29 testsched_top
  kernel.sched_rt_runtime_us = 200000  
  2564 root      rt   0    4516    748    684 R  80.1  0.0   1:24.96 testsched_top
  
  </code></pre>
  <p>The testsched_top is a SCHED_FIFO process with priority 99, and it is running in an isolated CPU.<br />
  The cgroup is configured in grub.cfg as <code>cgroup_disable=cpuset,cpu,cpuacct</code> to disable CPU related stuff.</p>
  <p>I don't know why this happens, is there anything missing or wrong in my testing and understanding of Linux SCHED_FIFO scheduling?</p>
  <p><strong>N.B.</strong>: I am running this in Ubuntu VM, which is configured with 8 vCPUs, in which 4-7 are isolated to run RT processes. The host is Intel X86_64 with 6Cores (12 Threads), and there is NO other VMs running in the host. The above testsched_top was copied from <a href="https://viviendolared.blogspot.com/2017/03/death-by-real-time-scheduling.html?m=0" rel="nofollow noreferrer">https://viviendolared.blogspot.com/2017/03/death-by-real-time-scheduling.html?m=0</a>, it sets priority 99 for SCHED_FIFO and loops indefinitely in one isolated CPU. I checked that isolated CPU usage, and got above results. –</p>