Changing the Kernel Page Size to 64 KB
Purpose
Change the page size of the openEuler OS kernel to 64 KB. A larger kernel page size indicates more memory managed by each line in translation lookaside buffer (TLB) and a higher TLB hit rate, thereby reducing memory accesses and improving performance.
Changing the page size of the OS kernel to 64 KB may cause compatibility issues. Some software needs to be adapted when the page size is set to 64 KB. Therefore, before using this performance tuning method, perform a comprehensive test to ensure system stability and software compatibility.
Procedure
- Install the kernel source package of openEuler.
yum install -y kernel-source
- Set the kernel page size to 64 KB.
- Go to the kernel source code directory and configure kernel options.
cd /usr/src/linux-5.10.0*** make openeuler_defconfig make menuconfig
Replace linux-5.10.0*** with the actual kernel version number.
- On the menuconfig page, go to General setup.
- Choose Local version > append to kernel release and enter a proper suffix, for example, -64k, to identify the kernel version that needs to be configured. Select ok and press enter.
- Double-click Esc to return to the upper-level directory.
- Choose Kernel Features > Page size > 64KB.
- Double-click Esc to return to the upper-level directory. When prompted, double-click Esc to save the modifications and exit the menuconfig page.
- Go to the kernel source code directory and configure kernel options.
- Compile the kernel and generate an RPM package.
make binrpm-pkg -j$(nproc)
- Install a new kernel whose page size is 64 KB.For the Arm architecture, the RPM package is usually built in the /root/rpmbuild/RPMS/aarch64/ directory.
rpm -ivh kernel*** --force
After the installation is complete, the GRUB configuration is automatically updated and the new kernel is added to the boot menu.
- Restart the OS and select the new kernel.
- Recompile Redis.
Redis references jemalloc. Therefore, recompiling Redis is required to ensure that Redis can work properly after the OS kernel is modified.
