我要评分
获取效率
正确性
完整性
易理解

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 entry 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 to function correctly 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

  1. Install the kernel source package and dependencies of openEuler.
    1
    yum install -y kernel-source elfutils elfutils-devel dwarves rsync
    
  2. Set the kernel page size to 64 KB.
    1. Go to the kernel source code directory and configure kernel options.
      1
      2
      3
      cd /usr/src/linux-5.10.0***
      make openeuler_defconfig
      make menuconfig
      

      Replace linux-5.10.0*** with the actual kernel version number.

    2. On the menuconfig page, go to General setup.
    3. 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.
    4. Double-click Esc to return to the upper-level directory.
    5. Choose Kernel Features > Page size > 64KB.
    6. Double-click Esc to return to the upper-level directory. When prompted, double-click Esc to save the modifications and exit the menuconfig page.
  3. Compile the kernel and generate an RPM package.
    1
    make binrpm-pkg -j$(nproc)
    
  4. Install the new kernel with a 64 KB page size.
    For the Arm architecture, the RPM package is usually built in the /root/rpmbuild/RPMS/aarch64/ directory.
    cd /root/rpmbuild/RPMS/aarch64/
    1
    rpm -ivh kernel*** --nodeps --force
    

    Replace kernel*** as needed.

  5. Restart the OS and select the new kernel.
    1. Reboot the OS.
      1
      reboot
      
    2. During the OS restart, log in to the iBMC, access the remote console, and select the new kernel.

    3. Check the current page size.
      1
      getconf PAGESIZE
      

      If "65536" is displayed in the command output, the page size is 64 KB.