>>> Boris Ostrovsky 07/23/17 4:28 AM >>>
>On 06/27/2017 03:28 PM, Jan Beulich wrote:
> Boris Ostrovsky 06/22/17 8:56 PM >>>
>>> +static void check_and_stop_scrub(struct page_info *head)
>>> +{
>>> +if ( head->u.free.scrub_state == BUDDY_SCRUBBING )
>>> +{
>>> +struct page_info
On 06/27/2017 03:28 PM, Jan Beulich wrote:
Boris Ostrovsky 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:
+static void
>>> "Jan Beulich" 06/27/17 9:29 PM >>>
Boris Ostrovsky 06/22/17 8:56 PM >>>
>> +/* Can't ACCESS_ONCE() a bitfield. */
>> +pg.u.free.val = ACCESS_ONCE(head->u.free.val);
>
>Something like ACCESS_ONCE(head->u.free).val ought to work (or read_atomic(),
>due to the questi
>>> Boris Ostrovsky 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:
> +static void check_and_stop_scrub(struct page_inf
Instead of scrubbing pages while holding heap lock we can mark
buddy's head as being scrubbed and drop the lock temporarily.
If someone (most likely alloc_heap_pages()) tries to access
this chunk it will signal the scrubber to abort scrub by setting
head's BUDDY_SCRUB_ABORT bit. The scrubber checks