[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] Fix domheap structure allocation when NUMA=on



>>> "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx> 20.03.09 09:34 >>>
>Jan Beulich wrote:
>>>>> "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx> 20.03.09 06:05 >>>
>>> DIRECTMAP_VIRT_END can't be passed to virt_to_mfn(), as it's just beyond 
>>> direct map boundary and triggers ASSERT very early at boot time.
>> 
>> While I agree to the analysis, I would think that this
>> 
>> +              mfn + needed <= virt_to_mfn(DIRECTMAP_VIRT_END - PAGE_SIZE) )
>> 
>> should rather be
>> 
>> +              mfn + needed <= virt_to_mfn(DIRECTMAP_VIRT_END - 1) + 1 )
>> 
>virt_to_mfn(DIRECTMAP_VIRT_END - 1) is equal to 

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 '<=' here.

Because on the left side of the comparison we also calculate the first
following mfn, not the last included one.

Jan


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.