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".
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityRecently 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".
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.
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:
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