This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] LRU for recycling shadow pages

To: Sangmin Lee <sal008@xxxxxxxxxxx>
Subject: Re: [Xen-devel] LRU for recycling shadow pages
From: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Date: Thu, 2 Aug 2007 10:17:56 +0100
Delivery-date: Thu, 02 Aug 2007 02:27:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46B197BB.9030709@xxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <46B197BB.9030709@xxxxxxxxxxx>
Resent-date: Thu, 2 Aug 2007 10:18:36 +0100
Resent-date: Thu, 02 Aug 2007 10:18:36 +0100
Resent-from: Tim.Deegan@xxxxxxxxxxxxx
Resent-message-id: <20070802091836.GE31316@xxxxxxxxxxxxxxxxxxxxx>
Resent-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
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



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

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>