Re: [PATCH 1/4] mm: Trial do_wp_page() simplification

From: Peter Xu
Date: Thu Sep 17 2020 - 17:41:09 EST


On Thu, Sep 17, 2020 at 01:35:56PM -0700, Linus Torvalds wrote:
> For that to happen, we'd need to have the vma flag so that we wouldn't
> have any worry about non-pinners, but as you suggested, I think even
> just a mm-wide counter - or flag - to deal with the fast-bup case is
> likely perfectly sufficient.

Would mm_struct.pinned_vm suffice?

Though now I'm not 100% certain whether all pin_user_pages*() callers are
accounting correctly upon pinned_vm. My gut feeling is that bc3e53f682d93df67
does not convert all the old locked_vm users with page pinnings (e.g.,
mm_iommu_do_alloc, vaddr_get_pfn, etc.; didn't try harder).

--
Peter Xu