Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: rewrite the fdatasync optimization
Date: Tue, 6 Feb 2018 09:17:26 +1100	[thread overview]
Message-ID: <20180205221726.c2hdvaairki27gxf@destitution> (raw)
In-Reply-To: <20180205073933.17065-1-hch@lst.de>

On Mon, Feb 05, 2018 at 08:39:33AM +0100, Christoph Hellwig wrote:
> Currently we need to the ilock over the log force in xfs_fsync so that we
> can protect ili_fsync_fields against incorrect manipulation.
> 
> But if instead we add new XFS_ILOG_VERSION pseudo log area similar to the
> timestamp one we can use that to just record the last dirty / fdatasync
> dirty lsn as long as the inode is pinned, and clear it when unpinning to
> avoid holding the ilock over I/O.

I thought that NFS requires the iversion changes to be made stable
at the same time as the data changes they correspond to is made
stable? i.e. NFS requires us to stabilise the on disk iversion field
during fdatasync.

As it is, I think this change XFS_ILOG_VERSION change is unnecessary
because Jeff Layton's changes to avoid iversion changes when the
value is not being sampled has been merged. Hence iversion won't be
changed on every write anymore unless NFS is in the picture and is
sampling iversion. 

IOWs, I think this may be needed for older kernels, but its not
clear that we need it for upstream kernels.

> This will drastically reduce latency on multithreaded workloads that
> mix writes with fsync calls.

The change to use ili_datasync_lsn is what reduces the latency
because the ilock is not held over the log force anymore. That's
useful and stands alone from the iversion modification so I
think, at minimum, this needs to be separated into two patches....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-02-05 22:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05  7:39 [PATCH] xfs: rewrite the fdatasync optimization Christoph Hellwig
2018-02-05 22:17 ` Dave Chinner [this message]
2018-02-06  7:23   ` Christoph Hellwig
2018-02-08 23:17     ` Dave Chinner
2018-02-13 15:04       ` Christoph Hellwig
2018-02-13 23:26         ` Dave Chinner
2018-02-14 15:53           ` Christoph Hellwig
2018-02-14 22:43             ` Dave Chinner

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=20180205221726.c2hdvaairki27gxf@destitution \
    --to=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /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