TLBi Optimization
Overview
This feature disables the global broadcast of TLBi instructions on the host OS and limits the TLB flush scope in the guest OS to the CPUs that have executed the VM process, thereby narrowing the TLB broadcast scope. In many-core multi-VM scenarios, this reduces the TLB flush overhead and effectively improves the linearity of the unixbench score.
Constraints
- This feature applies only to ARM64.
- To enable this feature, add the following kernel compilation parameters:
CONFIG_ARM64_TLBI_IPIandCONFIG_ARM64_KVM_HCR_NOFB. - To enable this feature, the boot parameter
kvm-arm.hcr_nofb=1is required.
Usage
Compiling and Replacing the Kernel
In the kernel root directory, run
make openeuler_defconfigto generate the.configfile.Run
make menuconfigto specify kernel compilation parameters. EnableCONFIG_ARM64_TLBI_IPIandCONFIG_ARM64_KVM_HCR_NOFB, and then check the corresponding configuration items in the.configfile to ensure that the settings take effect.Compile the RPM package:
make binrpm-pkg -j. The generated RPM package is stored in therpmbuild/RPMS/aarch64directory.In the directory where the RPM package is stored, run
rpm -ivh --force kernel*.rpmto install the new kernel.Run the
grub2-set-defaultcommand to set the default boot kernel. The following uses the 24.03 LTS-SP1 version as an example:shell# Query the default boot kernel currently set. [root@localhost ~]# grub2-editenv list saved_entry=openEuler (6.12.0) 24.03 (LTS-SP1) # Query all kernel versions currently installed. [root@localhost ~]# grep "^menuentry" /etc/grub2-efi.cfg menuentry 'openEuler (6.12.0) 24.03 (LTS-SP1)' --class openeuler --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.12.0-advanced-887bd997-932e-4cd0-84e3-ec71abbe368b' { menuentry 'openEuler (6.6.0-77.0.0.81.oe2403sp1.aarch64) 24.03 (LTS-SP1)' --class openeuler --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.6.0-77.0.0.81.oe2403sp1.aarch64-advanced-887bd997-932e-4cd0-84e3-ec71abbe368b' { # Set the default boot kernel to 'openEuler (6.6.0-77.0.0.81.oe2403sp1.aarch64) 24.03 (LTS-SP1)'. [root@localhost ~]# grub2-set-default 'openEuler (6.6.0-77.0.0.81.oe2403sp1.aarch64) 24.03 (LTS-SP1)' # Query the default boot kernel currently set again. [root@localhost ~]# grub2-editenv list saved_entry=openEuler (6.6.0-77.0.0.81.oe2403sp1.aarch64) 24.03 (LTS-SP1)
Setting Kernel Boot Parameters
Edit the
/etc/default/grubfile and addkvm-arm.hcr_nofb=1toGRUB_CMDLINE_LINUX.View the modification result. An example is as follows:
shell[root@localhost ~]# cat /etc/default/grub | grep GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX="rd.lvm.lv=openeuler/root rd.lvm.lv=openeuler/swap video=VGA-1:640x480-32@60me cgroup_disable=files apparmor=0 crashkernel=1024M,high smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15 arm64.nopauth console=tty0 kvm-arm.hcr_nofb=1"Run the
grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfgcommand to update the grub configuration file.
Restarting the Host and Checking the Parameter Settings
- Restart the host.
- Run the
zcat /proc/config.gz | grep CONFIG_ARM64_TLBI_IPIcommand and confirm that the output isCONFIG_ARM64_TLBI_IPI=y. - Run the
zcat /proc/config.gz | grep CONFIG_ARM64_KVM_HCR_NOFBcommand and confirm that the output isCONFIG_ARM64_KVM_HCR_NOFB=y. - Run the
cat /proc/cmdlinecommand and ensure that the output containskvm-arm.hcr_nofb=1.
版权所有 © 2026 openEuler 保留一切权利
京ICP备2020036654号-1
京公网安备 11030102011597 号