From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuuIV-0007ES-0n for qemu-devel@nongnu.org; Thu, 04 Jul 2013 20:54:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuuIU-000251-23 for qemu-devel@nongnu.org; Thu, 04 Jul 2013 20:54:50 -0400 Received: from [222.73.24.84] (port=43801 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuuIT-00024p-O4 for qemu-devel@nongnu.org; Thu, 04 Jul 2013 20:54:50 -0400 Message-ID: <51D6196E.9090908@cn.fujitsu.com> Date: Fri, 05 Jul 2013 08:55:10 +0800 From: Wanlong Gao MIME-Version: 1.0 References: <1372931597-28115-1-git-send-email-gaowanlong@cn.fujitsu.com> <51D5D1DF.4060003@redhat.com> <51D5E5EE.2090403@redhat.com> In-Reply-To: <51D5E5EE.2090403@redhat.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH V4 00/10] Add support for binding guest numa nodes to host numa nodes Reply-To: gaowanlong@cn.fujitsu.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: aliguori@us.ibm.com, ehabkost@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, bsd@redhat.com, y-goto@jp.fujitsu.com, Paolo Bonzini , afaerber@suse.de, Wanlong Gao On 07/05/2013 05:15 AM, Laszlo Ersek wrote: > On 07/04/13 21:49, Paolo Bonzini wrote: >> Il 04/07/2013 11:53, Wanlong Gao ha scritto: >>> 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 >> >> Did you see my suggestion to use instead something like this: >> >> -numa node,nodeid=0,cpus=0 -numa node,nodeid=1,cpus=1 \ >> -numa mem,nodeid=0,size=1G,policy=membind,hostnode=0-1 >> -numa mem,nodeid=1,size=2G,policy=interleave,hostnode=1 >> >> With an eye to when we'll support memory hotplug, I think it is better. >> It is not hard to implement it using the OptsVisitor; see >> 14aa0c2de045a6c2fcfadf38c04434fd15909455 for an example of a complex >> schema described with OptsVistor. > > See also the commit msg of its grandparent, eb7ee2cb, for general notes. > The containing series is d195325b^..1a0c0958. > > A more recent (and simpler) use is the 8ccbad5c^..0c764a9d sub-series. Thank you for your references Laszlo, it's very helpful. Wanlong Gao > > Thanks for the reference, Paolo. > > Laszlo > >