[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <cover.9f0e45d52f5cff58807831b6b867084d0b14b61c.1725941415.git-series.apopple@nvidia.com>
Date: Tue, 10 Sep 2024 14:14:25 +1000
From: Alistair Popple <apopple@...dia.com>
To: dan.j.williams@...el.com,
linux-mm@...ck.org
Cc: Alistair Popple <apopple@...dia.com>,
vishal.l.verma@...el.com,
dave.jiang@...el.com,
logang@...tatee.com,
bhelgaas@...gle.com,
jack@...e.cz,
jgg@...pe.ca,
catalin.marinas@....com,
will@...nel.org,
mpe@...erman.id.au,
npiggin@...il.com,
dave.hansen@...ux.intel.com,
ira.weiny@...el.com,
willy@...radead.org,
djwong@...nel.org,
tytso@....edu,
linmiaohe@...wei.com,
david@...hat.com,
peterx@...hat.com,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org,
nvdimm@...ts.linux.dev,
linux-cxl@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org,
jhubbard@...dia.com,
hch@....de,
david@...morbit.com
Subject: [PATCH 00/12] fs/dax: Fix FS DAX page reference counts
Main updates since v1:
- Now passes the same number of xfs_test with dax=always as without
this series (some seem to fail on my setup normally). Thanks Dave
for the suggestion as there were some deadlocks/crashes in v1 due
to misshandling of write-protect faults and truncation which should
now be fixed.
- The pgmap field has been moved to the folio (thanks Matthew for the
suggestion).
- No longer remove the vmf_insert_pfn_pXd() functions and instead
refactor them for use by DAX as Peter Xu suggested they will be
needed in future and I see there are patches in linux-next that
call them.
FS DAX pages have always maintained their own page reference counts
without following the normal rules for page reference counting. In
particular pages are considered free when the refcount hits one rather
than zero and refcounts are not added when mapping the page.
Tracking this requires special PTE bits (PTE_DEVMAP) and a secondary
mechanism for allowing GUP to hold references on the page (see
get_dev_pagemap). However there doesn't seem to be any reason why FS
DAX pages need their own reference counting scheme.
By treating the refcounts on these pages the same way as normal pages
we can remove a lot of special checks. In particular pXd_trans_huge()
becomes the same as pXd_leaf(), although I haven't made that change
here. It also frees up a valuable SW define PTE bit on architectures
that have devmap PTE bits defined.
It also almost certainly allows further clean-up of the devmap managed
functions, but I have left that as a future improvment.
I am not intimately familiar with the FS DAX code so would appreciate
some careful review there. In particular I have not given any thought
at all to CONFIG_FS_DAX_LIMITED.
Signed-off-by: Alistair Popple <apopple@...dia.com>
---
Cc: dan.j.williams@...el.com
Cc: vishal.l.verma@...el.com
Cc: dave.jiang@...el.com
Cc: logang@...tatee.com
Cc: bhelgaas@...gle.com
Cc: jack@...e.cz
Cc: jgg@...pe.ca
Cc: catalin.marinas@....com
Cc: will@...nel.org
Cc: mpe@...erman.id.au
Cc: npiggin@...il.com
Cc: dave.hansen@...ux.intel.com
Cc: ira.weiny@...el.com
Cc: willy@...radead.org
Cc: djwong@...nel.org
Cc: tytso@....edu
Cc: linmiaohe@...wei.com
Cc: david@...hat.com
Cc: peterx@...hat.com
Cc: linux-doc@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: nvdimm@...ts.linux.dev
Cc: linux-cxl@...r.kernel.org
Cc: linux-fsdevel@...r.kernel.org
Cc: linux-mm@...ck.org
Cc: linux-ext4@...r.kernel.org
Cc: linux-xfs@...r.kernel.org
Cc: jhubbard@...dia.com
Cc: hch@....de
Cc: david@...morbit.com
Alistair Popple (12):
mm/gup.c: Remove redundant check for PCI P2PDMA page
pci/p2pdma: Don't initialise page refcount to one
fs/dax: Refactor wait for dax idle page
mm: Allow compound zone device pages
mm/memory: Add dax_insert_pfn
huge_memory: Allow mappings of PUD sized pages
huge_memory: Allow mappings of PMD sized pages
gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages
mm: Update vm_normal_page() callers to accept FS DAX pages
fs/dax: Properly refcount fs dax pages
mm: Remove pXX_devmap callers
mm: Remove devmap related functions and page table bits
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/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 | 52 +----
arch/powerpc/include/asm/book3s/64/radix.h | 14 +-
arch/powerpc/mm/book3s64/hash_pgtable.c | 3 +-
arch/powerpc/mm/book3s64/pgtable.c | 8 +-
arch/powerpc/mm/book3s64/radix_pgtable.c | 5 +-
arch/powerpc/mm/pgtable.c | 2 +-
arch/x86/Kconfig | 1 +-
arch/x86/include/asm/pgtable.h | 50 +----
arch/x86/include/asm/pgtable_types.h | 5 +-
arch/x86/mm/pat/memtype.c | 4 +-
drivers/dax/device.c | 12 +-
drivers/dax/super.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 +-
drivers/nvdimm/pmem.c | 4 +-
drivers/pci/p2pdma.c | 12 +-
fs/dax.c | 197 ++++++++---------
fs/ext4/inode.c | 5 +-
fs/fuse/dax.c | 4 +-
fs/fuse/virtio_fs.c | 3 +-
fs/proc/task_mmu.c | 16 +-
fs/userfaultfd.c | 2 +-
fs/xfs/xfs_inode.c | 4 +-
include/linux/dax.h | 12 +-
include/linux/huge_mm.h | 15 +-
include/linux/memremap.h | 17 +-
include/linux/migrate.h | 4 +-
include/linux/mm.h | 39 +---
include/linux/mm_types.h | 9 +-
include/linux/mmzone.h | 8 +-
include/linux/page-flags.h | 6 +-
include/linux/pfn_t.h | 20 +--
include/linux/pgtable.h | 21 +--
include/linux/rmap.h | 15 +-
lib/test_hmm.c | 3 +-
mm/Kconfig | 4 +-
mm/debug_vm_pgtable.c | 59 +-----
mm/gup.c | 177 +---------------
mm/hmm.c | 12 +-
mm/huge_memory.c | 221 +++++++++++--------
mm/internal.h | 2 +-
mm/khugepaged.c | 2 +-
mm/mapping_dirty_helpers.c | 4 +-
mm/memcontrol-v1.c | 2 +-
mm/memory-failure.c | 6 +-
mm/memory.c | 126 +++++++----
mm/memremap.c | 53 ++---
mm/migrate_device.c | 9 +-
mm/mlock.c | 2 +-
mm/mm_init.c | 23 +-
mm/mprotect.c | 2 +-
mm/mremap.c | 5 +-
mm/page_vma_mapped.c | 5 +-
mm/pagewalk.c | 8 +-
mm/pgtable-generic.c | 7 +-
mm/rmap.c | 49 ++++-
mm/swap.c | 2 +-
mm/userfaultfd.c | 2 +-
mm/vmscan.c | 5 +-
65 files changed, 591 insertions(+), 819 deletions(-)
base-commit: 6f1833b8208c3b9e59eff10792667b6639365146
--
git-series 0.9.1
Powered by blists - more mailing lists