Docs

Old Web

Select Region/Language
EN CN
RPI Developer / Application Software / Latency of Raspberry Pi 4 on Standard and Real-Time Linux 4.19 Kernel

Latency of Raspberry Pi 4 on Standard and Real-Time Linux 4.19 Kernel

EDATECPublish at 2025-02-06
8570 views
Introduction
This post is an update to my previous post about the same topic for Raspberry Pi 3.
Like in the previous post, I am using the standard kernel which comes with the Raspian image and a similar kernel version with RT patch applied. For Real-Time version, I am using the rpi-4.19.y-rt branch in raspberrypi/linux repository. Similarly for the test, I am using the cyclic test program in Real-Time Linux project.
Cyclic test program measures how much it takes to respond to an interrupt generated by the timer.

Setup

Both experiments below is run on a Raspberry Pi 4.

For the standard linux kernel, I am using the Raspian image and did an upgrade which resulted the kernel version 4.19.75 at the time of writing this post.

For the real-time linux kernel, I cloned rpi-4.19.y-rt branch in raspberrypi/linux repository. At the time of writing this post, this resulted kernel version 4.19.71-rt24-v71+. Here is a post summarizing steps to build the kernel.

For the cyclic test program, I am using the rt-tests-1.5.tar.gz package. I have built the tool with .make NUMA=0

The plots below are generated with gnuplot, using the mklatencyplot script of OSADL. The cyclic test is run with the following parameters:

cyclictest -l100000000 -m -S -p90 -i200 -h400 -q

A single run of this test takes around than 5 hours.

In the previous article, I used no additional load in the system. For this post, I made the experiment with a cpu load generated with stress-ng. I use stress-ng with these arguments: and run the stressors in low priority with .-c 0 -qnice -19

Test Result 1 - Standard Kernel

(  Latency plot generated on Raspberry Pi 4 running 4.19.75  )


Test Result 2 - Real-Time Kernel

(   Latency plot generated on Raspberry Pi 4 running 4.19.71-rt24    )


Conclusion

Similar to Raspberry Pi 3 and my previous experiment, Raspberry Pi 4 performs similarly, having lower average latency numbers with Real-Time kernel. Comparing to the previous post, the average latency is higher here, and obviously the reason for this is the load generated by stress-ng. This shows, in order to get a better result, it is important to do such experiments with a reasonably similar load that one is expecting.

Original link: https://metebalci.com/blog/latency-of-raspberry-pi-4-on-standard-and-real-time-linux-4.19-kernel/

EDATEC

Started in 2017, EDATEC has been certified as one of the global design partners of Raspberry Pi since 2018, providing Raspberry Pi based industrial computers design and manufacturing services for global customers.

  • Building 29, No. 1661, Jialuo Road, Jiading District, Shanghai.
  • CN: +86-159 2148 3028 (yang)
    US: +86-18217351262 (Iris Zhou) +1 859-653-0800 (Randall Restle)
  • support@edatec.cn
Submit Your Message

INFO

By submitting, you agree to EDATEC's policies

Please enter the verification code

captcha