From: Andi Kleen <andi@firstfloor.org>
To: Avi Kivity <avi@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
Andre Przywara <andre.przywara@amd.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH 0/3] KVM-userspace: add NUMA support for guests
Date: Sun, 30 Nov 2008 22:41:11 +0100 [thread overview]
Message-ID: <20081130214111.GA6703@one.firstfloor.org> (raw)
In-Reply-To: <4932F265.8000204@redhat.com>
On Sun, Nov 30, 2008 at 10:07:01PM +0200, Avi Kivity wrote:
> Right. Allocated from the guest kernel's perspective. This may be
> different from the host kernel's perspective.
>
> Linux will delay touching memory until the last moment, Windows will not
> (likely it zeros pages on their own nodes, but who knows)?
The problem on Linux is that the first touch is clear_page() and
that unfortunately happens in the direct mapping before mapping,
so the "detect mapping" trick doesn't quite work (unless it's a 32bit highmem
page).
Ok one could migrate it on mapping. When the data is still cache
hot that shouldn't be that expensive. Thinking about it again
it might be actually a reasonable approach.
>
> The bigger problem is lifetime. Inside a guest, 'allocation' happens
> when a page is used for pagecache, or when a process is created and
> starts using memory. From the host perspective, it happens just once.
Yes, that's a problem. I discussed some ways to get around that
earlier.
>
> >>It's very different. The kernel expects an application that touched
> >>page X on node Y to continue using page X on node Y. Because
> >>applications know this, they are written to this assumption. However,
> >>
> >
> >The far majority of applications do not actually know where memory is.
> >
>
> In our case, the application is the guest kernel, which does know.
It knows but it doesn't really care all that much. The only thing
that counts is the end performance in this case.
[Some people also NUMA policy to partition machines, but that's
ok in this case because that only needs the same fixed guest physical
addresses which is guaranteed of course]
> The difference is, Linux (as a guest) will try to reuse freed pages from
> an application or pagecache, knowing which node they belong to.
>
> I agree that if all you do is HPC style computation (boot a kernel and
> one app with one process per cpu), then the heuristics work well.
Or if there's a way to detect unmapping/remapping.
> >It is certainly not perfect and has holes (like any heuristics),
> >but it has the advantage of being fully dynamic.
> >
>
> It also has the advantage of being already implemented (apart from fake
> SRAT tables; and that isn't necessary for HPC apps).
What do you mean?
-Andi
next prev parent reply other threads:[~2008-11-30 21:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 22:23 [PATCH 0/3] KVM-userspace: add NUMA support for guests Andre Przywara
2008-11-28 8:14 ` Andi Kleen
2008-11-29 18:43 ` Avi Kivity
2008-11-29 20:10 ` Andi Kleen
2008-11-29 20:35 ` Avi Kivity
2008-11-30 15:41 ` Andi Kleen
2008-11-30 15:38 ` Avi Kivity
2008-11-30 16:05 ` Andi Kleen
2008-11-30 16:38 ` Avi Kivity
2008-11-30 17:04 ` Andi Kleen
2008-11-30 17:11 ` Avi Kivity
2008-11-30 17:42 ` Andi Kleen
2008-11-30 18:07 ` Avi Kivity
2008-11-30 18:55 ` Andi Kleen
2008-11-30 19:11 ` Skywing
2008-11-30 20:08 ` Avi Kivity
2008-11-30 20:07 ` Avi Kivity
2008-11-30 21:41 ` Andi Kleen [this message]
2008-11-30 21:50 ` Avi Kivity
2008-11-30 22:08 ` Skywing
2008-11-28 10:40 ` Daniel P. Berrange
2008-11-29 18:29 ` Avi Kivity
2008-12-01 14:15 ` Andre Przywara
2008-12-01 14:29 ` Avi Kivity
2008-12-01 15:27 ` Anthony Liguori
2008-12-01 15:34 ` Anthony Liguori
2008-12-01 15:37 ` Avi Kivity
2008-12-01 15:49 ` Anthony Liguori
2008-12-01 14:44 ` Daniel P. Berrange
2008-12-01 14:53 ` Avi Kivity
2008-12-01 15:18 ` Anthony Liguori
2008-12-01 15:35 ` Avi Kivity
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=20081130214111.GA6703@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=andre.przywara@amd.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.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