linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [rfc][patch] mm: vmap rewrite
Date: Tue, 10 Jun 2008 04:53:12 +0200	[thread overview]
Message-ID: <20080610025312.GC19404@wotan.suse.de> (raw)
In-Reply-To: <484AC779.1070803@goop.org>

On Sat, Jun 07, 2008 at 06:38:01PM +0100, Jeremy Fitzhardinge wrote:
> Nick Piggin wrote:
> >Hi. RFC.
> >
> >Rewrite the vmap allocator to use rbtrees and lazy tlb flushing, and 
> >provide a
> >fast, scalable percpu frontend for small vmaps.
> >
> >XEN and PAT and such do not like deferred TLB flushing. They just need to 
> >call
> >vm_unmap_aliases() in order to flush any deferred mappings.  That call is 
> >very
> >expensive (well, actually not a lot more expensive than a single vunmap 
> >under
> >the old scheme), however it should be OK if not called too often.
> >  
> 
> What are the performance characteristics?

Basically it goes through the lazy mappings, and does a global kernel TLB
flush and discards them if there were any. So in the case there was just
a single lazy mapping there, it will be about as expensive as the current
scheme (the TLB flush being the dominating cost), maybe a little more due
to extra logic involved. If you have multiple lazy mappings, it should
still be a win.


>  Can it be fast-pathed if 
> there are no outstanding aliases?

The TLB flush can be avoided. But I suspect what you really ask for is
whether a given page has outstanding aliases...

 
> For Xen, I'd need to do the alias unmap each time it allocates a page 
> for use in a pagetable.  For initial process construction that could be 
> deferred, but creating mappings on a live process could get fairly 
> expensive as a result.  The ideal interface for me would be a way of 
> testing if a given page has vmap aliases, so that we need only do the 
> unmap if really necessary.  I'm guessing that goes into "need a new page 
> flag" territory though...

It's harder than that even, because we don't own the page flags, so then
clearing the PG_kalias bit would require that we make all page flags ops
atomic in all parts of the kernel. Obviously not going to happen.

The other thing we could do is have vmap layer keep some p->v translations
around (actually it doesn't even need to go all the way to v, just a single
bit would suffice) So I guess this would be like another page flag, but
without the atomicity problem and without me getting angry at using another
flag ;) Still, I'd rather not do this and slow everything else down.

It could be switched on at runtime if Xen is running perhaps. Or the other
thing Xen could do is keep a cache of unaliased page table pages. You
could fill it up N pages at a time, and just do a single unmap_aliases call
to sanitize them all; also, clean pages returned from pagetables could be
reused. Like the quicklists things.

Or: doesn't the host have to do its own alias check anyway? In case of an
AWOL guest? Why not just reuse that and trap back into the guest to fix it
up?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-06-10  2:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 10:20 Nick Piggin
2008-06-06  7:17 ` Jiri Slaby
2008-06-10  3:45   ` Nick Piggin
2008-06-07 17:38 ` Jeremy Fitzhardinge
2008-06-10  2:53   ` Nick Piggin [this message]
2008-06-11 18:46     ` Jeremy Fitzhardinge
2008-06-12  1:22       ` Nick Piggin
2008-06-12 20:18   ` [rfc][patch] mm: vmap rewrite #2 Nick Piggin

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=20080610025312.GC19404@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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