linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 00/12] mm: Remove pXX_devmap page table bit and pfn_t type
@ 2025-02-19  5:04 Alistair Popple
  2025-02-19  5:04 ` [PATCH RFC v2 01/12] mm: Remove PFN_MAP, PFN_SG_CHAIN and PFN_SG_LAST Alistair Popple
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Alistair Popple @ 2025-02-19  5:04 UTC (permalink / raw)
  To: akpm, linux-mm
  Cc: Alistair Popple, gerald.schaefer, dan.j.williams, jgg, willy,
	david, linux-kernel, nvdimm, linux-fsdevel, linux-ext4,
	linux-xfs, jhubbard, hch, zhang.lyra, debug, bjorn, balbirs

Changes for v2:

 - This is an update to my previous RFC[1] removing just pfn_t rebased
   on today's mm-unstable which includes my ZONE_DEVICE refcounting
   clean-up.

 - The removal of the devmap PTE bit and associated infrastructure was
   dropped from that series so I have rolled it into this series.

 - Logically this series makes sense to me, but the dropping of devmap
   is wide ranging and touches some areas I'm less familiar with so
   would definitely appreciate any review comments there.

[1] - https://lore.kernel.org/linux-mm/cover.a7cdeffaaa366a10c65e2e7544285059cc5d55a4.1736299058.git-series.apopple@nvidia.com/
[2] - https://lore.kernel.org/linux-mm/cover.a782e309b1328f961da88abddbbc48e5b4579021.1739850794.git-series.apopple@nvidia.com/

All users of dax now require a ZONE_DEVICE page which is properly
refcounted. This means there is no longer any need for the PFN_DEV, PFN_MAP
and PFN_SPECIAL flags. Furthermore the PFN_SG_CHAIN and PFN_SG_LAST flags
never appear to have been used. It is therefore possible to remove the
pfn_t type and replace any usage with raw pfns.

The remaining users of PFN_DEV have simply passed this to
vmf_insert_mixed() to create pte_devmap() mappings. It is unclear why this
was the case but presumably to ensure vm_normal_page() does not return
these pages. These users can be trivially converted to raw pfns and
creating a pXX_special() mapping to ensure vm_normal_page() still doesn't
return these pages.

Now that there are no users of PFN_DEV we can remove the devmap page table
bit and all associated functions and macros, freeing up a software page
table bit.

---

Cc: gerald.schaefer@linux.ibm.com
Cc: dan.j.williams@intel.com
Cc: jgg@ziepe.ca
Cc: willy@infradead.org
Cc: david@redhat.com
Cc: linux-kernel@vger.kernel.org
Cc: nvdimm@lists.linux.dev
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-ext4@vger.kernel.org
Cc: linux-xfs@vger.kernel.org
Cc: jhubbard@nvidia.com
Cc: hch@lst.de
Cc: zhang.lyra@gmail.com
Cc: debug@rivosinc.com
Cc: bjorn@kernel.org
Cc: balbirs@nvidia.com

Alistair Popple (12):
  mm: Remove PFN_MAP, PFN_SG_CHAIN and PFN_SG_LAST
  mm: Convert pXd_devmap checks to vma_is_dax
  mm/pagewalk: Skip dax pages in pagewalk
  mm: Convert vmf_insert_mixed() from using pte_devmap to pte_special
  mm: Remove remaining uses of PFN_DEV
  mm/gup: Remove pXX_devmap usage from get_user_pages()
  mm: Remove redundant pXd_devmap calls
  mm/khugepaged: Remove redundant pmd_devmap() check
  powerpc: Remove checks for devmap pages and PMDs/PUDs
  mm: Remove devmap related functions and page table bits
  mm: Remove callers of pfn_t functionality
  mm/memremap: Remove unused devmap_managed_key

 Documentation/mm/arch_pgtable_helpers.rst     |   6 +-
 arch/arm64/Kconfig                            |   1 +-
 arch/arm64/include/asm/pgtable-prot.h         |   1 +-
 arch/arm64/include/asm/pgtable.h              |  24 +---
 arch/loongarch/Kconfig                        |   1 +-
 arch/loongarch/include/asm/pgtable-bits.h     |   6 +-
 arch/loongarch/include/asm/pgtable.h          |  19 +--
 arch/powerpc/Kconfig                          |   1 +-
 arch/powerpc/include/asm/book3s/64/hash-4k.h  |   6 +-
 arch/powerpc/include/asm/book3s/64/hash-64k.h |   7 +-
 arch/powerpc/include/asm/book3s/64/pgtable.h  |  53 +------
 arch/powerpc/include/asm/book3s/64/radix.h    |  14 +--
 arch/powerpc/mm/book3s64/hash_hugepage.c      |   2 +-
 arch/powerpc/mm/book3s64/hash_pgtable.c       |   3 +-
 arch/powerpc/mm/book3s64/hugetlbpage.c        |   2 +-
 arch/powerpc/mm/book3s64/pgtable.c            |  10 +-
 arch/powerpc/mm/book3s64/radix_pgtable.c      |   5 +-
 arch/powerpc/mm/pgtable.c                     |   2 +-
 arch/riscv/Kconfig                            |   1 +-
 arch/riscv/include/asm/pgtable-64.h           |  20 +--
 arch/riscv/include/asm/pgtable-bits.h         |   1 +-
 arch/riscv/include/asm/pgtable.h              |  17 +--
 arch/x86/Kconfig                              |   1 +-
 arch/x86/include/asm/pgtable.h                |  51 +------
 arch/x86/include/asm/pgtable_types.h          |   5 +-
 arch/x86/mm/pat/memtype.c                     |   6 +-
 drivers/dax/device.c                          |  23 +--
 drivers/dax/hmem/hmem.c                       |   1 +-
 drivers/dax/kmem.c                            |   1 +-
 drivers/dax/pmem.c                            |   1 +-
 drivers/dax/super.c                           |   3 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c       |   1 +-
 drivers/gpu/drm/gma500/fbdev.c                |   3 +-
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |   1 +-
 drivers/gpu/drm/msm/msm_gem.c                 |   1 +-
 drivers/gpu/drm/omapdrm/omap_gem.c            |   7 +-
 drivers/gpu/drm/v3d/v3d_bo.c                  |   1 +-
 drivers/md/dm-linear.c                        |   2 +-
 drivers/md/dm-log-writes.c                    |   2 +-
 drivers/md/dm-stripe.c                        |   2 +-
 drivers/md/dm-target.c                        |   2 +-
 drivers/md/dm-writecache.c                    |   9 +-
 drivers/md/dm.c                               |   2 +-
 drivers/nvdimm/pmem.c                         |   8 +-
 drivers/nvdimm/pmem.h                         |   4 +-
 drivers/s390/block/dcssblk.c                  |  10 +-
 drivers/vfio/pci/vfio_pci_core.c              |   7 +-
 fs/cramfs/inode.c                             |   5 +-
 fs/dax.c                                      |  55 ++----
 fs/ext4/file.c                                |   2 +-
 fs/fuse/dax.c                                 |   3 +-
 fs/fuse/virtio_fs.c                           |   5 +-
 fs/userfaultfd.c                              |   2 +-
 fs/xfs/xfs_file.c                             |   2 +-
 include/linux/dax.h                           |   9 +-
 include/linux/device-mapper.h                 |   2 +-
 include/linux/huge_mm.h                       |  19 +--
 include/linux/memremap.h                      |  11 +-
 include/linux/mm.h                            |  11 +-
 include/linux/pfn.h                           |   9 +-
 include/linux/pfn_t.h                         | 131 +---------------
 include/linux/pgtable.h                       |  25 +---
 include/trace/events/fs_dax.h                 |  12 +-
 mm/Kconfig                                    |   4 +-
 mm/debug_vm_pgtable.c                         |  60 +-------
 mm/gup.c                                      | 162 +-------------------
 mm/hmm.c                                      |  12 +-
 mm/huge_memory.c                              |  98 ++---------
 mm/khugepaged.c                               |   2 +-
 mm/madvise.c                                  |   8 +-
 mm/mapping_dirty_helpers.c                    |   4 +-
 mm/memory.c                                   |  64 ++------
 mm/memremap.c                                 |  28 +---
 mm/migrate.c                                  |   1 +-
 mm/migrate_device.c                           |   2 +-
 mm/mprotect.c                                 |   2 +-
 mm/mremap.c                                   |   5 +-
 mm/page_vma_mapped.c                          |   5 +-
 mm/pagewalk.c                                 |  20 +-
 mm/pgtable-generic.c                          |   7 +-
 mm/userfaultfd.c                              |   6 +-
 mm/vmscan.c                                   |   5 +-
 tools/testing/nvdimm/pmem-dax.c               |   6 +-
 tools/testing/nvdimm/test/iomap.c             |  11 +-
 84 files changed, 216 insertions(+), 955 deletions(-)
 delete mode 100644 include/linux/pfn_t.h

base-commit: cf42737e247a159abe9b0dc065a3ea44808a83a0
-- 
git-series 0.9.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-02-19  5:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-19  5:04 [PATCH RFC v2 00/12] mm: Remove pXX_devmap page table bit and pfn_t type Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 01/12] mm: Remove PFN_MAP, PFN_SG_CHAIN and PFN_SG_LAST Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 02/12] mm: Convert pXd_devmap checks to vma_is_dax Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 03/12] mm/pagewalk: Skip dax pages in pagewalk Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 04/12] mm: Convert vmf_insert_mixed() from using pte_devmap to pte_special Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 05/12] mm: Remove remaining uses of PFN_DEV Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 06/12] mm/gup: Remove pXX_devmap usage from get_user_pages() Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 07/12] mm: Remove redundant pXd_devmap calls Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 08/12] mm/khugepaged: Remove redundant pmd_devmap() check Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 09/12] powerpc: Remove checks for devmap pages and PMDs/PUDs Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 10/12] mm: Remove devmap related functions and page table bits Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 11/12] mm: Remove callers of pfn_t functionality Alistair Popple
2025-02-19  5:04 ` [PATCH RFC v2 12/12] mm/memremap: Remove unused devmap_managed_key Alistair Popple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox