Re: [PATCH RFC v3] mm: Proper document tail pages fields for folio

From: David Hildenbrand
Date: Wed Aug 16 2023 - 14:54:20 EST


On 16.08.23 20:41, Matthew Wilcox wrote:
On Wed, Aug 16, 2023 at 03:33:30PM +0200, David Hildenbrand wrote:
My simple tests passed so far. If there isn't something obvious missing,
I can do more testing and send this as an official patch.

I think you missed one:

+++ b/mm/swapfile.c
@@ -1490,7 +1490,7 @@ int swp_swapcount(swp_entry_t entry)

page = vmalloc_to_page(p->swap_map + offset);
offset &= ~PAGE_MASK;
- VM_BUG_ON(page_private(page) != SWP_CONTINUED);
+ VM_BUG_ON(page_swap_entry(page).val != SWP_CONTINUED);

That falls under the "weird handling of SWP_CONTINUED using vmalloced pages". So different user of page_private().

Note that we don't even store swap entries in there but extended swap counts.


do {
page = list_next_entry(page, lru);

I'm not smart enough to understand the use of the one in
add_swap_count_continuation(). Maybe that also needs to be fixed?

No, that's independent of THP_SWAP, we're not working on the memmap of the THP but some weird extension of swap counts.

Thanks for having a look!

--
Cheers,

David / dhildenb