Re: [PATCH v6 4/8] mm: Add write-protect and clean utilities for address space ranges

From: Andrew Morton
Date: Tue Nov 05 2019 - 22:51:19 EST


On Mon, 14 Oct 2019 15:22:00 +0200 Thomas Hellström (VMware) <thomas_os@xxxxxxxxxxxx> wrote:

> Add two utilities to 1) write-protect and 2) clean all ptes pointing into
> a range of an address space.
> The utilities are intended to aid in tracking dirty pages (either
> driver-allocated system memory or pci device memory).
> The write-protect utility should be used in conjunction with
> page_mkwrite() and pfn_mkwrite() to trigger write page-faults on page
> accesses. Typically one would want to use this on sparse accesses into
> large memory regions. The clean utility should be used to utilize
> hardware dirtying functionality and avoid the overhead of page-faults,
> typically on large accesses into small memory regions.

Not fully comfortable reviewing this one.

> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -736,4 +736,7 @@ config ARCH_HAS_PTE_SPECIAL
> config ARCH_HAS_HUGEPD
> bool
>
> +config MAPPING_DIRTY_HELPERS
> + bool
> +

But given this, it's your problem ;) So

Acked-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

Yes, please proceed with merging [1-4] via a drm tree.