On Mon, Jun 30, 2025 at 08:58:03AM +0800, Huang, Ying wrote:
> Alistair Popple writes:
>
> > On Sun, Jun 29, 2025 at 07:28:50PM +0800, Huang, Ying wrote:
> >> David Hildenbrand writes:
> >>
> >> > On 18.06.25 20:48, Zi Yan wrote:
> >>
On Sun, Jun 29, 2025 at 07:28:50PM +0800, Huang, Ying wrote:
> David Hildenbrand writes:
>
> > On 18.06.25 20:48, Zi Yan wrote:
> >> On 18 Jun 2025, at 14:39, Matthew Wilcox wrote:
> >>
> >>> On Wed, Jun 18, 2025 at 02:14:15PM -0400, Zi Yan wrote:
> On 18 Jun 2025, at 13:39, David Hildenbra
for dax vma's, hence we would never expect to see a
pmd_devmap entry.
Signed-off-by: Alistair Popple
Acked-by: David Hildenbrand
Reviewed-by: Jason Gunthorpe
---
Changes from v2:
- Update commit message to better reflect why the check was redundant
---
mm/khugepaged.c | 2 --
1 file ch
The dcssblk driver was the last user of FS_DAX_LIMITED. That was marked
broken by 653d7825c149 ("dcssblk: mark DAX broken, remove FS_DAX_LIMITED
support") to allow removal of PFN_SPECIAL. However the FS_DAX_LIMITED
config option itself was not removed, so do that now.
Signed-off-by
N_DEV were removed earlier in this series by "mm: Remove
remaining uses of PFN_DEV".
Acked-by: David Hildenbrand
Reviewed-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
Signed-off-by: Alistair Popple
---
I'm now tempted to squash this change into
j...@groves.net
Cc: m.szyprow...@samsung.com
Alistair Popple (14):
mm: Convert pXd_devmap checks to vma_is_dax
mm: Filter zone device pages returned from folio_walk_start()
mm: Remove remaining uses of PFN_DEV
mm: Convert vmf_insert_mixed() from using pte_devmap to pte_special
mm/gup: Remov
zone device pages so
don't need updating. However some don't, so add checks to those callers.
Signed-off-by: Alistair Popple
---
Changes since v2:
- Drop filtering in s390 secure fault handling as suggested by David
Changes since v1:
- Dropped "mm/pagewalk: Skip dax pages i
vmf_insert_mixed(). This is unnecessary as it is no longer checked, instead
relying on pfn_valid() to determine if there is an associated page or not.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
Changes since v1:
- Removed
On Tue, Jun 17, 2025 at 11:19:34AM +0200, David Hildenbrand wrote:
> On 16.06.25 13:58, Alistair Popple wrote:
> > Currently dax is the only user of pmd and pud mapped ZONE_DEVICE
> > pages. Therefore page walkers that want to exclude DAX pages can check
> > pmd_devmap or pud
PFN_DEV no longer exists. This means no devmap PMDs or PUDs will be
created, so checking for them is redundant. Instead mappings of pages that
would have previously returned true for pXd_devmap() will return true for
pXd_trans_huge()
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
It's no longer used so remove it.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Acked-by: David Hildenbrand
---
mm/memremap.c | 27 ---
1 file changed, 27 deletions(-)
diff --git a/mm/memremap.c b/mm/memremap.c
index 044a455..f75078c 100644
---
ng on that would have been
a bug.
Signed-off-by: Alistair Popple
---
Changes since v1:
- New for v2
---
mm/huge_memory.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index b096240..6514e25 100644
--- a/mm/huge_memory.
On Tue, Jun 17, 2025 at 11:49:20AM +0200, David Hildenbrand wrote:
> On 16.06.25 13:58, Alistair Popple wrote:
> > Nothing uses PFN_DEV anymore so no need to create devmap pXd's when
> > mapping a PFN. Instead special mappings will be created which ensures
> > vm_normal_
behaviour as it will always be false.
Signed-off-by: Alistair Popple
---
Changes since v1:
- Removed a new pud_devmap() call added to __relocate_anon_folios().
This could never have been hit as only DAX created pud_devmap entries
and never for anonymous VMA's.
---
fs/
All PFN_* pfn_t flags have been removed. Therefore there is no longer
a need for the pfn_t type and all uses can be replaced with normal
pfns.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Acked-by: David Hildenbrand
---
Changes since v1
Now that DAX and all other reference counts to ZONE_DEVICE pages are
managed normally there is no need for the special devmap PTE/PMD/PUD
page table bits. So drop all references to these, freeing up a
software defined page table bit on architectures supporting it.
Signed-off-by: Alistair Popple
memmap so there is no need to hold a reference on the pgmap
data structure to ensure this.
Furthermore mappings with PFN_DEV are no longer created, hence this
effectively dead code anyway so can be removed.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
--
;t support pte_devmap
so those will continue to rely on pfn_valid() to determine if the page can
be mapped.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
mm/hmm.c| 3 ---
mm/memory.c | 20 ++--
mm/vmscan.c | 2 +-
3 files changed, 3
nt as
vma_can_userfault() should have already filtered out dax vma's.
For HMM the pud_devmap check seems unnecessary as there is no reason we
shouldn't be able to handle any leaf PUD here so remove it also.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
--
On Tue, Jun 17, 2025 at 11:44:30AM +0200, David Hildenbrand wrote:
> On 16.06.25 13:58, Alistair Popple wrote:
> > The only users of pmd_devmap were device dax and fs dax. The check for
> > pmd_devmap() in check_pmd_state() is therefore redundant as callers
> >
On Tue, Jun 17, 2025 at 11:30:20AM +0200, David Hildenbrand wrote:
> On 17.06.25 11:25, David Hildenbrand wrote:
> > On 16.06.25 13:58, Alistair Popple wrote:
> > > Previously dax pages were skipped by the pagewalk code as pud_special() or
> > > vm_normal_page{_pmd}() w
zone device pages so
don't need updating. However some don't, so add checks to those callers.
Signed-off-by: Alistair Popple
---
Changes since v1:
- Dropped "mm/pagewalk: Skip dax pages in pagewalk" and replaced it
with this new patch for v2
- As suggested by David and
All PFN_* pfn_t flags have been removed. Therefore there is no longer
a need for the pfn_t type and all uses can be replaced with normal
pfns.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
Changes since v1:
- Rebased on David's clea
It's no longer used so remove it.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
---
mm/memremap.c | 27 ---
1 file changed, 27 deletions(-)
diff --git a/mm/memremap.c b/mm/memremap.c
index 044a455..f75078c 100644
--- a/mm/memremap.c
+++ b/mm/memre
Now that DAX and all other reference counts to ZONE_DEVICE pages are
managed normally there is no need for the special devmap PTE/PMD/PUD
page table bits. So drop all references to these, freeing up a
software defined page table bit on architectures supporting it.
Signed-off-by: Alistair Popple
-by: David Hildenbrand
Reviewed-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
Signed-off-by: Alistair Popple
---
Changes since v1:
- Moved this later in series, after PFN_DEV has been removed. This
should solve an issue reported by Marek[1] on RISC-V (and probably
The dcssblk driver was the last user of FS_DAX_LIMITED. That was marked
broken by 653d7825c149 ("dcssblk: mark DAX broken, remove FS_DAX_LIMITED
support") to allow removal of PFN_SPECIAL. However the FS_DAX_LIMITED
config option itself was not removed, so do that now.
Signed-off-by
pXd_devmap to skip DAX pages
continue to do so by adding explicit checks of the VMA instead.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
Changes from v1:
- Remove vma_is_dax() check from mm/userfaultfd.c as
validate_move_areas() will already skip
PFN_DEV no longer exists. This means no devmap PMDs or PUDs will be
created, so checking for them is redundant. Instead mappings of pages that
would have previously returned true for pXd_devmap() will return true for
pXd_trans_huge()
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
The only users of pmd_devmap were device dax and fs dax. The check for
pmd_devmap() in check_pmd_state() is therefore redundant as callers
explicitly check for is_zone_device_page(), so this check can be dropped.
Signed-off-by: Alistair Popple
Acked-by: David Hildenbrand
Reviewed-by: Jason
ng on that would have been
a bug.
Signed-off-by: Alistair Popple
---
Changes since v1:
- New for v2
---
mm/huge_memory.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index b096240..6514e25 100644
--- a/mm/huge_memory.
behaviour as it will always be false.
Signed-off-by: Alistair Popple
---
Changes since v1:
- Removed a new pud_devmap() call added to __relocate_anon_folios().
This could never have been hit as only DAX created pud_devmap entries
and never for anonymous VMA's.
---
fs/
.dev
Cc: linux-...@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: j...@groves.net
Cc: m.szyprow...@samsung.com
Alistair Popple (14):
mm: Convert pXd_devmap checks to vma_is_dax
mm: Filter zone device pages returned from folio_walk_start()
mm: Convert vmf_insert_mixed() from using pte_devmap
memmap so there is no need to hold a reference on the pgmap
data structure to ensure this.
Furthermore mappings with PFN_DEV are no longer created, hence this
effectively dead code anyway so can be removed.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
--
vmf_insert_mixed(). This is unnecessary as it is no longer checked, instead
relying on pfn_valid() to determine if there is an associated page or not.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
Changes since v1:
- Removed
;t support pte_devmap
so those will continue to rely on pfn_valid() to determine if the page can
be mapped.
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
mm/hmm.c| 3 ---
mm/memory.c | 20 ++--
mm/vmscan.c | 2 +-
3 files changed, 3
On Thu, Jun 12, 2025 at 03:15:31PM +0100, Lorenzo Stoakes wrote:
> On Thu, May 29, 2025 at 04:32:04PM +1000, Alistair Popple wrote:
> > Previously dax pages were skipped by the pagewalk code as pud_special() or
> > vm_normal_page{_pmd}() would be false for DAX pages. Now tha
On Thu, Jun 12, 2025 at 05:02:13PM +1000, Alistair Popple wrote:
> On Thu, Jun 05, 2025 at 09:21:28AM -0700, Dan Williams wrote:
> > David Hildenbrand wrote:
> > > On 05.06.25 09:46, Christoph Hellwig wrote:
> > > > On Wed, Jun 04, 2025 at 06:59:09PM -0700, Dan Willi
On Thu, Jun 05, 2025 at 09:21:28AM -0700, Dan Williams wrote:
> David Hildenbrand wrote:
> > On 05.06.25 09:46, Christoph Hellwig wrote:
> > > On Wed, Jun 04, 2025 at 06:59:09PM -0700, Dan Williams wrote:
> > >> +/* return normal pages backed by the page allocator */
> > >> +static inline struct pa
On Fri, May 30, 2025 at 11:37:21AM +0200, David Hildenbrand wrote:
> On 29.05.25 08:32, Alistair Popple wrote:
> > Currently dax is the only user of pmd and pud mapped ZONE_DEVICE
> > pages. Therefore page walkers that want to exclude DAX pages can check
> > pmd_devmap or pud
On Mon, Jun 02, 2025 at 06:54:27AM +0200, Christoph Hellwig wrote:
> On Thu, May 29, 2025 at 04:32:02PM +1000, Alistair Popple wrote:
> > The PFN_MAP flag is no longer used for anything, so remove it. The
> > PFN_SG_CHAIN and PFN_SG_LAST flags never appear to have been used so
>
On Thu, May 29, 2025 at 12:46:20PM +0100, Jonathan Cameron wrote:
> On Thu, 29 May 2025 16:32:02 +1000
> Alistair Popple wrote:
>
> > The PFN_MAP flag is no longer used for anything, so remove it. The
> > PFN_SG_CHAIN and PFN_SG_LAST flags never appear to have been used so
vmf_insert_mixed(). This is unnecessary as it is no longer checked, instead
relying on pfn_valid() to determine if there is an associated page or not.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
---
drivers/gpu/drm/gma500/fbdev.c | 2 +-
drivers/gpu/drm/omapdrm/omap_gem.c | 5
It's no longer used so remove it.
Signed-off-by: Alistair Popple
---
mm/memremap.c | 27 ---
1 file changed, 27 deletions(-)
diff --git a/mm/memremap.c b/mm/memremap.c
index 2ea5322..5deb181 100644
--- a/mm/memremap.c
+++ b/mm/memremap.c
@@ -38,30 +38,6 @@ unsigned
All PFN_* pfn_t flags have been removed. Therefore there is no longer
a need for the pfn_t type and all uses can be replaced with normal
pfns.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
---
arch/x86/mm/pat/memtype.c| 6 +-
drivers/dax/device.c
behaviour as it will always be false.
Signed-off-by: Alistair Popple
---
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
Now that DAX and all other reference counts to ZONE_DEVICE pages are
managed normally there is no need for the special devmap PTE/PMD/PUD
page table bits. So drop all references to these, freeing up a
software defined page table bit on architectures supporting it.
Signed-off-by: Alistair Popple
PFN_DEV no longer exists. This means no devmap PMDs or PUDs will be
created, so checking for them is redundant. Instead mappings of pages that
would have previously returned true for pXd_devmap() will return true for
pXd_trans_huge()
Signed-off-by: Alistair Popple
---
arch/powerpc/mm/book3s64
The only users of pmd_devmap were device dax and fs dax. The check for
pmd_devmap() in check_pmd_state() is therefore redundant as callers
explicitly check for is_zone_device_page(), so this check can be dropped.
Signed-off-by: Alistair Popple
---
mm/khugepaged.c | 2 --
1 file changed, 2
pXd_devmap to skip DAX pages
continue to do so by adding explicit checks of the VMA instead.
Signed-off-by: Alistair Popple
---
fs/userfaultfd.c | 2 +-
mm/hmm.c | 2 +-
mm/userfaultfd.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
memmap so there is no need to hold a reference on the pgmap
data structure to ensure this.
Furthermore mappings with PFN_DEV are no longer created, hence this
effectively dead code anyway so can be removed.
Signed-off-by: Alistair Popple
---
include/linux/huge_mm.h | 3 +-
mm/gup.c
;t support pte_devmap
so those will continue to rely on pfn_valid() to determine if the page can
be mapped.
Signed-off-by: Alistair Popple
---
mm/hmm.c| 3 ---
mm/memory.c | 20 ++--
mm/vmscan.c | 2 +-
3 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/mm/hmm.c b/mm/h
@lists.ozlabs.org
Cc: linux-ri...@lists.infradead.org
Cc: nvd...@lists.linux.dev
Cc: linux-...@vger.kernel.org
Cc: dri-de...@lists.freedesktop.org
Cc: j...@groves.net
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: S
Previously dax pages were skipped by the pagewalk code as pud_special() or
vm_normal_page{_pmd}() would be false for DAX pages. Now that dax pages are
refcounted normally that is no longer the case, so add explicit checks to
skip them.
Signed-off-by: Alistair Popple
---
include/linux/memremap.h
The PFN_MAP flag is no longer used for anything, so remove it. The
PFN_SG_CHAIN and PFN_SG_LAST flags never appear to have been used so
also remove them.
Signed-off-by: Alistair Popple
Reviewed-by: Christoph Hellwig
---
include/linux/pfn_t.h | 31 +++
mm
to make it clear that it may advance the
iterator state.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
---
fs/dax.c | 50 +-
1 file changed, 41 insertions(+), 9 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index b35f538..f5fdb43 1006
PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the
check in __gup_device_huge() is redundant. Remove it
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Wiliams
Acked-by: David Hildenbrand
---
mm/gup.c | 5 -
1 file changed, 5 deletions
user-space
with mapping_mapped() and returns early if not, skipping the check for
DMA busy pages. This is wrong as pages may still be undergoing DMA
access even if they have subsequently been unmapped from
user-space. Fix this by dropping the check for mapping_mapped().
Signed-off-by: Alistair
t the pages normally as defined by vm_normal_page().
Signed-off-by: Alistair Popple
Changes for v9:
- Fix warnings when pgmap->ops isn't defined for FS_DAX, reported by
Gerald Schaefer.
---
drivers/dax/device.c | 15 +--
mm/memremap.c| 14 +++---
2 file
tair
On Fri, Feb 28, 2025 at 02:30:55PM +1100, Alistair Popple wrote:
> Main updates since v8:
>
> - Fixed reading of bad pgmap in migrate_vma_collect_pmd() as reported/fixed
>by Balbir.
>
> - Fixed bad warnings generated in free_zone_device_folio() when pgmap->ops
>
ystem block to be freed will not wait for the
remote access to complete. Therefore a busy block may be reallocated to a
new file leading to corruption.
Signed-off-by: Alistair Popple
---
Changes for v7:
- Don't take locks during inode eviction as suggested by Darrick and
therefore
rchitectures
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. It also
enables support for compound ZONE_DEVICE pages which is one of my
primary motivators for doing this work.
Signed-off-
when the file-system
calls dax_break_mapping() as part of it's truncate operation. This
ensures only idle pages can be removed from the FS DAX page-cache and
makes it easy to detect if a file-system hasn't called
dax_break_mapping() prior to a truncate operation.
Signed-off-by:
L, implying it is present in at
least one address space. This also makes it easier for a future change to
detect when a page is first mapped into an address space which requires
special handling.
Signed-off-by: Alistair Popple
---
Changes for v8:
- Rebased on mm-unstable which includes Matthe
to remove the pgmap refcounting
that is currently done in mm/gup.c.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
---
Changes for v8:
- Rebased on mm-unstable - conflicts with Matthew's earlier changes.
- Made dax_folio_put() easier to read thanks to David's s
Gorbik
Cc: Christian Borntraeger
Cc: Sven Schnelle
Cc: Jan Kara
Cc: Matthew Wilcox
Cc: Christoph Hellwig
Cc: Alistair Popple
Signed-off-by: Dan Williams
---
Documentation/filesystems/dax.rst | 1 -
drivers/s390/block/Kconfig| 12 ++--
drivers/s390/block/dcssblk.c
Longterm pinning of FS DAX pages should already be disallowed by
various pXX_devmap checks. However a future change will cause these
checks to be invalid for FS DAX pages so make
folio_is_longterm_pinnable() return false for FS DAX pages.
Signed-off-by: Alistair Popple
Reviewed-by: John Hubbard
current mechanism, vmf_insert_pfn_pud, which
simply inserts a special devmap PUD entry into the page table without
holding a reference to the page for the mapping.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
Acked-by: David Hildenbrand
---
Changes for v7:
- Added a comment
In preparation for using insert_page() for DAX, enhance
insert_page_into_pte_locked() to handle establishing writable
mappings. Recall that DAX returns VM_FAULT_NOPAGE after installing a
PTE which bypasses the typical set_pte_range() in finish_fault.
Signed-off-by: Alistair Popple
Suggested-by
(). This is because
PTE faults require only a subpage of the folio to be PTE mapped rather than
the entire folio. It would be possible to add this context somewhere but
callers already need to handle PTE faults and PMD faults separately so a
more generic function is not useful.
Signed-off-by: Alistair
-off-by: Alistair Popple
Acked-by: David Hildenbrand
---
Changes for v8:
- Remove temp suggested by David.
Changes for v7:
- Fix vmf_insert_page_mkwrite by removing pfn gunk as suggested by
David.
Updates from v2:
- Rename function to make not DAX specific
- Split the
PUD-sized folios so we don't support for
that for now.
Signed-off-by: Alistair Popple
Acked-by: David Hildenbrand
Reviewed-by: Dan Williams
---
Changes for v8:
- Rebase on mm-unstable, only a minor conflict due to code addition
at the same place.
Changes for v6:
- Minor comment
>pgmap.
The page->pgmap field must be common to all pages within a folio, even
if the folio spans memory sections. Therefore pgmap is the same for
both head and tail pages and can be moved into the folio and we can
use the standard scheme to find compound_head from a tail page.
Signed-off-
refcount as
required. P2PDMA uses vm_insert_page() to map the page, and that
requires a non-zero reference count when initialising the page so set
that when the page is first mapped.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
Acked-by: David Hildenbrand
---
Changes since v2
A FS DAX page is considered idle when its refcount drops to one. This
is currently open-coded in all file systems supporting FS DAX. Move
the idle detection to a common function to make future changes easier.
Signed-off-by: Alistair Popple
Reviewed-by: Jan Kara
Reviewed-by: Christoph Hellwig
: Alistair Popple
Reviewed-by: Dan Williams
---
Changes for v7:
- Fix smatch warning, also reported by Dan and Darrick
- Make sure xfs_break_layouts() can return -ERESTARTSYS, reported by
Darrick
- Use common definition of dax_page_is_idle()
- Removed misplaced hunk changing madvise
to fuse_dax_break_layouts()
which will invalidate the entire file range to
dax_layout_busy_page_range().
Signed-off-by: Alistair Popple
Co-developed-by: Dan Williams
Signed-off-by: Dan Williams
Reviewed-by: Balbir Singh
Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax
On Thu, Feb 20, 2025 at 07:33:34PM +0100, Gerald Schaefer wrote:
> On Tue, 18 Feb 2025 14:55:36 +1100
> Alistair Popple wrote:
>
> [...]
> > diff --git a/mm/memremap.c b/mm/memremap.c
> > index 9a8879b..532a52a 100644
> > --- a/mm/memremap.c
> > +++ b/mm/memre
On Tue, Feb 18, 2025 at 12:37:28PM +0100, David Hildenbrand wrote:
> On 18.02.25 04:55, Alistair Popple wrote:
> > Currently fs dax pages are considered free when the refcount drops to
> > one and their refcounts are not increased when mapped via PTEs or
> > decreased when un
PUD-sized folios so we don't support for
that for now.
Signed-off-by: Alistair Popple
Acked-by: David Hildenbrand
Reviewed-by: Dan Williams
---
Changes for v8:
- Rebase on mm-unstable, only a minor conflict due to code addition
at the same place.
Changes for v6:
- Minor comment
: Alistair Popple
Reviewed-by: Dan Williams
---
Changes for v7:
- Fix smatch warning, also reported by Dan and Darrick
- Make sure xfs_break_layouts() can return -ERESTARTSYS, reported by
Darrick
- Use common definition of dax_page_is_idle()
- Removed misplaced hunk changing madvise
to remove the pgmap refcounting
that is currently done in mm/gup.c.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
---
Changes for v8:
- Rebased on mm-unstable - conflicts with Matthew's earlier changes.
- Made dax_folio_put() easier to read thanks to David's s
PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the
check in __gup_device_huge() is redundant. Remove it
Signed-off-by: Alistair Popple
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Wiliams
Acked-by: David Hildenbrand
---
mm/gup.c | 5 -
1 file changed, 5 deletions
L, implying it is present in at
least one address space. This also makes it easier for a future change to
detect when a page is first mapped into an address space which requires
special handling.
Signed-off-by: Alistair Popple
---
Changes for v8:
- Rebased on mm-unstable which includes Matthe
t the pages normally as defined by vm_normal_page().
Signed-off-by: Alistair Popple
---
drivers/dax/device.c | 15 +--
mm/memremap.c| 13 ++---
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index bc871a3..32
Gorbik
Cc: Christian Borntraeger
Cc: Sven Schnelle
Cc: Jan Kara
Cc: Matthew Wilcox
Cc: Christoph Hellwig
Cc: Alistair Popple
Signed-off-by: Dan Williams
---
Documentation/filesystems/dax.rst | 1 -
drivers/s390/block/Kconfig| 12 ++--
drivers/s390/block/dcssblk.c
-off-by: Alistair Popple
Acked-by: David Hildenbrand
---
Changes for v8:
- Remove temp suggested by David.
Changes for v7:
- Fix vmf_insert_page_mkwrite by removing pfn gunk as suggested by
David.
Updates from v2:
- Rename function to make not DAX specific
- Split the
Longterm pinning of FS DAX pages should already be disallowed by
various pXX_devmap checks. However a future change will cause these
checks to be invalid for FS DAX pages so make
folio_is_longterm_pinnable() return false for FS DAX pages.
Signed-off-by: Alistair Popple
Reviewed-by: John Hubbard
(). This is because
PTE faults require only a subpage of the folio to be PTE mapped rather than
the entire folio. It would be possible to add this context somewhere but
callers already need to handle PTE faults and PMD faults separately so a
more generic function is not useful.
Signed-off-by: Alistair
current mechanism, vmf_insert_pfn_pud, which
simply inserts a special devmap PUD entry into the page table without
holding a reference to the page for the mapping.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
Acked-by: David Hildenbrand
---
Changes for v7:
- Added a comment
In preparation for using insert_page() for DAX, enhance
insert_page_into_pte_locked() to handle establishing writable
mappings. Recall that DAX returns VM_FAULT_NOPAGE after installing a
PTE which bypasses the typical set_pte_range() in finish_fault.
Signed-off-by: Alistair Popple
Suggested-by
>pgmap.
The page->pgmap field must be common to all pages within a folio, even
if the folio spans memory sections. Therefore pgmap is the same for
both head and tail pages and can be moved into the folio and we can
use the standard scheme to find compound_head from a tail page.
Signed-off-
refcount as
required. P2PDMA uses vm_insert_page() to map the page, and that
requires a non-zero reference count when initialising the page so set
that when the page is first mapped.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
Acked-by: David Hildenbrand
---
Changes since v2
ystem block to be freed will not wait for the
remote access to complete. Therefore a busy block may be reallocated to a
new file leading to corruption.
Signed-off-by: Alistair Popple
---
Changes for v7:
- Don't take locks during inode eviction as suggested by Darrick and
therefore
to make it clear that it may advance the
iterator state.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
---
fs/dax.c | 50 +-
1 file changed, 41 insertions(+), 9 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index b35f538..f5fdb43 1006
when the file-system
calls dax_break_mapping() as part of it's truncate operation. This
ensures only idle pages can be removed from the FS DAX page-cache and
makes it easy to detect if a file-system hasn't called
dax_break_mapping() prior to a truncate operation.
Signed-off-by:
A FS DAX page is considered idle when its refcount drops to one. This
is currently open-coded in all file systems supporting FS DAX. Move
the idle detection to a common function to make future changes easier.
Signed-off-by: Alistair Popple
Reviewed-by: Jan Kara
Reviewed-by: Christoph Hellwig
ts defined.
It also almost certainly allows further clean-up of the devmap managed
functions, but I have left that as a future improvment. It also
enables support for compound ZONE_DEVICE pages which is one of my
primary motivators for doing this work.
Signed-off-by: Alistair Popple
Tested-by: Alison
user-space
with mapping_mapped() and returns early if not, skipping the check for
DMA busy pages. This is wrong as pages may still be undergoing DMA
access even if they have subsequently been unmapped from
user-space. Fix this by dropping the check for mapping_mapped().
Signed-off-by: Alistair
to fuse_dax_break_layouts()
which will invalidate the entire file range to
dax_layout_busy_page_range().
Signed-off-by: Alistair Popple
Co-developed-by: Dan Williams
Signed-off-by: Dan Williams
Reviewed-by: Balbir Singh
Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax
1 - 100 of 740 matches
Mail list logo