|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RESEND RFC 2/8] mm: Place unscrubbed pages at the end of pagelist
>>
>> static void merge_chunks(struct page_info *pg, unsigned int node,
>> - unsigned int zone, unsigned int order)
>> + unsigned int zone, unsigned int order,
>> + bool_t need_scrub)
> Can't you calculate need_scrub from *pg rather than passing an extra
> parameter?
Right, I can just look at the head's PGC_need_scrub bit.
>> {
>> ASSERT(spin_is_locked(&heap_lock));
>>
>> @@ -970,12 +982,49 @@ static void merge_chunks(struct page_info *pg,
>> unsigned int node,
>> }
>>
>> PFN_ORDER(pg) = order;
>> - page_list_add_tail(pg, &heap(node, zone, order));
>> + if ( need_scrub )
>> + page_list_add_tail(pg, &heap(node, zone, order));
>> + else
>> + page_list_add(pg, &heap(node, zone, order));
>> +}
>> +
>> +static void scrub_free_pages(unsigned int node)
>> +{
>> + struct page_info *pg;
>> + unsigned int i, zone;
>> + int order;
>> +
>> + ASSERT(spin_is_locked(&heap_lock));
>> +
>> + if ( !node_need_scrub[node] )
>> + return;
>> +
>> + for ( zone = 0; zone < NR_ZONES; zone++ )
>> + {
>> + for ( order = MAX_ORDER; order >= 0; order-- )
>> + {
>> + while ( !page_list_empty(&heap(node, zone, order)) )
>> + {
>> + /* Unscrubbed pages are always at the end of the list. */
>> + pg = page_list_last(&heap(node, zone, order));
>> + if ( !test_bit(_PGC_need_scrub, &pg[0].count_info) )
> &pg->count_info
>
>> + break;
>> +
>> + for ( i = 0; i < (1 << order); i++)
> 1U, and probably unsigned long. Similarly later.
I'll update sizing throughout the series.
I just noticed, BTW, that this routine lost something like
page_list_del(pg, &heap(node, zone, order));
merge_chunks(pg, node, zone, chunk_order, 0);
otherwise we just scrub the last chunk on each list.
This is all rewritten in a later patch which is why I missed this during
testing.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |