[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC 0/4] option to not remove files inside -mem-path

From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH RFC 0/4] option to not remove files inside -mem-path dir
Date: Tue, 26 Jun 2012 17:51:05 -0300

I was investigating if there are any mechanisms that allow manually pinning of
guest RAM to specific host NUMA nodes, in the case of multi-node KVM guests, and
noticed that -mem-path could be used for that, except that it currently removes
any files it creates (using mkstemp()) immediately, not allowing numactl to be
used on the backing files, as a result. This patches add a -keep-mem-path-files
option to make QEMU create the files inside -mem-path with more predictable
names, and not remove them after creation.

Some previous discussions about the subject, for reference:
 - Message-ID: <address@hidden>
 - Message-ID: <address@hidden>

A more recent thread can be found at:
 - Message-ID: <address@hidden>

Note that this is just a mechanism to facilitate manual static binding using
numactl on hugetlbfs later, for optimization. This may be especially useful for
single large multi-node guests use-cases (and, of course, has to be used with

I don't know if it is a good idea to use the memory range names as a publicly-
visible interface. Another option may be to use a single file instead, and mmap
different regions inside the same file for each memory region. I an open to
comments and suggestions.

Example (untested) usage to bind manually each half of the RAM of a guest to a
different NUMA node:

 $ qemu-system-x86_64 [...] -m 2048 -smp 4 \
   -numa node,cpus=0-1,mem=1024 -numa node,cpus=2-3,mem=1024 \
   -mem-prealloc -keep-mem-path-files -mem-path /mnt/hugetlbfs/FOO
 $ numactl --offset=1G --length=1G --membind=1 --file /mnt/hugetlbfs/FOO/pc.ram
 $ numactl --offset=0  --length=1G --membind=2 --file /mnt/hugetlbfs/FOO/pc.ram

Eduardo Habkost (4):
  vl.c: change mem_prealloc to bool
  file_ram_alloc: change length argument to size_t
  file_ram_alloc(): extract temporary-file creation code to separate
  add -keep-mem-path-files option

 cpu-all.h       |    3 ++-
 exec.c          |   72 ++++++++++++++++++++++++++++++++++++++++++-------------
 qemu-options.hx |   12 ++++++++++
 vl.c            |    9 +++++--
 4 files changed, 77 insertions(+), 19 deletions(-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]