How “real-time” are the FIFO/RR schedulers on non-RT Linux kernel?

一世执手 提交于 2021-02-20 03:44:55

问题


Say on a non-RT Linux kernel (4.14, Angstrom distro, running on iMX6) I have a program that receives UDP packets (< 1400 bytes) that come in at a very steady data rate. Basically,

  • the essence of the program is:

    while (true)
    {  recv( sockFd, ... );
       update_loop_interval_histogram(); // O(1)
    }
    
  • To minimize the maximally occuring delay time (loop intervals), I started my process with:

    chrt --fifo 99 ./programName
    

    setting the scheduler to a "real-time" mode SCHED_FIFO with highest priority.

  • the CPU affinity of my process is fixed to the 2nd core.

  • Next to that, I ran a benchmark program instance per core, deliberately getting the CPU load to 100%.

That way, I get a maximum loop interval of ~10ms (vs. ~25ms without SCHED_FIFO). The occurence of this is rare. During e.g. an hour runtime, the counts sum of all intervals <400µs divided by the sum of all counts of all other interval time occurences from 400µs to 10000µs is over 1.5 million. But as rare as it is, it's still bad.

Is that the best one can reliably get on a non-RealTime Linux kernel, or are there further tweaks to be made to get to something like 5ms maximum interval time?

来源:https://stackoverflow.com/questions/54313452/how-real-time-are-the-fifo-rr-schedulers-on-non-rt-linux-kernel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!