From: "Jan Beulich" Subject: Re: [PATCH] Fix domheap structure allocation when NUMA=on Date: Fri, 20 Mar 2009 08:47:50 +0000 Message-ID: <49C36646.76E4.0078.0@novell.com> References: <49C32413.2030505@intel.com> <49C35EA9.76E4.0078.0@novell.com> <49C35517.7040706@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <49C35517.7040706@intel.com> 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: Xiaowei Yang Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> "Yang, Xiaowei" 20.03.09 09:34 >>> >Jan Beulich wrote: >>>>> "Yang, Xiaowei" 20.03.09 06:05 >>> >>> DIRECTMAP_VIRT_END can't be passed to virt_to_mfn(), as it's just = beyond=20 >>> direct map boundary and triggers ASSERT very early at boot time. >>=20 >> While I agree to the analysis, I would think that this >>=20 >> + mfn + needed <=3D virt_to_mfn(DIRECTMAP_VIRT_END - = PAGE_SIZE) ) >>=20 >> should rather be >>=20 >> + mfn + needed <=3D virt_to_mfn(DIRECTMAP_VIRT_END - 1) + = 1 ) >>=20 >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. >virt_to_mfn(DIRECTMAP_VIRT_END - PAGE_SIZE). Why +1? We use '<=3D' here. Because on the left side of the comparison we also calculate the first following mfn, not the last included one. Jan