Re: [PATCH 00/13] fs/dax: Fix FS DAX page reference counts

2024-06-26 Thread Dan Williams
Alistair Popple wrote: > 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. >

Re: [PATCH 01/13] mm/gup.c: Remove redundant check for PCI P2PDMA page

2024-06-26 Thread Dan Williams
Alistair Popple wrote: > 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 > Acked-by: David Hildenbrand Acked-by: Dan Williams

Re: [PATCH 10/13] fs/dax: Properly refcount fs dax pages

2024-06-26 Thread Christoph Hellwig
> diff --git a/drivers/dax/device.c b/drivers/dax/device.c > index eb61598..b7a31ae 100644 > --- a/drivers/dax/device.c > +++ b/drivers/dax/device.c > @@ -126,11 +126,11 @@ static vm_fault_t __dev_dax_pte_fault(struct dev_dax > *dev_dax, > return VM_FAULT_SIGBUS; > } > > -

Re: [PATCH 05/13] mm: Allow compound zone device pages

2024-06-26 Thread Christoph Hellwig
On Thu, Jun 27, 2024 at 10:54:20AM +1000, Alistair Popple wrote: > static struct nouveau_dmem_chunk *nouveau_page_to_chunk(struct page *page) > { > - return container_of(page->pgmap, struct nouveau_dmem_chunk, pagemap); > + return container_of(page_dev_pagemap(page), struct nouveau_dmem_c

Re: [PATCH 04/13] fs/dax: Add dax_page_free callback

2024-06-26 Thread Christoph Hellwig
On Thu, Jun 27, 2024 at 10:54:19AM +1000, Alistair Popple wrote: > When a fs dax page is freed it has to notify filesystems that the page > has been unpinned/unmapped and is free. Currently this involves > special code in the page free paths to detect a transition of refcount > from 2 to 1 and to c

Re: [PATCH 03/13] fs/dax: Refactor wait for dax idle page

2024-06-26 Thread Christoph Hellwig
On Thu, Jun 27, 2024 at 10:54:18AM +1000, Alistair Popple wrote: > 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:

Re: [PATCH 02/13] pci/p2pdma: Don't initialise page refcount to one

2024-06-26 Thread Christoph Hellwig
On Thu, Jun 27, 2024 at 10:54:17AM +1000, Alistair Popple wrote: > The reference counts for ZONE_DEVICE private pages should be > initialised by the driver when the page is actually allocated by the > driver allocator, not when they are first created. This is currently > the case for MEMORY_DEVICE_

Re: [PATCH 06/13] mm/memory: Add dax_insert_pfn

2024-06-26 Thread Christoph Hellwig
On Thu, Jun 27, 2024 at 10:54:21AM +1000, Alistair Popple wrote: > +extern void prep_compound_page(struct page *page, unsigned int order); No need for the extern. > static int insert_page_into_pte_locked(struct vm_area_struct *vma, pte_t > *pte, > - unsigned long addr, struc

Re: [PATCH v2 2/2] Documentation: best practices for using Link trailers

2024-06-26 Thread Randy Dunlap
On 6/26/24 8:51 PM, Thorsten Leemhuis wrote: > On 27.06.24 01:17, Randy Dunlap wrote: >> On 6/26/24 4:13 PM, Jonathan Corbet wrote: >>> Konstantin Ryabitsev writes: On Fri, Jun 21, 2024 at 02:07:44PM GMT, Kees Cook wrote: > On Wed, Jun 19, 2024 at 02:24:07PM -0400, Konstantin Ryabitsev

Re: [PATCH v2 2/2] Documentation: best practices for using Link trailers

2024-06-26 Thread Thorsten Leemhuis
On 27.06.24 01:17, Randy Dunlap wrote: > On 6/26/24 4:13 PM, Jonathan Corbet wrote: >> Konstantin Ryabitsev writes: >>> On Fri, Jun 21, 2024 at 02:07:44PM GMT, Kees Cook wrote: On Wed, Jun 19, 2024 at 02:24:07PM -0400, Konstantin Ryabitsev wrote: > + This URL should be used when referri

[PATCH 13/13] mm: Remove devmap related functions and page table bits

2024-06-26 Thread Alistair Popple
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 -

[PATCH 12/13] mm: Remove pXX_devmap callers

2024-06-26 Thread Alistair Popple
The devmap PTE special bit was used to detect mappings of FS DAX pages. This tracking was required to ensure the generic mm did not manipulate the page reference counts as FS DAX implemented it's own reference counting scheme. Now that FS DAX pages have their references counted the same way as nor

[PATCH 11/13] huge_memory: Remove dead vmf_insert_pXd code

2024-06-26 Thread Alistair Popple
Now that DAX is managing page reference counts the same as normal pages there are no callers for vmf_insert_pXd functions so remove them. Signed-off-by: Alistair Popple --- include/linux/huge_mm.h | 2 +- mm/huge_memory.c| 165 +- 2 files changed

[PATCH 10/13] fs/dax: Properly refcount fs dax pages

2024-06-26 Thread Alistair Popple
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 unmapped. This requires special logic in mm paths to detect that these pages should not be properly refcounted, and to detect when the refcount drop

[PATCH 09/13] gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2024-06-26 Thread Alistair Popple
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/memremap

[PATCH 08/13] huge_memory: Allow mappings of PMD sized pages

2024-06-26 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce dax_insert_pfn_pmd. This will map the entire PMD-sized folio and take references as it would for a normally mapped page. This is distinct from the curr

[PATCH 07/13] huge_memory: Allow mappings of PUD sized pages

2024-06-26 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce dax_insert_pfn_pud. This will map the entire PUD-sized folio and take references as it would for a normally mapped page. This is distinct from the curr

[PATCH 06/13] mm/memory: Add dax_insert_pfn

2024-06-26 Thread Alistair Popple
Currently to map a DAX page the DAX driver calls vmf_insert_pfn. This creates a special devmap PTE entry for the pfn but does not take a reference on the underlying struct page for the mapping. This is because DAX page refcounts are treated specially, as indicated by the presence of a devmap entry.

[PATCH 05/13] mm: Allow compound zone device pages

2024-06-26 Thread Alistair Popple
Zone device pages are used to represent various type of device memory managed by device drivers. Currently compound zone device pages are not supported. This is because MEMORY_DEVICE_FS_DAX pages are the only user of higher order zone device pages and have their own page reference counting. A futu

[PATCH 04/13] fs/dax: Add dax_page_free callback

2024-06-26 Thread Alistair Popple
When a fs dax page is freed it has to notify filesystems that the page has been unpinned/unmapped and is free. Currently this involves special code in the page free paths to detect a transition of refcount from 2 to 1 and to call some fs dax specific code. A future change will require this to happ

[PATCH 03/13] fs/dax: Refactor wait for dax idle page

2024-06-26 Thread Alistair Popple
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 --- fs/ext4/inode.c | 5 +

[PATCH 02/13] pci/p2pdma: Don't initialise page refcount to one

2024-06-26 Thread Alistair Popple
The reference counts for ZONE_DEVICE private pages should be initialised by the driver when the page is actually allocated by the driver allocator, not when they are first created. This is currently the case for MEMORY_DEVICE_PRIVATE and MEMORY_DEVICE_COHERENT pages but not MEMORY_DEVICE_PCI_P2PDMA

[PATCH 01/13] mm/gup.c: Remove redundant check for PCI P2PDMA page

2024-06-26 Thread Alistair Popple
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 Acked-by: David Hildenbrand --- mm/gup.c | 5 - 1 file changed, 5 deletions(-) diff --git a/mm/gup.c b/mm/gup

[PATCH 00/13] fs/dax: Fix FS DAX page reference counts

2024-06-26 Thread Alistair Popple
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

Re: [PATCH v2 2/2] Documentation: best practices for using Link trailers

2024-06-26 Thread Randy Dunlap
On 6/26/24 4:13 PM, Jonathan Corbet wrote: > Konstantin Ryabitsev writes: > >> On Fri, Jun 21, 2024 at 02:07:44PM GMT, Kees Cook wrote: >>> On Wed, Jun 19, 2024 at 02:24:07PM -0400, Konstantin Ryabitsev wrote: + This URL should be used when referring to relevant mailing list + to

Re: [PATCH v2 2/2] Documentation: best practices for using Link trailers

2024-06-26 Thread Jonathan Corbet
Konstantin Ryabitsev writes: > On Fri, Jun 21, 2024 at 02:07:44PM GMT, Kees Cook wrote: >> On Wed, Jun 19, 2024 at 02:24:07PM -0400, Konstantin Ryabitsev wrote: >> > + This URL should be used when referring to relevant mailing list >> > + topics, related patch sets, or other notable discussio

Re: [PATCH 0/7] minor document fixups

2024-06-26 Thread Jonathan Corbet
SeongJae Park writes: > This patch series is for minor document fixups. First five patches > clean up and remove 'Other material' section of process/index in favor > of 'staging/' and better place for docs on the section. A patch for > adding DAMON maintainer-profile reference on maintainers' h

Re: [PATCH 7/7] Docs/process/email-clients: Document HacKerMaiL

2024-06-26 Thread SeongJae Park
On Wed, 26 Jun 2024 16:35:49 -0600 Jonathan Corbet wrote: > SeongJae Park writes: > > > HacKerMaiL (hkml) [1] is a simple tool for mailing lists-based > > development workflows such as that for most Linux kernel subsystems. It > > is actively being maintained by DAMON maintainer, and recommend

Re: [PATCH 7/7] Docs/process/email-clients: Document HacKerMaiL

2024-06-26 Thread Jonathan Corbet
SeongJae Park writes: > HacKerMaiL (hkml) [1] is a simple tool for mailing lists-based > development workflows such as that for most Linux kernel subsystems. It > is actively being maintained by DAMON maintainer, and recommended for > DAMON community[2]. Add a simple introduction of the tool on

Re: [PATCH 3/7] Docs: Move magic-number from process to staging

2024-06-26 Thread Jonathan Corbet
SeongJae Park writes: > 'Other material' section on 'process/index' is for unsorted documents. > However we also have a dedicated place for the purpose, 'staging/'. > Move 'magic-number' from the section to 'staging/' directory. > > Signed-off-by: SeongJae Park > --- > Documentation/process/ind

Re: [PATCH 2/2] Documentation: best practices for using Link trailers

2024-06-26 Thread Konstantin Ryabitsev
On Wed, Jun 26, 2024 at 10:12:35AM GMT, Geert Uytterhoeven wrote: > > > + Link: https://patch.msgid.link/patch-source-msgid@here > > > > Hmm, I mentioned this in the other thread, but I also like the fact > > that my automated script uses the list that it was Cc'd to. That is, if > > it Cc'd li

Re: [PATCH 2/2] Documentation: best practices for using Link trailers

2024-06-26 Thread Geert Uytterhoeven
Hi Steven, On Tue, Jun 25, 2024 at 11:27 PM Steven Rostedt wrote: > On Tue, 18 Jun 2024 12:42:11 -0400 > Konstantin Ryabitsev wrote: > > + A similar approach was attempted before as part of a different > > + effort [1], but the initial implementation caused too many > > + regressions