From: Dave Chinner <david@fromorbit.com>
To: Sage Weil <sage@newdream.net>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH V2] xfs: timestamp updates cause excessive fdatasync log traffic
Date: Tue, 1 Sep 2015 07:51:27 +1000 [thread overview]
Message-ID: <20150831215127.GH26895@dastard> (raw)
In-Reply-To: <alpine.DEB.2.00.1508310529170.13116@cobra.newdream.net>
On Mon, Aug 31, 2015 at 05:40:04AM -0700, Sage Weil wrote:
> On Mon, 31 Aug 2015, Dave Chinner wrote:
> > After taking a tangent to find a tracepoint regression that was
> > getting in my way, I found that there was a significant pause
> > between the inode locking calls within xfs_file_fsync and the inode
> > locking calls on the buffered write. Roughly 8ms, in fact, on almost
> > every call. After adding a couple more test trace points into the
> > XFS fsync code, it turns out that a hardware cache flush is causing
> > the delay. That is, because we aren't doing log writes that trigger
> > cache flushes and FUA writes, we have to issue a
> > blkdev_issue_flush() call from xfs_file_fsync and that is taking 8ms
> > to complete.
>
> This is where my understanding of block layer flushing really breaks down,
> but in both cases we're issues flush requests to the hardware, right? Is
> the difference that the log write is a FUA flush request with data, and
> blkdev_issue_flush() issues a flush request without associated data?
Pretty much, though th elog write also does a cache flush before the
FUA write. i.e. The log writes consist of a bio with data issued via:
submit_bio(REQ_FUA | REQ_FLUSH | WRITE_SYNC, bio);
blkdev_issue_flush consists of an empty bio issued via:
submit_bio(REQ_FLUSH | WRITE_SYNC, bio);
So from a block layer and filesystem point of view there is little
difference, and the only difference at the SCSI layer is the WRITE
w/ FUA that is issued after the cache flush in the log write case
(see https://lwn.net/Articles/400541/ fo a bit more background).
I haven't looked any deeper than this so far - I don't have time
right now to do so...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-08-31 21:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 1:23 [PATCH] xfs: timestamp updates cause excessive fdatasync log traffic Dave Chinner
2015-08-28 4:32 ` [PATCH V2] " Dave Chinner
2015-08-28 15:11 ` Sage Weil
2015-08-28 22:04 ` Dave Chinner
2015-08-31 2:21 ` Dave Chinner
2015-08-31 8:48 ` Dave Chinner
2015-08-31 12:40 ` Sage Weil
2015-08-31 21:51 ` Dave Chinner [this message]
2015-09-08 14:45 ` Brian Foster
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=20150831215127.GH26895@dastard \
--to=david@fromorbit.com \
--cc=sage@newdream.net \
--cc=xfs@oss.sgi.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