From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: Re: [PATCH] wrong accounting in direct_remap_pfn_range Date: Wed, 30 Aug 2006 20:47:14 -0400 Message-ID: <44F63192.6000900@redhat.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: Keir Fraser Cc: xen-devel@lists.xensource.com, quintela@redhat.com List-Id: xen-devel@lists.xenproject.org Keir Fraser wrote: > On 31/8/06 1:37 am, "Steven Rostedt" 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. > Well it wasn't obvious to me :P If a size == 0 is passed in (for whatever reason!), couldn't we skip the flush_cache_all, flush_tlb_all and the allocation and freeing of a page and just return? If you want this in mainline Linux, you'll probably have others mention that too. -- Steve