From: Jan Kara <jack@suse.cz>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
Dan Williams <dan.j.williams@intel.com>, Ted Tso <tytso@mit.edu>,
"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH 16/19] ext4: Support for synchronous DAX faults
Date: Mon, 16 Oct 2017 17:50:35 +0200 [thread overview]
Message-ID: <20171016155034.GL9762@quack2.suse.cz> (raw)
In-Reply-To: <20171013205854.GE29081@linux.intel.com>
On Fri 13-10-17 14:58:54, Ross Zwisler wrote:
> On Wed, Oct 11, 2017 at 10:06:00PM +0200, Jan Kara wrote:
> > We return IOMAP_F_NEEDDSYNC flag from ext4_iomap_begin() for a
> > synchronous write fault when inode has some uncommitted metadata
> > changes. In the fault handler ext4_dax_fault() we then detect this case,
> > call vfs_fsync_range() to make sure all metadata is committed, and call
> > dax_insert_pfn_mkwrite() to insert page table entry. Note that this will
> > also dirty corresponding radix tree entry which is what we want -
> > fsync(2) will still provide data integrity guarantees for applications
> > not using userspace flushing. And applications using userspace flushing
> > can avoid calling fsync(2) and thus avoid the performance overhead.
> >
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> > fs/ext4/file.c | 6 +++++-
> > fs/ext4/inode.c | 15 +++++++++++++++
> > fs/jbd2/journal.c | 17 +++++++++++++++++
> > include/linux/jbd2.h | 1 +
> > 4 files changed, 38 insertions(+), 1 deletion(-)
>
> <>
>
> > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> > index 31db875bc7a1..13a198924a0f 100644
> > --- a/fs/ext4/inode.c
> > +++ b/fs/ext4/inode.c
> > @@ -3394,6 +3394,19 @@ static int ext4_releasepage(struct page *page, gfp_t wait)
> > }
> >
> > #ifdef CONFIG_FS_DAX
> > +static bool ext4_inode_datasync_dirty(struct inode *inode)
> > +{
> > + journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
> > +
> > + if (journal)
> > + return !jbd2_transaction_committed(journal,
> > + EXT4_I(inode)->i_datasync_tid);
> > + /* Any metadata buffers to write? */
> > + if (!list_empty(&inode->i_mapping->private_list))
> > + return true;
> > + return inode->i_state & I_DIRTY_DATASYNC;
> > +}
>
> I just had 2 quick questions on this:
>
> 1) Does ext4 actually use inode->i_mapping->private_list to keep track of
> dirty metadata buffers? The comment above ext4_write_end() leads me to
> believe that this list is unused?
>
> * ext4 never places buffers on inode->i_mapping->private_list. metadata
> * buffers are managed internally.
>
> Or does the above comment only apply to ext4 with a journal?
Yes, the above applies for ext4 with a journal. ext4 without a journal uses
inode->i_mapping->private_list for metadata tracking. And DAX can be used
without the journal just fine...
> 2) Where is I_DIRTY_DATASYNC set in inode->i_state? I poked around a bit and
> couldn't see it.
Never directly (at least for ext4). But it will get set by
mark_inode_dirty() as I_DIRTY contains I_DIRTY_DATASYNC.
> The rest of the patch looks good to me, and you can add:
>
> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Thanks!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2017-10-16 15:50 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 20:05 [PATCH 0/19 v3] dax, ext4, xfs: Synchronous page faults Jan Kara
2017-10-11 20:05 ` [PATCH 01/19] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags Jan Kara
2017-10-13 7:12 ` Christoph Hellwig
2017-10-13 15:44 ` Dan Williams
2017-10-13 18:28 ` Dan Williams
2017-10-14 15:57 ` Williams, Dan J
2017-10-16 7:45 ` hch
2017-10-17 11:50 ` Jan Kara
2017-10-17 19:38 ` Dan Williams
2017-10-18 6:59 ` hch
2017-10-11 20:05 ` [PATCH 02/19] mm: Remove VM_FAULT_HWPOISON_LARGE_MASK Jan Kara
2017-10-11 20:05 ` [PATCH 03/19] dax: Simplify arguments of dax_insert_mapping() Jan Kara
2017-10-11 20:05 ` [PATCH 04/19] dax: Factor out getting of pfn out of iomap Jan Kara
2017-10-11 20:05 ` [PATCH 05/19] dax: Create local variable for VMA in dax_iomap_pte_fault() Jan Kara
2017-10-11 20:05 ` [PATCH 06/19] dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE test Jan Kara
2017-10-11 20:05 ` [PATCH 07/19] dax: Inline dax_insert_mapping() into the callsite Jan Kara
2017-10-11 20:05 ` [PATCH 08/19] dax: Inline dax_pmd_insert_mapping() " Jan Kara
2017-10-11 20:05 ` [PATCH 09/19] dax: Fix comment describing dax_iomap_fault() Jan Kara
2017-10-11 20:05 ` [PATCH 10/19] dax: Allow dax_iomap_fault() to return pfn Jan Kara
2017-10-11 20:05 ` [PATCH 11/19] dax: Allow tuning whether dax_insert_mapping_entry() dirties entry Jan Kara
2017-10-13 7:12 ` Christoph Hellwig
2017-10-13 19:26 ` Ross Zwisler
2017-10-11 20:05 ` [PATCH 12/19] mm: Define MAP_SYNC and VM_SYNC flags Jan Kara
2017-10-13 7:12 ` Christoph Hellwig
2017-10-13 19:44 ` Ross Zwisler
2017-10-16 15:37 ` Jan Kara
2017-10-11 20:05 ` [PATCH 13/19] dax, iomap: Add support for synchronous faults Jan Kara
2017-10-13 7:14 ` Christoph Hellwig
2017-10-11 20:05 ` [PATCH 14/19] dax: Implement dax_finish_sync_fault() Jan Kara
2017-10-13 7:21 ` Christoph Hellwig
2017-10-16 15:43 ` Jan Kara
2017-10-13 20:06 ` Ross Zwisler
2017-10-11 20:05 ` [PATCH 15/19] ext4: Simplify error handling in ext4_dax_huge_fault() Jan Kara
2017-10-13 20:09 ` Ross Zwisler
2017-10-11 20:06 ` [PATCH 16/19] ext4: Support for synchronous DAX faults Jan Kara
2017-10-11 22:23 ` Dan Williams
2017-10-12 13:42 ` Jan Kara
2017-10-13 20:58 ` Ross Zwisler
2017-10-16 15:50 ` Jan Kara [this message]
2017-10-11 20:06 ` [PATCH 17/19] ext4: Add support for MAP_SYNC flag Jan Kara
2017-10-11 22:11 ` Dan Williams
2017-10-12 13:42 ` Jan Kara
2017-10-13 0:23 ` Dan Williams
2017-10-13 7:22 ` Christoph Hellwig
2017-10-13 15:52 ` Dan Williams
2017-10-17 11:30 ` Jan Kara
2017-10-13 7:21 ` Christoph Hellwig
2017-10-16 15:14 ` Jan Kara
2017-10-11 20:06 ` [PATCH 18/19] xfs: support for synchronous DAX faults Jan Kara
2017-10-11 20:06 ` [PATCH 19/19] xfs: Add support for MAP_SYNC flag Jan Kara
2017-10-11 22:54 ` Dan Williams
2017-10-11 23:02 ` Dan Williams
2017-10-13 7:28 ` Christoph Hellwig
2017-10-11 21:18 ` [PATCH 0/19 v3] dax, ext4, xfs: Synchronous page faults Dan Williams
2017-10-11 22:43 ` Dave Chinner
2017-10-12 1:18 ` Dan Williams
2017-10-13 22:53 ` Ross Zwisler
2017-10-16 15:12 ` Jan Kara
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=20171016155034.GL9762@quack2.suse.cz \
--to=jack@suse.cz \
--cc=dan.j.williams@intel.com \
--cc=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ross.zwisler@linux.intel.com \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).