Re: [PATCH 4/5] mm: Make pgoff non-const in struct vm_fault

From: Matthew Wilcox
Date: Mon Mar 25 2024 - 22:39:01 EST


On Mon, Mar 25, 2024 at 03:33:38PM -0700, Vishal Moola (Oracle) wrote:
> Hugetlb calculates addresses and page offsets differently from the rest of
> mm. In order to pass struct vm_fault through the fault pathway we will let
> hugetlb_fault() and __handle_mm_fault() set those variables themselves
> instead.

I don't think this is a great idea. I'd rather not do patch 5 than do
patch 4+5. If you look at the history, commits 742d33729a0df11 and
5857c9209ce58f show that drivers got into the bad habit of changing
address & pgoff, so they got made const to prevent that.

So can we make hugetlbfs OK with using addresses & pgoffsets that aren't
aligned to HPAGE boundaries? Worth playing with for a bit to see how
deep that assumption runs.