[RFC PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock

From: Rik van Riel
Date: Wed Sep 20 2023 - 11:24:18 EST


On Wed, 20 Sep 2023 04:57:33 +0100
Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> On Tue, Sep 19, 2023 at 10:16:09PM -0400, riel@xxxxxxxxxxx wrote:
> > From: Rik van Riel <riel@xxxxxxxxxxx>
> >
> > Extend the locking scheme used to protect shared hugetlb mappings
> > from truncate vs page fault races, in order to protect private
> > hugetlb mappings (with resv_map) against MADV_DONTNEED.

> This feels an awful lot like the invalidate_lock in struct address_space
> which was recently added by Jan Kara.
>

Sure enough, the invalidate_lock is looking really similar.
This has the potential to simplify the hugetlbfs code a bunch!

On the flip side, this is a large change, and it may make sense
to merge it separately to help with bisectability?

Thank you for the suggestion!

Mike, did I forget a spot somewhere? :)

---8<---