From: Andrea Arcangeli <aarcange@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH QEMU] transparent hugepage support
Date: Sat, 13 Mar 2010 18:47:46 +0100 [thread overview]
Message-ID: <20100313174746.GG5677@random.random> (raw)
In-Reply-To: <4B9B4CB0.7080200@redhat.com>
On Sat, Mar 13, 2010 at 10:28:32AM +0200, Avi Kivity wrote:
> On 03/11/2010 06:05 PM, Andrea Arcangeli wrote:
> > On Thu, Mar 11, 2010 at 05:52:16PM +0200, Avi Kivity wrote:
> >
> >> That is a little wasteful. How about a hint to mmap() requesting proper
> >> alignment (MAP_HPAGE_ALIGN)?
> >>
> > So you suggest adding a new kernel feature to mmap? Not sure if it's
> > worth it, considering it'd also increase the number of vmas because it
> > will have to leave an hole. Wasting 2M-4k of virtual memory is likely
> > cheaper than having 1 more vma in the rbtree for every page fault. So
> > I think it's better to just malloc and adjust ourselfs on the next
> > offset which is done in userland by qemu_memalign I think.
> >
> >
>
> Won't we get a new vma anyway due to the madvise() call later?
As long as MADV_HUGEPAGE is set in all, it will merge the vmas
together.
So if we do stuff like "alloc from 0 to 4G-4k" and then alloc "4G to
8G" this will avoid a vma split. (initially the mmap will create a
vma, but it'll be immediately removed from madvise with vma_merge)
> But I agree it isn't worth it.
2 vma or 1 vma isn't measurable of course, but yes the point is that
it's not worth it because doing it in userland is theoretically better
too for performance.
next prev parent reply other threads:[~2010-03-13 17:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 15:14 [Qemu-devel] [PATCH QEMU] transparent hugepage support Andrea Arcangeli
2010-03-11 15:52 ` Avi Kivity
2010-03-11 16:05 ` Andrea Arcangeli
2010-03-13 8:28 ` Avi Kivity
2010-03-13 17:47 ` Andrea Arcangeli [this message]
2010-03-11 16:28 ` Paul Brook
2010-03-11 16:46 ` Andrea Arcangeli
2010-03-11 17:55 ` Paul Brook
2010-03-11 18:49 ` Andrea Arcangeli
2010-03-12 11:36 ` Paul Brook
2010-03-12 14:52 ` Andrea Arcangeli
2010-03-12 16:04 ` Paul Brook
2010-03-12 16:17 ` Andrea Arcangeli
2010-03-12 16:24 ` Paul Brook
2010-03-12 16:57 ` Andrea Arcangeli
2010-03-12 17:10 ` Paul Brook
2010-03-12 17:41 ` Andrea Arcangeli
2010-03-12 18:17 ` Paul Brook
2010-03-12 18:36 ` Andrea Arcangeli
2010-03-12 18:41 ` Paul Brook
2010-03-12 18:51 ` Andrea Arcangeli
2010-03-12 22:40 ` Jamie Lokier
2010-03-12 16:10 ` Paul Brook
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=20100313174746.GG5677@random.random \
--to=aarcange@redhat.com \
--cc=avi@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).