Re: race with page_referenced_one->ptep_test_and_clear_young and pagetable setup/pulldown

Keir Fraser
2007-10-05T09:15:23Z

On 5/10/07 10:05, "Jeremy Fitzhardinge" <jeremy@goop.org> wrote:

> Andi says:
>> Do I misread that patch or does it really walk the complete address
>> space and try to take all possible locks? Isn't that very slow?
>>
>
> That's pretty much what it has to do. Pinning/unpinning walks the whole
> pagetable anyway, so it shouldn't be much more expensive. And they're
> relatively rare operations (fork, exec, exit).

It is a shame to do 3x walks per pin or unpin, rather than 1x, though.

One way to improve this, possibly, is to pin the pte tables individually as
you go, rather than doing one big pin/unpin just at the root pgd. Then you
can lock/unlock the pte's as you go. I'd suggest that as a possible post
2.6.23 improvement, however. Jan's patch has actually had some testing.

-- Keir