[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <632b3246548ff_66d1a29431@dwillia2-xfh.jf.intel.com.notmuch>
Date: Wed, 21 Sep 2022 08:48:22 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Jason Gunthorpe <jgg@...dia.com>,
Dan Williams <dan.j.williams@...el.com>
CC: <akpm@...ux-foundation.org>, Matthew Wilcox <willy@...radead.org>,
"Jan Kara" <jack@...e.cz>, "Darrick J. Wong" <djwong@...nel.org>,
"Christoph Hellwig" <hch@....de>,
John Hubbard <jhubbard@...dia.com>,
<linux-fsdevel@...r.kernel.org>, <nvdimm@...ts.linux.dev>,
<linux-xfs@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v2 15/18] devdax: Use dax_insert_entry() +
dax_delete_mapping_entry()
Jason Gunthorpe wrote:
> On Thu, Sep 15, 2022 at 08:36:37PM -0700, Dan Williams wrote:
> > Track entries and take pgmap references at mapping insertion time.
> > Revoke mappings (dax_zap_mappings()) and drop the associated pgmap
> > references at device destruction or inode eviction time. With this in
> > place, and the fsdax equivalent already in place, the gup code no longer
> > needs to consider PTE_DEVMAP as an indicator to get a pgmap reference
> > before taking a page reference.
> >
> > In other words, GUP takes additional references on mapped pages. Until
> > now, DAX in all its forms was failing to take references at mapping
> > time. With that fixed there is no longer a requirement for gup to manage
> > @pgmap references. However, that cleanup is saved for a follow-on patch.
>
> A page->pgmap must be valid and stable so long as a page has a
> positive refcount. Once we fixed the refcount GUP is automatically
> fine. So this explanation seems confusing.
I think while trying to describe the history I made this patch
description confusing.
> If dax code needs other changes to maintain that invarient it should
> be spelled out what those are and why, but the instant we fix the
> refcount we can delete the stuff in gup.c and everywhere else.
How about the following, note that this incorporates new changes I have
in flight after Dave pointed out the problem DAX has with page pins
versus inode lifetime:
---
The fsdax core now manages pgmap references when servicing faults that
install new mappings, and elevates the page reference until it is
zapped. It coordinates with the VFS to make sure that all page
references are dropped before the hosting inode goes out of scope
(iput_final()).
In order to delete the unnecessary pgmap reference taking in mm/gup.c
devdax needs to move to the same model.
Powered by blists - more mailing lists