From: "Jan Beulich" Subject: Re: [PATCH] Fix domheap structure allocation when NUMA=on Date: Fri, 20 Mar 2009 09:27:13 +0000 Message-ID: <49C36F81.76E4.0078.0@novell.com> References: <49C36646.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline 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 , Xiaowei Yang Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> Keir Fraser 20.03.09 09:56 >>> >On 20/03/2009 08:47, "Jan Beulich" wrote: > >> virt_to_mfn(DIRECTMAP_VIRT_END - 1) is equal to >>=20 >> Depending on whether DIRECTMAP_VIRT_END is the last byte or the first >> following byte. Using "- 1" avoids such a dependency. >>=20 >>> virt_to_mfn(DIRECTMAP_VIRT_END - PAGE_SIZE). Why +1? We use '<=3D' = here. >>=20 >> Because on the left side of the comparison we also calculate the first >> following mfn, not the last included one. > >Since DIRECTMAP_VIRT_END is always the following byte not the last byte, = it >sounds like you think the page_alloc.c chunk is not needed at all. I'll = just >check in the header fix for now. No, that chunk is necessary afaics - as I said I agree to Xiaowei's = diagnosis that virt_to_mfn() should not be used on DIRECTMAP_VIRT_END alone. Subtracting 1 from it, and then adding back 1 to the result is indeed what I think is the right thing to do here. Jan