From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gianluca Guida Subject: Re: [PATCH] Do not set page's count_info directly Date: Thu, 05 Mar 2009 15:21:27 +0000 Message-ID: <49AFEDF7.10709@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Jiang, Yunhong" Cc: Tim Deegan , "xen-devel@lists.xensource.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org Jiang, Yunhong wrote: > Keir Fraser wrote: >> On 05/03/2009 12:45, "Gianluca Guida" wrote: >> >>> On Thu, Mar 5, 2009 at 1:38 PM, Tim Deegan >> wrote: >>>> The check doesn't tell you it's a shadow page -- it just tells you it's >>>> *not* allocated in another way. Checking with the mask is OK here, >>>> perhaps with a comment change. >>> Yes, but this is what the code (in the shadow code) intends to check. >>> My complete plan is to have this macro and restore the idea of having >>> a flag for shadow pages because, as for now, the fact that we can't >>> distinguish clearly a shadow page should be considered a sort of bug, >>> given the code assumptions. Or at least a good basis for future bugs. >> I'm happy for shadow code to have another bit in count_info >> for its own use. >> I don't think it's good to have other code (e.g., generic page offlining >> code) peeking at it, is all. The particular case for a new >> flag described >> above sounds fine. > > The new code is not using that flag anymore, it is use the page_get_owner_and_reference() to get the owner. Yes, I was actually thinking about adding it. Turns out that I realized that it's not the best way to do stuff, but I think that I'll do the following: - add a sh_page_is_a_shadow_page() in shadow code to make the code less confusing (with a small caveat comment about not being perfectly precise). - exercise my English skills by writing a comment in page_info that summarizes this thread findings about current use if count_info and shadow pages. Thanks, Gianluca