All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <Tim.Deegan@xensource.com>
To: Sangmin Lee <sal008@cs.ucsd.edu>
Subject: Re: LRU for recycling shadow pages
Date: Thu, 2 Aug 2007 10:17:56 +0100	[thread overview]
Message-ID: <20070802091756.GA31355@york.uk.xensource.com> (raw)
In-Reply-To: <46B197BB.9030709@cs.ucsd.edu>

At 01:37 -0700 on 02 Aug (1186018635), Sangmin Lee wrote:
> Can anyone give me an description on how LRU for recycling
> shadow pages is implemented?

The LRU is only very approximate: we keep a linked list of the top-level 
shadow pages, and pull entries to the front when they're used in a CR3
write.  Each entry on the list has an extra "pin" reference taken to
stop it being torn down when it's not in a CR3.

When we need to reclaim shadow memory, we drop those pin references,
starting from the tail end of the list, which causes shadow pagetable
hierarchies to be recursively torn down.

Code is in shadow_prealloc() in arch/x86/mm/shadow/common.c

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xensource.com>, XenSource UK Limited
Registered office c/o EC2Y 5EB, UK; company number 05334508

      reply	other threads:[~2007-08-02  9:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02  8:37 LRU for recycling shadow pages Sangmin Lee
2007-08-02  9:17 ` Tim Deegan [this message]

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=20070802091756.GA31355@york.uk.xensource.com \
    --to=tim.deegan@xensource.com \
    --cc=sal008@cs.ucsd.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.