Author: Weiwei Wan, Date: 03/16/2022, Place: Toyonaka, Osaka

The realtime performance of python under different linux configurations can be found on this webpage: https://qiita.com/kakinaguru_zo/items/755f4b77eedadc0be26d

Here, let me include the most interesting table below for convenience.

Untitled

The table shows that chrt —fifo 99 with a RT kernel has the best performance. However, under standard OS with high-performance CPU setting. Linux performs similarly as preempt_rt. It thus depends on users to decide if they really need to preempt rt or not.

To turn on CPU performance, use

sudo cpupower frequency-set -g performance

cpupower may not be available on some linux, install them by installing linux-tools-common/generic. Use the following command to see if performance is toggled on:

grep "cpu MHz" /proc/cpuinfo

On my PC, the results are

cpu MHz		: 3700.000
cpu MHz		: 4317.123
cpu MHz		: 3700.000
cpu MHz		: 3700.000
cpu MHz		: 3700.000
cpu MHz		: 3700.000
cpu MHz		: 3700.000
cpu MHz		: 3700.000

Despite the above choice, we in this article patch a Ubuntu Linux with preempt_rt to implement an RT Linux, and then use chrt —fifo 99 to obtain a satisfying control frequency.

Note the usage of the chrt command can be found in this page: https://qiita.com/hana_shin/items/7bdfd485b322cf9ad521 chrt —fifo 99 equals to chrt -f 99

Building Real-Time Kernels

First examine the kernel version of your current linux using