[PATCH v2 hmm 4/9] mm/hmm: remove HMM_FAULT_SNAPSHOT
Christoph Hellwig
hch at lst.de
Sat Mar 28 08:11:47 UTC 2020
On Fri, Mar 27, 2020 at 05:00:16PM -0300, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <jgg at mellanox.com>
>
> Now that flags are handled on a fine-grained per-page basis this global
> flag is redundant and has a confusing overlap with the pfn_flags_mask and
> default_flags.
>
> Normalize the HMM_FAULT_SNAPSHOT behavior into one place. Callers needing
> the SNAPSHOT behavior should set a pfn_flags_mask and default_flags that
> always results in a cleared HMM_PFN_VALID. Then no pages will be faulted,
> and HMM_FAULT_SNAPSHOT is not a special flow that overrides the masking
> mechanism.
>
> As this is the last flag, also remove the flags argument. If future flags
> are needed they can be part of the struct hmm_range function arguments.
>
> Signed-off-by: Jason Gunthorpe <jgg at mellanox.com>
> ---
> Documentation/vm/hmm.rst | 12 +++++-------
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +-
> include/linux/hmm.h | 5 +----
> mm/hmm.c | 17 +++++++++--------
> 5 files changed, 17 insertions(+), 21 deletions(-)
Looks good,
Reviewed-by: Christoph Hellwig <hch at lst.de>
More information about the amd-gfx
mailing list