Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/kvm: Don't waste memory if kvmclock is disabled

Even if "no-kvmclock" is passed in cmdline parameter, the guest kernel
still allocates hvclock_mem which is scaled by the number of vCPUs,
let's check kvmclock enable in advance to avoid this memory waste.

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1645520523-30814-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Wanpeng Li and committed by
Paolo Bonzini
3c51d0a6 40cd58db

+3
+3
arch/x86/kernel/kvmclock.c
··· 239 239 240 240 static int __init kvm_setup_vsyscall_timeinfo(void) 241 241 { 242 + if (!kvmclock) 243 + return 0; 244 + 242 245 kvmclock_init_mem(); 243 246 244 247 #ifdef CONFIG_X86_64