WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH]Add a flag for shadow pages

To: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH]Add a flag for shadow pages
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 04 Mar 2009 09:22:40 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 04 Mar 2009 01:23:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E2263E4A5B2284449EEBD0AAB751098401C7C9DD6F@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmcpbnsO+Hd65wBRsq7KCOjKnHUNQAAtTT+AAANk1AAAH+w/w==
Thread-topic: [PATCH]Add a flag for shadow pages
User-agent: Microsoft-Entourage/12.15.0.081119
I just realised that. You use get_page() to lock down a page's owner.
Otherwise it can change under your feet anyway. You don't need a new flag.

 -- Keir

On 04/03/2009 09:17, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> wrote:

> This is mainly for page offline. When we offline a page, we we need turn to
> the caller the page's owner but we can't distinguish easily if it is a
> assigned page or a shadow page.
> 
> Thanks
> Yunhong Jiang
> 
> Keir Fraser <mailto:keir.fraser@xxxxxxxxxxxxx> wrote:
>> On 04/03/2009 08:46, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> wrote:
>> 
>>> Currently we don't know that a page is a shadow page unless we are in
>>> shadow handler. This cause error when we try to get the page owner for the
>>> shadow page, this snippet add a flag to it.
>>> 
>>> signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>
>> 
>> You only actually use your new flag in a BUG_ON, where it
>> might avoid false
>> negatives but hardly looks essential. Your other changes limit count_info
>> checks to PGC_page_table|PGC_count_info which might be an
>> improvement (I'm
>> sure Tim or Gianluca can say) but they're existing fields.
>> 
>>> I'm not quite sure if the sh_put_ref() and
>> sh_rm_write_access_from_sl1p() is
>>> try to checking a page is shadow page (I assume so), because when a
>>> anonymous page is allocated, the count_info is also 0 (like HVM's vlapic
>>> page), so I change it like this patch (checking PGC_count_mask is 0).
>>> Since comments in sh_hash_audit_bucket() has stated clearly it is to check
>>> if it is shdow, so I replace it with test_bit().
>>> 
>>> Also, do we need checking in page_get_owner() also?
>> 
>> Usually gets used where we already get_page()ed or are about
>> to get_page().
>> Most Xen code knows that page uses can change under its feet
>> unless it grabs
>> a reference. So extra checks in page_get_owner() are probably rather
>> pointless. 
>> 
>> -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel