linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Unifying page table walkers
@ 2024-06-06 18:29 Matthew Wilcox
  2024-06-06 19:30 ` James Houghton
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Matthew Wilcox @ 2024-06-06 18:29 UTC (permalink / raw)
  To: Khalid Aziz, Peter Xu, Vishal Moola, Jane Chu, Muchun Song; +Cc: linux-mm

One of the things we discussed at LSFMM was unifying the hugetlb and
THP page table walkers.  I've been looking into it some more recently;
I've found a problem and I think a solution.

The reason we have a separate hugetlb_entry from pmd_entry and pud_entry
is that it has a different locking context.  It is called with the
hugetlb_vma_lock held for read (nb: this is not the same as the vma
lock; see walk_hugetlb_range()).  Why do we need this?  Because of page
table sharing.

In a completely separate discussion, I was talking with Khalid about
mshare() support for hugetlbfs, and I suggested that we permit hugetlbfs
pages to be mapped by a VMA which does not have the VM_HUGETLB flag set.
If we do that, the page tables would not be permitted to be shared with
other users of that hugetlbfs file.  But we want to eliminate support
for that anyway, so that's more of a feature than a bug.

Once we don't use the VM_HUGETLB flag on these VMAs, that opens the
door to the other features we want, like mapping individual pages from
a hugetlb folio.  And we can use the regular page table walkers for
these VMAs.

Is this a reasonable path forward, or have I overlooked something?


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-06-09 20:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-06 18:29 Unifying page table walkers Matthew Wilcox
2024-06-06 19:30 ` James Houghton
2024-06-06 20:04   ` Matthew Wilcox
2024-06-06 20:23     ` James Houghton
2024-06-06 21:21       ` Matthew Wilcox
2024-06-06 23:07         ` James Houghton
2024-06-07  7:15           ` David Hildenbrand
2024-06-06 21:33     ` Peter Xu
2024-06-06 21:49 ` Peter Xu
2024-06-07  5:07   ` Oscar Salvador
2024-06-07  6:59 ` David Hildenbrand
2024-06-09 20:08   ` Matthew Wilcox
2024-06-09 20:28     ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox