Re: [PATCH v2] mm: memory: fix truncation removing mapped folios

From: Baolin Wang

Date: Wed Oct 21 2026 - 03:47:15 EST




On 10/20/26 4:36 PM, David Hildenbrand (Arm) wrote:
                 if (pmd_none(*pmd)) {
+                       if (details && details->single_folio)
+                               sync_with_folio_pmd_zap(tlb->mm, pmd);
                         addr = next;
                         continue;
                 }

We do have another sync_with_folio_pmd_zap() user in page_vma_mapped_walk(),
does that one need care as well?

Good point. But I don't want to add page_vma_mapped_walk() changes into this fix
patch. I need to analyze all callers of page_vma_mapped_walk() and the potential
races. I'll look into whether it should be changed in a follow-up patch.

Yes, please have a look. I am 99.9% sure that we face the exact same issue there
as well.

Sure. Add it to my TODO list.

BTW, could you take a look at my reply to your concern about v3 when you feel free? Thanks.

https://lore.kernel.org/all/179c26ed-1764-4e5b-a7ee-047ddabbfea1@xxxxxxxxxxxxxxxxx/