qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Peter Huang(Peng)" <peter.huangpeng@huawei.com>
To: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: aliguori@us.ibm.com, ehabkost@redhat.com, qemu-devel@nongnu.org,
	lcapitulino@redhat.com, bsd@redhat.com, pbonzini@redhat.com,
	y-goto@jp.fujitsu.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH V4 00/10] Add support for binding guest numa nodes to host numa nodes
Date: Thu, 11 Jul 2013 18:32:48 +0800	[thread overview]
Message-ID: <51DE89D0.9030701@huawei.com> (raw)
In-Reply-To: <1372931597-28115-1-git-send-email-gaowanlong@cn.fujitsu.com>

Hi,Wanlong

>From the patch discription below,  seems that qemu numa only support cpu/memory node binding.
As we know, binding is not the common usage due to VM migration may happen or the load balance
would be disabled.
So, do we have any plan of generating virtual numa automatically?

For example, if we create a 16vCPU VM on a 4 8-core node physical box, we can automatically place
it to two physical node, not by binding.

On 2013-07-04 17:53, Wanlong Gao wrote:
> 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,mem-policy=membind,mem-hostnode=0-1
>  -numa node,nodeid=1,mem=1024,cpus=1,mem-policy=interleave,mem-hostnode=1
>
> This supports "mem-policy={membind|interleave|preferred},mem-hostnode=[+|!]{all|N-N}" like format.
>
> And patch 8/10 adds a QMP command "set-mpol" to set the memory policy for every
> guest nodes:
>     set-mpol nodeid=0 mem-policy=membind mem-hostnode=0-1
>
> And patch 9/10 adds a monitor command "set-mpol" whose format like:
>     set-mpol 0 mem-policy=membind,mem-hostnode=0-1
>
> And with patch 10/10, 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
>
>
> V1->V2:
>     change to use QemuOpts in numa options (Paolo)
>     handle Error in mpol parser (Paolo)
>     change qmp command format to mem-policy=membind,mem-hostnode=0-1 like (Paolo)
> V2->V3:
>     also handle Error in cpus parser (5/10)
>     split out common parser from cpus and hostnode parser (Bandan 6/10)
> V3-V4:
>     rebase to request for comments
>
>
> Bandan Das (1):
>   NUMA: Support multiple CPU ranges on -numa option
>
> Wanlong Gao (9):
>   NUMA: Add numa_info structure to contain numa nodes info
>   NUMA: Add Linux libnuma detection
>   NUMA: parse guest numa nodes memory policy
>   NUMA: handle Error in cpus, mpol and hostnode parser
>   NUMA: split out the common range parser
>   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                  | 143 +++++++++++++++++++++++-
>  hmp-commands.hx         |  16 +++
>  hmp.c                   |  35 ++++++
>  hmp.h                   |   1 +
>  hw/i386/pc.c            |   4 +-
>  hw/net/eepro100.c       |   1 -
>  include/sysemu/sysemu.h |  20 +++-
>  monitor.c               |  44 +++++++-
>  qapi-schema.json        |  15 +++
>  qemu-options.hx         |   3 +-
>  qmp-commands.hx         |  35 ++++++
>  vl.c                    | 285 +++++++++++++++++++++++++++++++++++-------------
>  13 files changed, 553 insertions(+), 81 deletions(-)
>

  parent reply	other threads:[~2013-07-11 10:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04  9:53 [Qemu-devel] [PATCH V4 00/10] Add support for binding guest numa nodes to host numa nodes Wanlong Gao
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 01/10] NUMA: Support multiple CPU ranges on -numa option Wanlong Gao
2013-07-05 18:41   ` Eduardo Habkost
2013-07-08 19:02     ` Eric Blake
2013-07-08 19:25       ` Eduardo Habkost
2013-07-08 19:25       ` Anthony Liguori
2013-07-09  3:28         ` Wanlong Gao
2013-07-09  3:34           ` Eric Blake
2013-07-14 11:34       ` Paolo Bonzini
2013-07-15 21:33         ` Eric Blake
2013-07-16  6:24           ` Paolo Bonzini
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 02/10] NUMA: Add numa_info structure to contain numa nodes info Wanlong Gao
2013-07-05 19:32   ` Eduardo Habkost
2013-07-05 20:09     ` Andreas Färber
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 03/10] NUMA: Add Linux libnuma detection Wanlong Gao
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 04/10] NUMA: parse guest numa nodes memory policy Wanlong Gao
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 05/10] NUMA: handle Error in cpus, mpol and hostnode parser Wanlong Gao
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 06/10] NUMA: split out the common range parser Wanlong Gao
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 07/10] NUMA: set guest numa nodes memory policy Wanlong Gao
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 08/10] NUMA: add qmp command set-mpol to set memory policy for NUMA node Wanlong Gao
2013-07-08 18:25   ` Luiz Capitulino
2013-07-08 18:34     ` Luiz Capitulino
2013-07-08 18:50       ` Andreas Färber
2013-07-08 19:03         ` Luiz Capitulino
2013-07-15 11:18     ` Wanlong Gao
2013-07-08 19:16   ` Eric Blake
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 09/10] NUMA: add hmp command set-mpol Wanlong Gao
2013-07-08 18:32   ` Luiz Capitulino
2013-07-04  9:53 ` [Qemu-devel] [PATCH V4 10/10] NUMA: show host memory policy info in info numa command Wanlong Gao
2013-07-05 18:49   ` Eduardo Habkost
2013-07-08 18:36   ` Luiz Capitulino
2013-07-04 19:49 ` [Qemu-devel] [PATCH V4 00/10] Add support for binding guest numa nodes to host numa nodes Paolo Bonzini
2013-07-04 21:15   ` Laszlo Ersek
2013-07-05  0:55     ` Wanlong Gao
2013-07-05  0:54   ` Wanlong Gao
2013-07-05 19:18 ` Eduardo Habkost
2013-07-11 10:32 ` Peter Huang(Peng) [this message]
2013-07-11 13:10   ` Eduardo Habkost

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=51DE89D0.9030701@huawei.com \
    --to=peter.huangpeng@huawei.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=bsd@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=lcapitulino@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).