[lxc-devel] [lxd/master] lxd/qemu: Fix unbound hugepages
stgraber on Github
lxc-bot at linuxcontainers.org
Fri Jul 10 03:04:27 UTC 2020
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200709/50f10e45/attachment.bin>
-------------- next part --------------
From ded25b35e89968ca7f92bcf2b13b46b44ca6d1bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 9 Jul 2020 23:03:22 -0400
Subject: [PATCH] lxd/qemu: Fix unbound hugepages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/instance/drivers/driver_qemu_templates.go | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lxd/instance/drivers/driver_qemu_templates.go b/lxd/instance/drivers/driver_qemu_templates.go
index 41006e9892..f4789ae3c2 100644
--- a/lxd/instance/drivers/driver_qemu_templates.go
+++ b/lxd/instance/drivers/driver_qemu_templates.go
@@ -228,6 +228,7 @@ threads = "{{.cpuThreads}}"
{{if eq .architecture "x86_64" -}}
{{$memory := .memory -}}
{{$hugepages := .hugepages -}}
+{{if .cpuNumaHostNodes -}}
{{range $index, $element := .cpuNumaHostNodes}}
[object "mem{{$index}}"]
{{if ne $hugepages "" -}}
@@ -242,6 +243,18 @@ size = "{{$memory}}M"
host-nodes = "{{$element}}"
policy = "bind"
{{end}}
+{{else}}
+[object "mem0"]
+{{if ne $hugepages "" -}}
+qom-type = "memory-backend-file"
+mem-path = "{{$hugepages}}"
+prealloc = "on"
+discard-data = "on"
+{{- else}}
+qom-type = "memory-backend-ram"
+{{- end }}
+size = "{{$memory}}M"
+{{end}}
{{range $index, $element := .cpuNumaNodes}}
[numa]
More information about the lxc-devel
mailing list