Re: [PATCH 2/8] mm: Split huge pages on write-notify or COW

From: Andrew Morton
Date: Sat Feb 29 2020 - 23:05:45 EST


On Tue, 3 Dec 2019 14:22:33 +0100 Thomas Hellström (VMware) <thomas_os@xxxxxxxxxxxx> wrote:

> We currently only do COW and write-notify on the PTE level, so if the
> huge_fault() handler returns VM_FAULT_FALLBACK on wp faults,
> split the huge pages and page-table entries. Also do this for huge PUDs
> if there is no huge_fault() handler and the vma is not anonymous, similar
> to how it's done for PMDs.

There is no description here of *why* we are making this change?

> Note that fs/dax.c does the splitting in the huge_fault() handler, but as
> huge_fault() is implemented by modules we need to consider whether to
> export the splitting functions for use in the modules or whether to try
> to keep calls in the core. Opt for the latter. A follow-up patch can
> remove the dax.c split_huge_pmd() if needed.