[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 0/7] Add memfd memory backend
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v7 0/7] Add memfd memory backend |
Date: |
Thu, 1 Feb 2018 14:27:50 +0100 |
Hi,
This series adds a new memory backend, similar to hostmem-file, except
that it doesn't need to create files. It also enforces memory sealing.
This backend is mainly useful for sharing the memory with other
processes.
Note that Linux supports transparent huge-pages of shmem/memfd memory
since 4.8. It is relatively easier to set up THP than a dedicate
hugepage mount point by using "madvise" in
/sys/kernel/mm/transparent_hugepage/shmem_enabled.
Since 4.14, memfd allows to set hugetlb requirement explicitly.
Pending for merge in 4.16 is memfd sealing support for hugetlb backed
memory.
Usage:
-object memory-backend-memfd,id=mem1,size=1G
v7:
- fix a small memory leak
- update documentation and commit messages
- rebased
v6:
- add hugetlbsize option
- run vhost-user read-guest-mem test with memfile & memfd backend
v5:
- add memfd hugetlb support
- add seal and hugeltb options to memfd memory backend
- update qemu-option to explain sharing works with vhost-user for now
- rebased, misc code changes
v4:
- rebased, now that preliminary patches are merged
v3:
- make vhost-user-test use memfd only if possible
- rebased
v2:
- make it linux-specific
- minor changes and commit message tweaks
Marc-André Lureau (7):
memfd: add error argument, instead of perror()
memfd: add hugetlb support
memfd: add hugetlbsize argument
Add memfd based hostmem
tests: keep compiling failing vhost-user tests
vhost-user-test: make read-guest-mem setup its own qemu
tests: use memfd in vhost-user-test
include/qemu/memfd.h | 5 +-
backends/hostmem-memfd.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++
hw/virtio/vhost.c | 8 ++-
tests/vhost-user-test.c | 128 +++++++++++++++++++++++------------
util/memfd.c | 78 ++++++++++++++--------
backends/Makefile.objs | 2 +
qemu-options.hx | 22 ++++++
7 files changed, 340 insertions(+), 73 deletions(-)
create mode 100644 backends/hostmem-memfd.c
--
2.16.0.rc1.1.gef27df75a1
- [Qemu-devel] [PATCH v7 0/7] Add memfd memory backend,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v7 1/7] memfd: add error argument, instead of perror(), Marc-André Lureau, 2018/02/01
- [Qemu-devel] [PATCH v7 2/7] memfd: add hugetlb support, Marc-André Lureau, 2018/02/01
- [Qemu-devel] [PATCH v7 3/7] memfd: add hugetlbsize argument, Marc-André Lureau, 2018/02/01
- [Qemu-devel] [PATCH v7 4/7] Add memfd based hostmem, Marc-André Lureau, 2018/02/01
- [Qemu-devel] [PATCH v7 6/7] vhost-user-test: make read-guest-mem setup its own qemu, Marc-André Lureau, 2018/02/01
- [Qemu-devel] [PATCH v7 5/7] tests: keep compiling failing vhost-user tests, Marc-André Lureau, 2018/02/01
- [Qemu-devel] [PATCH v7 7/7] tests: use memfd in vhost-user-test, Marc-André Lureau, 2018/02/01