On Wed, Aug 16, 2023 at 2:48 PM Zach O'Keefe <zokeefe@xxxxxxxxxx> wrote: > > > We have a out of tree driver that maps huge pages through a file handle and > > relies on -> huge_fault. It used to work in 5.19 kernels but 6.1 changed this > > behaviour. > > > > I don’t think reverting the earlier behaviour of fault_path for huge pages should > > impact kernel negatively. > > > > Do you think we can restore this earlier behaviour of kernel to allow page fault > > for huge pages via ->huge_fault. > > That seems reasonable to me. I think using the existence of a > ->huge_fault() handler as a predicate to return "true" makes sense to > me. The "normal" flow for file-backed memory along fault path still > needs to return "false", so that we correctly fallback to ->fault() > handler. Unless there are objections, I can do that in a v2. Sorry for chiming in late. I'm just back from vacation and trying to catch up... IIUC the out-of-tree driver tries to allocate huge page and install PMD mapping via huge_fault() handler, but the cleanup of hugepage_vma_check() prevents this due to the check to VM_NO_KHUGEPAGED? So you would like to check whether a huge_fault() handler existed instead of vma_is_dax()?