From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH rebased for-1.8] i386: pc: align gpa<->hpa on 1GB boundary (v6)
Date: Wed, 11 Dec 2013 15:26:20 -0200 [thread overview]
Message-ID: <20131211172620.GA24741@amt.cnet> (raw)
In-Reply-To: <52A87A89.4000901@redhat.com>
On Wed, Dec 11, 2013 at 03:45:29PM +0100, Paolo Bonzini wrote:
> Il 11/12/2013 15:20, Michael S. Tsirkin ha scritto:
> > > It means that its necessary to expose that 3-4GB physical memory region
> > > in QEMU belongs to the same node (that is, guest must be aware that
> > > 3-3.75GB and the tail of RAM are on the same node).
> > >
> > > So the problem Paolo mentions is fixable.
>
> I'm not sure if it is fixable. You need a 2M mountpoint to bind the 3G-4G
> range correctly, a 1G mountpoint for everything else, and QEMU only allows
> to specify one path.
>
> Without Marcelo's patch there is a workaround; if you know the size of the 4G
> hole and configure the first two nodes with unequal sizes. For example
>
> -m 8192 \
> -object memory-ram,id=ram-node0,size=3840M,hostnode=0 -numa node,memdev=ram-node0 \
> -object memory-ram,id=ram-node1,size=4352M,hostnode=1 -numa node,memdev=ram-node1
>
> RAM address Host virtual address low bits Guest physical addresses
> 0M-3840M 0 0M-3840M
> 3840M-8192M 0 4096M-8448M
>
> Then you'll waste 1GB of RAM (you'll use 9 hugepages instead of 8), but
> everything will be aligned. Or you just make your guest 7680M and not waste
> the memory.
>
> But with Marcelo's patch, ram-node1 will be split in two. QEMU will try
> to realign the second part of ram-node1, but the result is that the second
> part is misaligned and only the first 256M (the tail of guest physical
> memory) stays aligned:
>
> RAM address Host virtual address low bits Guest physical addresses
> 0M-3840M 0 0M-3840M
> 4096M-8192M 256M 4096M-8192M
> 3840M-4096M 0 8192M-8448M
>
> So you still waste memory, _and_ get incorrect alignment.
You are adding a new aspect to the problem (that host memory is created
as separate devices). $subject alignment code aligns on top of one
hosts virtually contiguous address range.
As mentioned in the earlier thread with Igor, this is fixable as long
as two memory devices map to a single host virtually contiguous range.
But if you think that aligning to 1GB guest hole alignment, don't have
a problem with that.
For the NUMA problem, as long as its possible to specify multiple
physical address ranges for a single node (which is true), the problem
you raise is fixable. All is necessary is to expose to the guest
which non physically contiguous 1GB ranges ("representing" 1GB pages in
the host), reside in what node.
> > Okay so
> > Marcelo - do you ack this patch for 2.0?
> > Paolo - do you re-ack this patch for 2.0?
>
> I very much prefer Gerd's approach. 2GB low memory for q35 is a bit wasteful,
> but we have some time to fix that before release.
>
> Paolo
OK.
next prev parent reply other threads:[~2013-12-11 17:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 17:43 [Qemu-devel] [PATCH rebased for-1.8] i386: pc: align gpa<->hpa on 1GB boundary (v6) Paolo Bonzini
2013-11-25 20:58 ` Laszlo Ersek
2013-11-25 21:05 ` Michael S. Tsirkin
2013-11-25 23:09 ` Marcelo Tosatti
2013-11-26 9:04 ` Paolo Bonzini
2013-11-28 10:26 ` Michael S. Tsirkin
2013-12-10 13:18 ` Paolo Bonzini
2013-12-10 14:53 ` Gerd Hoffmann
2013-12-10 14:58 ` Paolo Bonzini
2013-12-10 15:36 ` Gerd Hoffmann
2013-12-10 15:47 ` Laszlo Ersek
2013-12-10 15:53 ` Gerd Hoffmann
2013-12-10 17:46 ` Laszlo Ersek
2013-12-10 17:48 ` Paolo Bonzini
2013-12-10 21:00 ` Michael S. Tsirkin
2013-12-10 22:13 ` Laszlo Ersek
2013-12-10 22:15 ` Laszlo Ersek
2013-12-10 23:17 ` Michael S. Tsirkin
2013-12-11 8:00 ` Gerd Hoffmann
2013-12-10 15:05 ` Marcelo Tosatti
2013-12-10 17:21 ` Marcelo Tosatti
2013-12-10 21:02 ` Michael S. Tsirkin
2013-12-11 13:41 ` Marcelo Tosatti
2013-12-11 14:20 ` Michael S. Tsirkin
2013-12-11 14:45 ` Paolo Bonzini
2013-12-11 15:39 ` Michael S. Tsirkin
2013-12-11 15:41 ` Paolo Bonzini
2013-12-11 15:51 ` Michael S. Tsirkin
2013-12-11 15:45 ` Igor Mammedov
2013-12-11 15:56 ` Paolo Bonzini
2013-12-11 17:26 ` Marcelo Tosatti [this message]
2013-12-10 16:52 ` Michael S. Tsirkin
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=20131211172620.GA24741@amt.cnet \
--to=mtosatti@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).