Re: [PATCH 07/12] mm: Remove redundant pXd_devmap calls

Jason Gunthorpe
2025-06-03T13:48:16Z

On Thu, May 29, 2025 at 04:32:08PM +1000, Alistair Popple wrote:
> DAX was the only thing that created pmd_devmap and pud_devmap entries
> however it no longer does as DAX pages are now refcounted normally and
> pXd_trans_huge() returns true for those. Therefore checking both pXd_devmap
> and pXd_trans_huge() is redundant and the former can be removed without
> changing behaviour as it will always be false.
>
> Signed-off-by: Alistair Popple <apopple@nvidia.com>
> ---
> fs/dax.c | 5 ++---
> include/linux/huge_mm.h | 10 ++++------
> include/linux/pgtable.h | 2 +-
> mm/hmm.c | 4 ++--
> mm/huge_memory.c | 30 +++++++++---------------------
> mm/mapping_dirty_helpers.c | 4 ++--
> mm/memory.c | 15 ++++++---------
> mm/migrate_device.c | 2 +-
> mm/mprotect.c | 2 +-
> mm/mremap.c | 5 ++---
> mm/page_vma_mapped.c | 5 ++---
> mm/pagewalk.c | 8 +++-----
> mm/pgtable-generic.c | 7 +++----
> mm/userfaultfd.c | 4 ++--
> mm/vmscan.c | 3 ---
> 15 files changed, 40 insertions(+), 66 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason