[lxc-devel] [lxd/master] lxd/qemu: Properly connect memory

stgraber on Github lxc-bot at linuxcontainers.org
Fri Jul 10 17:07:55 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 492 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200710/73567a6d/attachment.bin>
-------------- next part --------------
From 73cf0221bb89e21b3f0276e9c495086b8b786fab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 10 Jul 2020 13:06:43 -0400
Subject: [PATCH] lxd/qemu: Properly connect memory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Without this, a VM that would use hugepages without an optimized CPU
pinning would end up consuming both hugepages and normal memory.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/instance/drivers/driver_qemu_templates.go | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lxd/instance/drivers/driver_qemu_templates.go b/lxd/instance/drivers/driver_qemu_templates.go
index f4789ae3c2..c110c66dab 100644
--- a/lxd/instance/drivers/driver_qemu_templates.go
+++ b/lxd/instance/drivers/driver_qemu_templates.go
@@ -242,6 +242,11 @@ qom-type = "memory-backend-ram"
 size = "{{$memory}}M"
 host-nodes = "{{$element}}"
 policy = "bind"
+
+[numa]
+type = "node"
+nodeid = "{{$element}}"
+memdev = "mem{{$element}}"
 {{end}}
 {{else}}
 [object "mem0"]
@@ -254,13 +259,11 @@ discard-data = "on"
 qom-type = "memory-backend-ram"
 {{- end }}
 size = "{{$memory}}M"
-{{end}}
 
-{{range $index, $element := .cpuNumaNodes}}
 [numa]
 type = "node"
-nodeid = "{{$element}}"
-memdev = "mem{{$element}}"
+nodeid = "0"
+memdev = "mem0"
 {{end}}
 
 {{range .cpuNumaMapping}}


More information about the lxc-devel mailing list