On Thu, Mar 23, 2023, lirongqing@xxxxxxxxx wrote: > From: Li RongQing <lirongqing@xxxxxxxxx> > > if CPU has not X86_BUG_ITLB_MULTIHIT bug, kvm-nx-lpage-re kthread > is not needed to create Unless userspace forces the mitigation to be enabled, which can be done while KVM is running. I agree that spinning up a kthread that is unlikely to be used is less than ideal, but the ~8KiB or so overhead is per-VM and not really all that notable, e.g. KVM's page tables easily exceed that. The kthread could be spun up on demand, but that adds a non-trivial amount of complexity due to the kthread being per-VM, and KVM and userspace would have to deal with potential errors in a path that really shouldn't fail. If we really want to avoid the overhead, one idea would be to add a "never" option to the module param and make it sticky.