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

Re: [Xen-devel] [PATCH] wrong accounting in direct_remap_pfn_range

To: Steven Rostedt <srostedt@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] wrong accounting in direct_remap_pfn_range
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Thu, 31 Aug 2006 01:42:24 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, quintela@xxxxxxxxxx
Delivery-date: Wed, 30 Aug 2006 17:42:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <44F62F3F.7030709@xxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcbMllM4keePEziJEdummAAKle7CWA==
Thread-topic: [Xen-devel] [PATCH] wrong accounting in direct_remap_pfn_range
User-agent: Microsoft-Entourage/11.2.5.060620
On 31/8/06 1:37 am, "Steven Rostedt" <srostedt@xxxxxxxxxx> wrote:

> grr, I take it back, I am the one that's confused :P
> 
> OK, this all happens because this whole blob of code is crazy because it
> is missing a "if (size == 0)" check!

It's not really missing. We could have a size==0 check *or* we can have the
v!=u check. We don't need both and I think the latter is more obviously
correct, as the test is closer to the code that it 'protects'. Also it's a
fairly idiomatic way of generating and flushing batches of work.

 -- Keir

> The "if (v != u)" is only not true when this function is called with
> size == 0, and we don't need to do anything.  Why not just have that
> check in the beginning and remove the "if (v != u)"?
>
> It would have saved me a lot of wasted time here.  Or is this code meant
> to confuse me?



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