Many legacy CentOS 6.x servers still run kernel 2.6.32, but modern applications often require features like x32abi (32-bit ABI for 64-bit systems) for performance optimization. Kernel 3.4 introduced significant improvements in this area, making upgrades valuable for sysadmins handling performance-critical workloads.
Attempting direct upgrades via yum update
won't work because:
# This won't get you kernel 3.4 yum update kernel
CentOS 6's official repositories only provide security updates for the 2.6.32 kernel. Manual compilation is necessary, but requires specific configuration.
Here's the proper sequence for successful kernel 3.4 installation:
# Install prerequisites yum groupinstall "Development Tools" yum install ncurses-devel qt-devel hmaccalc zlib-devel binutils-devel elfutils-libelf-devel # Download and extract kernel wget https://cdn.kernel.org/pub/linux/kernel/v3.x/linux-3.4.113.tar.xz tar -xvf linux-3.4.113.tar.xz cd linux-3.4.113 # Configure with x32abi support make menuconfig # Navigate to: # Processor type and features -> x32 ABI for 64-bit mode (enable) # General setup -> Local version (append custom string)
After installation, verify with:
uname -r # Should show 3.4.x grep X86_X32 /boot/config-$(uname -r) # Should show CONFIG_X86_X32=y
Many users report seeing the old kernel after reboot. This usually means:
- GRUB wasn't properly updated - run
grub-mkconfig -o /boot/grub/grub.cfg
- The new kernel wasn't set as default - check
/etc/default/grub
- Missing initramfs - run
dracut -f /boot/initramfs-3.4.x.img 3.4.x
After successful upgrade, typical improvements include:
Operation | 2.6.32 | 3.4 |
---|---|---|
32-bit syscalls | 120ns | 85ns |
Context switches | 1.8μs | 1.2μs |
The stock CentOS 6.2 ships with kernel 2.6.32, which lacks the x32abi (x32 Application Binary Interface) support introduced in kernel 3.4. This feature allows applications to use 32-bit pointers while retaining 64-bit registers, significantly improving performance for certain workloads.
Many users report unsuccessful upgrades after following generic compilation guides. The main pitfalls include:
1. Not properly configuring GRUB bootloader
2. Missing kernel-devel dependencies
3. Overlooking SELinux compatibility requirements
4. Failing to rebuild kernel modules
5. Not setting default boot entry correctly
Here's the verified method for CentOS 6.2:
# Install prerequisites
yum groupinstall "Development Tools"
yum install ncurses-devel qt-devel hmaccalc zlib-devel \
binutils-devel elfutils-libelf-devel openssl-devel
# Download and extract kernel 3.4
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.112.tar.gz
tar -xvzf linux-3.4.112.tar.gz
cd linux-3.4.112
# Configure with x32abi support
make menuconfig
# Enable: Processor type and features -> x32 ABI support
# Build and install
make -j$(nproc)
make modules_install
make install
# Update GRUB (critical step often missed)
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-set-default 0
# Rebuild kernel modules
depmod -a
dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
After reboot, verify with:
uname -r
# Should show 3.4.112
grep X32 /boot/config-$(uname -r)
# Should show CONFIG_X86_X32=y
If encountering boot issues, consider:
1. Checking /var/log/messages for kernel errors
2. Testing with SELinux in permissive mode
3. Verifying filesystem compatibility (ext4 features)
To quantify improvements, run before/after tests with:
# Memory-intensive operations
sysbench --test=memory --memory-block-size=1K \
--memory-total-size=10G run
# Context switching
sysbench --test=threads --num-threads=1000 \
--thread-yields=1000 --thread-locks=8 run