From 68cc0e3f461454656a2ab6230c1477a5913c614e Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Sun, 3 Dec 2023 13:41:34 +0200 Subject: [PATCH] Revert "Checkup, vmi spec: Don't use host huge pages" This reverts commit a7303e0b7866d0dc701e7adf23eaa4bc0dda6f0d. Signed-off-by: Ram Lavi --- pkg/internal/checkup/checkup.go | 3 ++- pkg/internal/checkup/vmi/vmi.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/internal/checkup/checkup.go b/pkg/internal/checkup/checkup.go index 01bb52f3..c4d38bdd 100644 --- a/pkg/internal/checkup/checkup.go +++ b/pkg/internal/checkup/checkup.go @@ -171,6 +171,7 @@ func newRealtimeVMI(checkupConfig config.Config) *kvcorev1.VirtualMachineInstanc CPUSocketsCount = 1 CPUCoresCount = 3 CPUTreadsCount = 1 + hugePageSize = "1Gi" guestMemory = "4Gi" rootDiskName = "rootdisk" cloudInitDiskName = "cloudinitdisk" @@ -186,7 +187,7 @@ user: user` vmi.WithoutCRIOCPUQuota(), vmi.WithoutCRIOIRQLoadBalancing(), vmi.WithRealtimeCPU(CPUSocketsCount, CPUCoresCount, CPUTreadsCount), - vmi.WithMemory(guestMemory), + vmi.WithMemory(hugePageSize, guestMemory), vmi.WithoutAutoAttachGraphicsDevice(), vmi.WithoutAutoAttachMemBalloon(), vmi.WithAutoAttachSerialConsole(), diff --git a/pkg/internal/checkup/vmi/vmi.go b/pkg/internal/checkup/vmi/vmi.go index f0b2541a..dacc35c4 100644 --- a/pkg/internal/checkup/vmi/vmi.go +++ b/pkg/internal/checkup/vmi/vmi.go @@ -159,11 +159,12 @@ func WithVirtIODisk(name string) Option { } } -func WithMemory(guestMemory string) Option { +func WithMemory(hugePageSize, guestMemory string) Option { return func(vmi *kvcorev1.VirtualMachineInstance) { guestMemoryQuantity := resource.MustParse(guestMemory) vmi.Spec.Domain.Memory = &kvcorev1.Memory{ - Guest: &guestMemoryQuantity, + Hugepages: &kvcorev1.Hugepages{PageSize: hugePageSize}, + Guest: &guestMemoryQuantity, } } }