On 20/11/2018 17:16, Jan Beulich wrote:
>>>> On 20.11.18 at 18:00, <[email protected]> wrote:
>> Now that idle scrub is the default option, all memory is marked as dirty
>> and alloc_domheap_pages() will do eager scrubbing by default. This can
>> lead to longer Dom0 construction and potentially to a watchdog timeout,
>> especially on older H/W (e.g. Harpertown).
>>
>> Pass MEMF_no_scrub to optimise this process since there is little point
>> in scrubbing memory for Dom0 RAM.
> 
> Good idea.
> 
>> --- a/xen/arch/x86/pv/dom0_build.c
>> +++ b/xen/arch/x86/pv/dom0_build.c
>> @@ -239,7 +239,8 @@ static struct page_info * __init alloc_chunk(struct 
>> domain *d,
>>          order = last_order;
>>      else if ( max_pages & (max_pages - 1) )
>>          --order;
>> -    while ( (page = alloc_domheap_pages(d, order, dom0_memflags)) == NULL )
>> +    while ( (page = alloc_domheap_pages(d, order, dom0_memflags |
>> +                                                  MEMF_no_scrub)) == NULL )
>>          if ( order-- == 0 )
>>              break;
>>      if ( page )
>> @@ -265,7 +266,7 @@ static struct page_info * __init alloc_chunk(struct 
>> domain *d,
>>  
>>          if ( d->tot_pages + (1 << order) > d->max_pages )
>>              continue;
>> -        pg2 = alloc_domheap_pages(d, order, MEMF_exact_node);
>> +        pg2 = alloc_domheap_pages(d, order, MEMF_exact_node | 
>> MEMF_no_scrub);
>>          if ( pg2 > page )
>>          {
>>              free_domheap_pages(page, free_order);
> 
> There are quite a few more allocations up from here. Any reason
> you don't convert those as well, the more that some even
> clear_page() what they've just allocated?

Dom0 RAM is just being the largest allocation. But yes, it should be safe
to use MEMF_no_scrub in every alloc_domheap_pages() call during Dom0
construction. I'll send an updated patch after some testing.

--
Thanks,
Sergey

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to