From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: andre.przywara@amd.com, aliguori@us.ibm.com, ehabkost@redhat.com,
pbonzini@redhat.com, y-goto@jp.fujitsu.com, afaerber@suse.de,
gaowanlong@cn.fujitsu.com
Subject: [Qemu-devel] [PATCH 0/7] Add support for binding guest numa nodes to host numa nodes
Date: Tue, 18 Jun 2013 16:09:44 +0800 [thread overview]
Message-ID: <1371542991-15911-1-git-send-email-gaowanlong@cn.fujitsu.com> (raw)
As you know, QEMU can't direct it's memory allocation now, this may cause
guest cross node access performance regression.
And, the worse thing is that if PCI-passthrough is used,
direct-attached-device uses DMA transfer between device and qemu process.
All pages of the guest will be pinned by get_user_pages().
KVM_ASSIGN_PCI_DEVICE ioctl
kvm_vm_ioctl_assign_device()
=>kvm_assign_device()
=> kvm_iommu_map_memslots()
=> kvm_iommu_map_pages()
=> kvm_pin_pages()
So, with direct-attached-device, all guest page's page count will be +1 and
any page migration will not work. AutoNUMA won't too.
So, we should set the guest nodes memory allocation policy before
the pages are really mapped.
According to this patch set, we are able to set guest nodes memory policy
like following:
-numa node,nodeid=0,mem=1024,cpus=0,membind=0-1
-numa node,nodeid=1,mem=1024,cpus=1,interleave=1
This supports "{membind|interleave|preferred}=[+|!]{all|N-N}" like format.
And patch 5/7 adds a QMP command "set-mpol" to set the memory policy for every
guest nodes:
set-mpol nodeid=0 mpol=membind nodemask=0-1
And patch 6/7 adds a monitor command "set-mpol" which like above.
And with patch 7/7, we can get the current memory policy of each guest node
using monitor command "info numa", for example:
(qemu) info numa
2 nodes
node 0 cpus: 0
node 0 size: 1024 MB
node 0 mempolicy: membind=0,1
node 1 cpus: 1
node 1 size: 1024 MB
node 1 mempolicy: interleave=1
Wanlong Gao (7):
Add numa_info structure to contain numa nodes info
Add Linux libnuma detection
NUMA: parse guest numa nodes memory policy
NUMA: set guest numa nodes memory policy
NUMA: add qmp command set-mpol to set memory policy for NUMA node
NUMA: add hmp command set-mpol
NUMA: show host memory policy info in info numa command
configure | 32 +++++++++++
cpus.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++-
hmp-commands.hx | 16 ++++++
hmp.c | 22 +++++++
hmp.h | 1 +
hw/i386/pc.c | 4 +-
include/sysemu/sysemu.h | 17 +++++-
monitor.c | 44 +++++++++++++-
qapi-schema.json | 13 +++++
qmp-commands.hx | 35 ++++++++++++
vl.c | 102 ++++++++++++++++++++++++++++-----
11 files changed, 416 insertions(+), 19 deletions(-)
--
1.8.3.rc2.10.g0c2b1cf
next reply other threads:[~2013-06-18 8:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 8:09 Wanlong Gao [this message]
2013-06-18 8:09 ` [Qemu-devel] [PATCH 1/7] Add numa_info structure to contain numa nodes info Wanlong Gao
2013-06-18 8:09 ` [Qemu-devel] [PATCH 2/7] Add Linux libnuma detection Wanlong Gao
2013-06-18 8:09 ` [Qemu-devel] [PATCH 3/7] NUMA: parse guest numa nodes memory policy Wanlong Gao
2013-06-18 9:20 ` Paolo Bonzini
2013-06-18 9:54 ` Wanlong Gao
2013-06-18 19:00 ` Eduardo Habkost
2013-06-18 20:19 ` Bandan Das
2013-06-19 8:01 ` Wanlong Gao
2013-06-19 17:39 ` Paolo Bonzini
2013-06-20 0:01 ` Wanlong Gao
2013-06-18 8:09 ` [Qemu-devel] [PATCH 4/7] NUMA: set " Wanlong Gao
2013-06-18 8:09 ` [Qemu-devel] [PATCH 5/7] NUMA: add qmp command set-mpol to set memory policy for NUMA node Wanlong Gao
2013-06-18 9:21 ` Paolo Bonzini
2013-06-18 9:44 ` Wanlong Gao
2013-06-18 9:57 ` Paolo Bonzini
2013-06-18 8:09 ` [Qemu-devel] [PATCH 6/7] NUMA: add hmp command set-mpol Wanlong Gao
2013-06-18 9:23 ` Paolo Bonzini
2013-06-18 9:49 ` Wanlong Gao
2013-06-18 8:09 ` [Qemu-devel] [PATCH 7/7] NUMA: show host memory policy info in info numa command Wanlong Gao
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=1371542991-15911-1-git-send-email-gaowanlong@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=andre.przywara@amd.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=y-goto@jp.fujitsu.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;
as well as URLs for NNTP newsgroup(s).