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".
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:
After rebooting, you can then check the kernel version you're running like so:
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:
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.
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: