|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5 6/8] mm: Keep heap accessible to others while scrubbing
On 06/27/2017 03:28 PM, Jan Beulich wrote: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> 06/22/17 8:56 PM >>>Changes in v5: * Fixed off-by-one error in setting first_dirty * Changed struct page_info.u.free to a union to permit use of ACCESS_ONCE in check_and_stop_scrub()I don't see the need for this:
Hmm... I couldn't get this to work with either suggestion.
page_alloc.c:751:13: error: conversion to non-scalar type requested
pg.u.free = read_atomic(&head->u.free);
page_alloc.c:753:6: error: conversion to non-scalar type requested
if ( ACCESS_ONCE(head->u.free).scrub_state != BUDDY_SCRUB_ABORT )
In get_free_buddy() (formerly part of alloc_heap_pages()) I have
/* Find smallest order which can satisfy the request. */
for ( j = order; j <= MAX_ORDER; j++ )
{
if ( (pg = page_list_remove_head(&heap(node, zone, j))) )
{
if ( pg->u.free.first_dirty == INVALID_DIRTY_IDX )
return pg;
/*
* We grab single pages (order=0) even if they are
* unscrubbed. Given that scrubbing one page is
fairly quick
* it is not worth breaking higher orders.
*/
if ( (order == 0) || use_unscrubbed )
{
check_and_stop_scrub(pg);
return pg;
}
If first_dirty gets assigned INVALID_DIRTY_IDX then get_free_buddy()
will return pg right away without telling the scrubber that the buddy
has been taken for use. The scrubber will then put the buddy back on the
heap.
-boris _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |