Re: [PATCH] mm: reuse the unshared swapcache page in do_wp_page

From: David Hildenbrand
Date: Thu Jan 20 2022 - 13:19:58 EST


>> Sounds good? At least to me. If only swap/migration entries wouldn't be
>> harder to handle than I'd wish, that's why it's taking a little and will
>> take a little longer.
>
> Thanks for the quick response. I would have to see the logic to set/clear
> PageAnonExclusive to fully understand how things are handled.
>

I'll let you know as soon as I have something. I'll most probably share
a document explaining the design first.

> BTW, I just saw this patch form PeterZ [1] that seems to be related, as
> it deals with changing protection on pinned pages.

Unfortunately the use of page_maybe_dma_pinned() is racy, as we can race
with GUP fast. It's a problem for vmscan which currently relies on it
for correctness. For migration, it might be good enough as we should
fail later when trying to freeze the refcount.

>
>
> [1] https://lore.kernel.org/linux-mm/20220120160822.666778608@xxxxxxxxxxxxx/
>


--
Thanks,

David / dhildenb