v5
2026-11-05
fork 复制 PMD 对齐 PTE 路径 · v5
v5让fork时复制PMD映射的文件与shmem THP,并修正copy_huge_pmd特殊PMD加锁。
原始补丁链接
子 Patch(4)
1/4
mm/rmap: duplicate a PMD mapping as one in folio_dup_file_rmap_pmd()
On 11/4/26 9:40 PM, Konstantin Khorenko wrote: > folio_dup_file_rmap_pmd() passes PGTABLE_LEVEL_PTE to > __folio_dup_file_rmap() for HPAGE_PMD_NR pages, so it adds HPAGE_PMD_NR > PTE mappings to the f
2/4
mm/huge_memory: copy file THPs at fork like copy_present_ptes() does
On 11/4/26 9:40 PM, Konstantin Khorenko wrote: > This fixes no bug: it makes fork copy a PMD the way copy_present_ptes() > copies a PTE. Until now copy_huge_pmd() skipped every folio PMD of a > non-an
3/4
mm/huge_memory: read a special PMD under the lock in copy_huge_pmd()
On 11/4/26 9:40 PM, Konstantin Khorenko wrote: > copy_huge_pmd() reads a special PMD without the page table lock and > copies that value to the child. The mmap write lock held by fork does > not stop
4/4
selftests/mm: test fork of PMD-mapped shmem THPs
On 11/4/26 9:40 PM, Konstantin Khorenko wrote: > + pmdsize = read_pmd_pagesize(); read_pmd_pagesize() is pmd_psize() in mm-new since 5d123bb07b18 (“kselftest: mm: rename read_pmd_pagesize() to pmd_psi