Add helpers to determine if a page or folio is a devdax or fsdax page
or folio.
Signed-off-by: Alistair Popple
Acked-by: David Hildenbrand
---
Changes for v5:
- Renamed is_device_dax_page() to is_devdax_page() for consistency.
---
include/linux/memremap.h | 22 ++
1 file
current mechanism, vmf_insert_pfn_pmd, which
simply inserts a special devmap PMD entry into the page table without
holding a reference to the page for the mapping.
Signed-off-by: Alistair Popple
---
Changes for v5:
- Minor code cleanup suggested by David
---
include/linux/huge_mm.h | 1 +-
mm
->lru with page->pgmap.
Signed-off-by: Alistair Popple
---
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|
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
to remove the pgmap refcounting
that is currently done in mm/gup.c.
Signed-off-by: Alistair Popple
---
Changes since v2:
Based on some questions from Dan I attempted to have the FS DAX page
cache (ie. address space) hold a reference to the folio whilst it was
mapped. However I came to the
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
---
Changes for v5:
- Removed is_huge_zero_pud() as it's unlikely to ever be implemented.
-
At present mlock skips ptes mapping ZONE_DEVICE pages. A future change
to remove pmd_devmap will allow pmd_trans_huge_lock() to return
ZONE_DEVICE folios so make sure we continue to skip those.
Signed-off-by: Alistair Popple
Acked-by: David Hildenbrand
---
mm/mlock.c | 2 ++
1 file changed, 2
never be pinned for
DMA via FOLL_LONGTERM, so add an explicit check in pte_is_pinned() to
reflect that.
Signed-off-by: Alistair Popple
---
Changes for v5:
- After discussion with David remove the checks for DAX pages for
smaps and pagemap walkers. This means DAX pages will now appear in
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 6d74e62..fd
DEVMAP PTEs are no longer required to support ZONE_DEVICE so remove
them.
Signed-off-by: Alistair Popple
Suggested-by: Chunyan Zhang
Reviewed-by: Björn Töpel
---
arch/riscv/Kconfig| 1 -
arch/riscv/include/asm/pgtable-64.h | 20
arch/riscv/include
On Fri, Dec 20, 2024 at 07:52:43PM +0100, David Hildenbrand wrote:
> On 17.12.24 06:12, Alistair Popple wrote:
> > Currently DAX folio/page reference counts are managed differently to
> > normal pages. To allow these to be managed the same as normal pages
> > introduce vmf_i
On Mon, Jan 13, 2025 at 10:12:41PM -0800, Dan Williams wrote:
> Alistair Popple wrote:
> > Device DAX pages are currently not reference counted when mapped,
> > instead relying on the devmap PTE bit to ensure mapping code will not
> > get/put references. This requires specia
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
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
Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax fault
path")
Cc: V
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
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 6d74e62..fd
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
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 v7:
- Fix for checking when creating a
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:
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 5133568..d010c10 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
>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-
-off-by: Alistair Popple
---
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 insert_page_into_pte_locked() change into a separate
patch.
Updates from v1:
- Re-arrange
(). 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
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 v6:
- Minor comment formatting fix
- Add an additional check for CONFIG_TRANSPARENT_HUGEPAGE to fix a
buil
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
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
to remove the pgmap refcounting
that is currently done in mm/gup.c.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
---
Changes for v7:
- s/dax_device_folio_init/dax_folio_init/ as suggested by Dan
- s/dax_folio_share_put/dax_folio_put/
Changes since v2:
Based on some questions
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
---
Changes for v7:
- Added a comment clarifying why we can insert without
On Tue, Feb 04, 2025 at 11:06:08AM -0800, Dan Williams wrote:
> Alistair Popple wrote:
> > On Tue, Jan 14, 2025 at 10:50:49AM -0800, Dan Williams wrote:
> > > Alistair Popple wrote:
> > > > The devmap PTE special bit was used to detect mappings of FS DAX
> > &
On Thu, Feb 06, 2025 at 09:50:07PM -0800, Dan Williams wrote:
> Alistair Popple wrote:
> > On Mon, Jan 13, 2025 at 07:35:07PM -0800, Dan Williams wrote:
> > > Alistair Popple wrote:
> >
> > [...]
> >
> > > ...and here is that aformentioned patch:
&
On Sat, Dec 14, 2024 at 04:22:58PM +0100, David Hildenbrand wrote:
> On 14.12.24 02:39, Dan Williams wrote:
> > [ add akpm and sfr for next steps ]
> >
> > Alistair Popple wrote:
> > > Main updates since v2:
> > >
> > > - Rename the DAX spe
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
---
Changes for v4:
- Fixed some build breakage due to missing symbol exports reported by
John Hubbard (thanks!).
---
fs/dax.c| 30 ++
fs/ext4/inode.c | 10 +-
fs/fuse/dax.c | 29 +
fs/xfs
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:
ed.
The page is considered shared when page->mapping == NULL and
page->share > 0 or page->mapping != NULL, 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 spe
to make it clear that it may advance the
iterator state.
Signed-off-by: Alistair Popple
---
fs/dax.c | 50 +-
1 file changed, 41 insertions(+), 9 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 5133568..d010c10 100644
--- a/fs/dax.c
+++ b/
VICE pages which is one of my
primary motivators for doing this work.
Signed-off-by: Alistair Popple
---
Cc: l...@asahilina.net
Cc: zhang.l...@gmail.com
Cc: gerald.schae...@linux.ibm.com
Cc: dan.j.willi...@intel.com
Cc: vishal.l.ve...@intel.com
Cc: dave.ji...@intel.com
Cc: log...@deltatee.com
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
---
Changes since v2:
- Initialise the page refcount
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
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
---
fs/dax.c| 26 ++
fs/ext4/inode.c | 32 ++-
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 remove the pgmap refcounting
that is currently done in mm/gup.c.
Signed-off-by: Alistair Popple
---
Changes since v2:
Based on some questions from Dan I attempted to have the FS DAX page
cache (ie. address space) hold a reference to the folio whilst it was
mapped. However I came to the
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 6d74e62..fd
->lru with page->pgmap.
Signed-off-by: Alistair Popple
---
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|
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
DEVMAP PTEs are no longer required to support ZONE_DEVICE so remove
them.
Signed-off-by: Alistair Popple
Suggested-by: Chunyan Zhang
Reviewed-by: Björn Töpel
---
arch/riscv/Kconfig| 1 -
arch/riscv/include/asm/pgtable-64.h | 20
arch/riscv/include
The procfs mmu files such as smaps currently ignore device dax and fs
dax pages because these pages are considered special. To maintain
existing behaviour once these pages are treated as normal pages and
returned from vm_normal_page() add tests to explicitly skip them.
Signed-off-by: Alistair
At present mlock skips ptes mapping ZONE_DEVICE pages. A future change
to remove pmd_devmap will allow pmd_trans_huge_lock() to return
ZONE_DEVICE folios so make sure we continue to skip those.
Signed-off-by: Alistair Popple
---
mm/mlock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a
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
---
include/linux/huge_mm.h | 11 +-
mm/huge_memory.c| 96
current mechanism, vmf_insert_pfn_pmd, which
simply inserts a special devmap PMD entry into the page table without
holding a reference to the page for the mapping.
Signed-off-by: Alistair Popple
---
include/linux/huge_mm.h | 1 +-
mm/huge_memory.c| 60
PUD-sized folios so we don't support for
that for now.
Signed-off-by: Alistair Popple
---
David - Thanks for your previous comments, I'm less familiar with the
rmap code so I would appreciate you taking another look. In particular
I haven't added a stat for PUD mapped folios a
>pgmap.
The page->pgmap field is common to all pages within a memory section.
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-by: Alistair Popple
Reviewed-by: Jas
-off-by: Alistair Popple
---
Updates from v2:
- Rename function to make not DAX specific
- Split the insert_page_into_pte_locked() change into a separate
patch.
Updates from v1:
- Re-arrange code in insert_page_into_pte_locked() based on comments
from Jan Kara.
- Call mkdrity/mkyoung
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
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
Add helpers to determine if a page or folio is a device dax or fs dax
page or folio.
Signed-off-by: Alistair Popple
---
include/linux/memremap.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index 0256a42..f2a8d13
On Sun, Dec 15, 2024 at 10:26:55PM -0800, Andrew Morton wrote:
> On Mon, 16 Dec 2024 11:55:30 +1100 Alistair Popple wrote:
>
> > The remainder are more -mm focussed. However they do depend on the fs/dax
> > cleanups in the first half so the trick would be making sure Andr
== 0 in fuse_dax_break_layouts() and pass the entire file
range to dax_layout_busy_page_range().
Signed-off-by: Alistair Popple
Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax fault
path")
Cc: Vivek Goyal
---
I am not at all familiar with the fuse file system d
On Tue, Dec 17, 2024 at 11:14:42PM +0100, David Hildenbrand wrote:
> On 17.12.24 06:12, Alistair Popple wrote:
> > Currently ZONE_DEVICE page reference counts are initialised by core
> > memory management code in __init_zone_device_page() as part of the
> > memremap() call
On Tue, Dec 17, 2024 at 11:27:13PM +0100, David Hildenbrand wrote:
> On 17.12.24 06:12, Alistair Popple wrote:
> > The rmap doesn't currently support adding a PUD mapping of a
> > folio. This patch adds support for entire PUD mappings of folios,
> > primarily to allow for
On Tue, Dec 17, 2024 at 11:31:25PM +0100, David Hildenbrand wrote:
> On 17.12.24 06:13, Alistair Popple wrote:
> > The procfs mmu files such as smaps currently ignore device dax and fs
> > dax pages because these pages are considered special. To maintain
> > existing behaviour
->lru with page->pgmap.
Signed-off-by: Alistair Popple
---
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|
to remove the pgmap refcounting
that is currently done in mm/gup.c.
Signed-off-by: Alistair Popple
---
Changes since v2:
Based on some questions from Dan I attempted to have the FS DAX page
cache (ie. address space) hold a reference to the folio whilst it was
mapped. However I came to the
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
DEVMAP PTEs are no longer required to support ZONE_DEVICE so remove
them.
Signed-off-by: Alistair Popple
Suggested-by: Chunyan Zhang
---
arch/riscv/Kconfig| 1 -
arch/riscv/include/asm/pgtable-64.h | 20
arch/riscv/include/asm/pgtable-bits.h | 1
to make it clear that it may advance the
iterator state.
Signed-off-by: Alistair Popple
---
fs/dax.c | 50 +-
1 file changed, 41 insertions(+), 9 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index a675eb2..efc1d56 100644
--- a/fs/dax.c
+++ b/
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
== 0 in fuse_dax_break_layouts() and pass the entire file
range to dax_layout_busy_page_range().
Signed-off-by: Alistair Popple
Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax fault
path")
Cc: Vivek Goyal
---
I am not at all familiar with the fuse file system d
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
MEMORY_DEVICE_PCI_P2PDMA pages so fix that up.
Signed-off-by: Alistair Popple
Reviewed-by: Dan Williams
---
Changes since v2:
- Initialise the page refcount for all pages covered by the kaddr
---
drivers/pci/p2pdma.c | 13 +++--
mm/memremap.c| 17 +
mm/mm_init.c | 22
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
>pgmap.
The page->pgmap field is common to all pages within a memory section.
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-by: Alistair Popple
Reviewed-by: Jas
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:
memcontrol currently ignores device dax and fs dax pages because these
pages are considered special. To maintain existing behaviour once
these pages are treated as normal pages and returned from
vm_normal_page() add a test to explicitly skip charging them.
Signed-off-by: Alistair Popple
---
mm
-off-by: Alistair Popple
---
Updates from v2:
- Rename function to make not DAX specific
- Split the insert_page_into_pte_locked() change into a separate
patch.
Updates from v1:
- Re-arrange code in insert_page_into_pte_locked() based on comments
from Jan Kara.
- Call mkdrity/mkyoung
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
current mechanism, vmf_insert_pfn_pmd, which
simply inserts a special devmap PMD entry into the page table without
holding a reference to the page for the mapping.
Signed-off-by: Alistair Popple
---
include/linux/huge_mm.h | 1 +-
mm/huge_memory.c| 60
Add helpers to determine if a page or folio is a device dax or fs dax
page or folio.
Signed-off-by: Alistair Popple
---
include/linux/memremap.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index 0256a42..f2a8d13
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
---
include/linux/mm.h
The procfs mmu files such as smaps currently ignore device dax and fs
dax pages because these pages are considered special. To maintain
existing behaviour once these pages are treated as normal pages and
returned from vm_normal_page() add tests to explicitly skip them.
Signed-off-by: Alistair
At present mlock skips ptes mapping ZONE_DEVICE pages. A future change
to remove pmd_devmap will allow pmd_trans_huge_lock() to return
ZONE_DEVICE folios so make sure we continue to skip those.
Signed-off-by: Alistair Popple
---
mm/mlock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a
ed.
The page is considered shared when page->mapping == NULL and
page->share > 0 or page->mapping != NULL, 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 spe
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 6d74e62..fd
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
---
include/linux/huge_mm.h | 11 +-
include/linux/rmap.h| 15 +++-
mm/huge_memory.c
one of my
primary motivators for doing this work.
Signed-off-by: Alistair Popple
---
Cc: l...@asahilina.net
Cc: zhang.l...@gmail.com
Cc: gerald.schae...@linux.ibm.com
Cc: dan.j.willi...@intel.com
Cc: vishal.l.ve...@intel.com
Cc: dave.ji...@intel.com
Cc: log...@deltatee.com
Cc: bhelg...@google
: Alistair Popple
---
fs/dax.c| 29 +
fs/ext4/inode.c | 10 +-
fs/fuse/dax.c | 29 +
fs/xfs/xfs_inode.c | 23 +--
fs/xfs/xfs_inode.h | 2 +-
include/linux/dax.h | 7 +++
6 files changed
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
---
fs/dax.c| 25 +
fs/ext4/inode.c | 32 ++-
John Hubbard writes:
> On 11/21/24 5:40 PM, Alistair Popple wrote:
>> Prior to freeing a block file systems supporting FS DAX must check
>> that the associated pages are both unmapped from user-space and not
>> undergoing DMA or other access from eg. get_user_pages(). T
On Wed, Jan 08, 2025 at 02:30:24PM -0800, Dan Williams wrote:
> Alistair Popple wrote:
> > FS DAX requires file systems to call into the DAX layout prior to
> > unlinking inodes to ensure there is no ongoing DMA or other remote
> > access to the direct mapped page. The fuse f
On Wed, Jan 08, 2025 at 02:50:36PM -0800, Dan Williams wrote:
> Alistair Popple wrote:
> > Several functions internal to FS DAX use the following pattern when
> > trying to obtain an unlocked entry:
> >
> > xas_for_each(&xas, entry, end_idx) {
On Wed, Jan 08, 2025 at 04:14:20PM -0800, Dan Williams wrote:
> Alistair Popple wrote:
> > Prior to freeing a block file systems supporting FS DAX must check
> > that the associated pages are both unmapped from user-space and not
> > undergoing DMA or other access from eg. g
ainly 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 Schofield
---
Cc: l...@asahi
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
Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax fault
path")
Cc: V
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:
501 - 600 of 740 matches
Mail list logo