Re: [PATCH v4] mm/userfaultfd: fix hugetlb fault mutex hash calculation

From: Mike Rapoport

Date: Wed Mar 25 2026 - 15:11:04 EST


On Wed, Mar 25, 2026 at 09:49:54AM +0100, David Hildenbrand (Arm) wrote:
> On 3/25/26 07:07, Jianhui Zhou wrote:
> > On Tue, Mar 25, 2026 at 01:06:00AM +0000, SeongJae Park wrote:
> >> Seems userfaulfd.c is the only caller of the new helper function. Why don't
> >> you define the function in userfaultfd.c ?
> > I kept hugetlb_linear_page_index() in include/linux/hugetlb.h because
> > this is hugetlb-specific logic, not userfaultfd-specific logic.
>
> Yes, and see my comment about either removing it entirely again next, or
> actually also using it in hugetlb.c.

I think it's better to move large piece of mfill_atomic_hugetlb() to
hugetlb.c and git rid of the helper then.
And now keep it simple for easier backporting.

> --
> Cheers,
>
> David

--
Sincerely yours,
Mike.