quoted
Note that I don't quite understand why we have to batch the whole thing
or fallback to
individual pages. Why can't we perform other batches that span only some
PTEs? What's special
about 1 PTE vs. 2 PTEs vs. all PTEs?
That's a good point about the "all-or-nothing" batching logic ;)
It seems the "all-or-nothing" approach is specific to the lazyfree use
case, which needs to unmap the entire folio for reclamation. If that's
not possible, it falls back to the single-page slow path.
Other cases advance the PTE themselves, while try_to_unmap_one() relies
on page_vma_mapped_walk() to advance the PTE. Unless we want to manually
modify pvmw.pte and pvmw.address outside of page_vma_mapped_walk(), which
to me seems like a violation of layers. :-)
Thanks
Barry