From: Alistair Popple <apopple@nvidia.com>
To: David Hildenbrand <david@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
linux-mm@kvack.org, lina@asahilina.net, zhang.lyra@gmail.com,
gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com,
dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com,
jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com,
will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com,
dave.hansen@linux.intel.com, ira.weiny@intel.com,
willy@infradead.org, djwong@kernel.org, tytso@mit.edu,
linmiaohe@huawei.com, peterx@redhat.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev,
linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com,
akpm@linux-foundation.org, sfr@canb.auug.org.au
Subject: Re: [PATCH v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts
Date: Mon, 16 Dec 2024 11:55:30 +1100 [thread overview]
Message-ID: <wysuus23bqmjtwkfu3zutqtmkse3ki3erf45x32yezlrl24qto@xlqt7qducyld> (raw)
In-Reply-To: <45555f72-e82a-4196-94af-22d05d6ac947@redhat.com>
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 specific dax_insert_XXX functions to vmf_insert_XXX
> > > and have them pass the vmf struct.
> > >
> > > - Seperate out the device DAX changes.
> > >
> > > - Restore the page share mapping counting and associated warnings.
> > >
> > > - Rework truncate to require file-systems to have previously called
> > > dax_break_layout() to remove the address space mapping for a
> > > page. This found several bugs which are fixed by the first half of
> > > the series. The motivation for this was initially to allow the FS
> > > DAX page-cache mappings to hold a reference on the page.
> > >
> > > However that turned out to be a dead-end (see the comments on patch
> > > 21), but it found several bugs and I think overall it is an
> > > improvement so I have left it here.
> > >
> > > Device and 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. It also
> > > enables support for compound ZONE_DEVICE pages which is one of my
> > > primary motivators for doing this work.
> >
> > So this is feeling ready for -next exposure, and ideally merged for v6.14. I
> > see the comments from John and Bjorn and that you were going to respin for
> > that, but if it's just those details things they can probably be handled
> > incrementally.
> >
> > Alistair, are you ready for this to hit -next?
Yeah, I'm pretty happy with the series now. It "feels" right.
There's a couple of dumb build bot errors, so I was going to respin to fix
those as well. I got caught up with a few other things so was just letting this
sit awaiting feedback, but I should be able to post a respin early this week.
> > As for which tree...
> >
> > Andrew, we could take this through -mm, but my first instinct would be to try
> > to take it through nvdimm.git mainly to offload any conflict wrangling work and
> > small fixups which are likely to be an ongoing trickle.
> >
> > However, I am not going to put up much of a fight if others prefer this go
> > through -mm.
> >
> > Thoughts?
>
> I'm in the process of preparing v2 of [1] that will result in conflicts with
> this series in the rmap code (in particular [PATCH v3 14/25] huge_memory:
> Allow mappings of PUD sized pages).
>
> I'll be away for 2 weeks over Christmas, but I assume I'll manage to post v2
> shortly.
>
> Which reminds me that I still have to take a closer look at some things in
> this series :) Especially also #14 regarding accounting.
>
> I wonder if we could split out the rmap changes in #14, and have that patch
> simply in two trees? No idea.
I could split out the first half (patches 1 - 8) into a series to go via
nvdimm.git, because they are actually standalone clean ups that I think are
worthwhile anyway.
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 Andrew only takes
them if the nvdimm.git changes have made it into -next. I'm happy with either
approach, so let me know if I should split the series or not.
- Alistair
> [1]
> https://lore.kernel.org/all/20240829165627.2256514-1-david@redhat.com/T/#u
>
> --
> Cheers,
>
> David / dhildenb
>
next prev parent reply other threads:[~2024-12-16 0:55 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 1:40 Alistair Popple
2024-11-22 1:40 ` [PATCH v3 01/25] fuse: Fix dax truncate/punch_hole fault path Alistair Popple
2024-11-22 1:40 ` [PATCH v3 02/25] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range() Alistair Popple
2024-11-22 1:40 ` [PATCH v3 03/25] fs/dax: Don't skip locked entries when scanning entries Alistair Popple
2024-11-22 1:40 ` [PATCH v3 04/25] fs/dax: Refactor wait for dax idle page Alistair Popple
2024-11-22 1:40 ` [PATCH v3 05/25] fs/dax: Create a common implementation to break DAX layouts Alistair Popple
2024-11-22 2:57 ` John Hubbard
2024-11-22 3:37 ` Alistair Popple
2024-11-25 13:27 ` kernel test robot
2024-11-22 1:40 ` [PATCH v3 06/25] fs/dax: Always remove DAX page-cache entries when breaking layouts Alistair Popple
2024-11-22 1:40 ` [PATCH v3 07/25] fs/dax: Ensure all pages are idle prior to filesystem unmount Alistair Popple
2024-11-22 1:40 ` [PATCH v3 08/25] fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag Alistair Popple
2024-11-22 1:40 ` [PATCH v3 09/25] mm/gup.c: Remove redundant check for PCI P2PDMA page Alistair Popple
2024-11-22 1:40 ` [PATCH v3 10/25] pci/p2pdma: Don't initialise page refcount to one Alistair Popple
2024-11-22 18:20 ` Bjorn Helgaas
2024-11-24 22:39 ` Alistair Popple
2024-11-22 1:40 ` [PATCH v3 11/25] mm: Allow compound zone device pages Alistair Popple
2024-11-25 5:05 ` kernel test robot
2024-11-25 15:51 ` kernel test robot
2024-11-22 1:40 ` [PATCH v3 12/25] mm/memory: Enhance insert_page_into_pte_locked() to create writable mappings Alistair Popple
2024-11-22 1:40 ` [PATCH v3 13/25] mm/memory: Add vmf_insert_page_mkwrite() Alistair Popple
2024-11-22 1:40 ` [PATCH v3 14/25] huge_memory: Allow mappings of PUD sized pages Alistair Popple
2024-12-14 15:32 ` David Hildenbrand
2024-11-22 1:40 ` [PATCH v3 15/25] huge_memory: Allow mappings of PMD " Alistair Popple
2024-11-22 1:40 ` [PATCH v3 16/25] memremap: Add is_device_dax_page() and is_fsdax_page() helpers Alistair Popple
2024-11-22 1:40 ` [PATCH v3 17/25] gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages Alistair Popple
2024-11-22 3:23 ` John Hubbard
2024-11-22 1:40 ` [PATCH v3 18/25] proc/task_mmu: Ignore ZONE_DEVICE pages Alistair Popple
2024-11-22 1:40 ` [PATCH v3 19/25] memcontrol-v1: " Alistair Popple
2024-11-22 1:40 ` [PATCH v3 20/25] mm/mlock: Skip ZONE_DEVICE PMDs during mlock Alistair Popple
2024-11-22 1:40 ` [PATCH v3 21/25] fs/dax: Properly refcount fs dax pages Alistair Popple
2024-11-22 1:40 ` [PATCH v3 22/25] device/dax: Properly refcount device dax pages when mapping Alistair Popple
2024-11-22 1:40 ` [PATCH v3 23/25] mm: Remove pXX_devmap callers Alistair Popple
2024-11-22 1:40 ` [PATCH v3 24/25] mm: Remove devmap related functions and page table bits Alistair Popple
2024-11-22 1:40 ` [PATCH v3 25/25] Revert "riscv: mm: Add support for ZONE_DEVICE" Alistair Popple
2024-11-25 13:13 ` Björn Töpel
2024-12-14 1:39 ` [PATCH v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts Dan Williams
2024-12-14 15:22 ` David Hildenbrand
2024-12-16 0:55 ` Alistair Popple [this message]
2024-12-16 6:26 ` Andrew Morton
2024-12-17 5:20 ` Alistair Popple
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wysuus23bqmjtwkfu3zutqtmkse3ki3erf45x32yezlrl24qto@xlqt7qducyld \
--to=apopple@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=david@fromorbit.com \
--cc=david@redhat.com \
--cc=djwong@kernel.org \
--cc=gerald.schaefer@linux.ibm.com \
--cc=hch@lst.de \
--cc=ira.weiny@intel.com \
--cc=jack@suse.cz \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=lina@asahilina.net \
--cc=linmiaohe@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=logang@deltatee.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=nvdimm@lists.linux.dev \
--cc=peterx@redhat.com \
--cc=sfr@canb.auug.org.au \
--cc=tytso@mit.edu \
--cc=vishal.l.verma@intel.com \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox