Linux turn on kernel preemption

Q. I’m using CentOS 4 and I would like to turn on kernel preemption to improve disk and mouse access time on screen. How do I turn on kernel preemption on CentOS Linux?

A. Both Redhat Enterprise Linux and CentOS Linux (RHEL clone) disables the kernel preemption to avoid problem with mission critical servers. Some kernel modules / driver may have problem with kernel preemption.

The only way to turn on this feature is to grab latest source code from and set following option in kernel config file:

Close and save the file. Next start the compilation using makes command.

Task: Using CentOS source RPM

You can also use source rpm. Install the kernel source code rpm using yum command (or up2date command under RHEL). Now type the following commands:

# cd /usr/src/redhat/SPECS
# rpmbuild -bp --target=i686 kernel-2.6.spec
# cd /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9
# make mrproper
# cp configs/kernel-2.6.9-i686-smp.config .config
# vi .config

Note: Change version number as per your running kernel. Set as follows in .config
Now compile kernel:
# make oldconfig
# make dep
# make bzImage
# make modules
# make modules_install
# make install

Now boot into new kernel.
# reboot

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum