2

Recently I got to know about real time kernel. I just wanted to know how can I make my current CentOS 7.3 kernel into a real time kernel.

Kernel version I have is "3.10.0-514.2.2.el7.x86_64".

3

If you're not experienced in patching your own kernel, install one of the stock real time kernels from a repository. One such option is to use the -ml series kernel from CERN.

To do so, first install the CERN-RT repo:

wget http://linuxsoft.cern.ch/cern/centos/7/rt/CentOS-RT.repo
yum groupinstall RT

This will install the RT kernel. Next:

reboot

After rebooting, you can then check the kernel version you're running like so:

uname -a

If you are NOT using the new kernel you just installed, you may need to adjust which kernel is set as default in /etc/default/grub. The GRUB_DEFAULT= points to the kernel image in use by numerical order. The first listed is 0, then 1, and so on. Once you've made sure that the correct number is listed, do:

grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot again and verify that you're now on the correct kernel. More information on CERN kernels can be found here:

http://linux.web.cern.ch/linux/rt/

  • Thanks for your response, it put me on the right track. However after the wget, you must still copy the CentOS-RT.repo file into your /etc/yum.repos.d/ directory, and also copy the GPG contents from linuxsoft.cern.ch/cern/slc5X/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern into a file on your machine called /etc/pki/rpm-gpg/RPM-GPG-KEY-cern – Paulus Jul 16 '18 at 12:29
3

You need to first add the CentOS real time repo:

sudo tee /etc/yum.repos.d/CentOS-rt.repo >/dev/null <<EOF
# CentOS-rt.repo

[rt]
name=CentOS-7 - rt
baseurl=http://mirror.centos.org/centos/\$releasever/rt/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
EOF

Then install the rt-kernel and tuned profile:

sudo yum update -y
sudo yum install -y kernel-rt rt-tests tuned-profiles-realtime
sudo reboot

Note, though, that a real time kernel alone does not automatically give you optimal real time behavior. There are many knobs that would need tuning to achieve that, from BIOS level (e.g. disabling CPU power save, some SMI interrupts, etc.) to system level (CPU partitioning, IRQ balancing, etc.) to application level.

You can find some useful tuning tips in the Advanced Tuning for RHEL for Real Time doc.

1

There can be more than one solution when talking about real time linux kernel. If yiu read about the RT patch, the you should look here:

https://rt.wiki.kernel.org/index.php/Main_Page

Rami Rosen

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.