public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server] config: schema: add option to disable hugepages
Date: Wed,  8 Jul 2026 13:48:54 +0200	[thread overview]
Message-ID: <20260708114855.363371-1-m.sandoval@proxmox.com> (raw)

Most other options have admit a value for explicitly disabling a feature.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

Notes:
    I 'grep'ed the source and the truthiness of 0 (we do not use
    defined($conf->{hugepages}) anywhere) should keep all existing codepaths as they
    were if the value is not used.
    
    Tested on a PVE VM. Ran:
    
    - qm set 100 --hugepages 0 && qm start 100
    - head /sys/kernel/mm/hugepages/hugepages-*kB/nr_hugepages
    - qm set 100 --hugepages 0 --numa 1 && qm start 100
    - head /sys/kernel/mm/hugepages/hugepages-*kB/nr_hugepages
    
    In both cases the VM stats and no hugepages were used.

 src/PVE/QemuServer.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 59a37098..f8b986f5 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -438,8 +438,8 @@ EODESC
         description =>
             "Enables hugepages memory.\n\nSets the size of hugepages in MiB. If the value "
             . "is set to 'any' then 1 GiB hugepages will be used if possible, "
-            . "otherwise the size will fall back to 2 MiB.",
-        enum => [qw(any 2 1024)],
+            . "otherwise the size will fall back to 2 MiB. When set to 0, hugepages will not be used.",
+        enum => [qw(any 0 2 1024)],
     },
     keephugepages => {
         optional => 1,
-- 
2.47.3





             reply	other threads:[~2026-07-08 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 11:48 Maximiliano Sandoval [this message]
2026-07-08 11:49 ` [PATCH qemu-server] config: schema: add option to disable hugepages Maximiliano Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260708114855.363371-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal