xfs
[Top] [All Lists]

Re: sleeps and waits during io_submit

To: Glauber Costa <glauber@xxxxxxxxxxxx>
Subject: Re: sleeps and waits during io_submit
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 2 Dec 2015 08:39:36 +1100
Cc: Avi Kivity <avi@xxxxxxxxxxxx>, Brian Foster <bfoster@xxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <CAD-J=zbZdWkJ8sfJHyKmQTZYVvLFbqbbEbWo2HV25jnZyrfTaA@xxxxxxxxxxxxxx>
References: <20151130141000.GC24765@xxxxxxxxxxxxxxx> <565C5D39.8080300@xxxxxxxxxxxx> <20151130161438.GD24765@xxxxxxxxxxxxxxx> <565D639F.8070403@xxxxxxxxxxxx> <20151201131114.GA26129@xxxxxxxxxxxxxxx> <565DA784.5080003@xxxxxxxxxxxx> <20151201145631.GD26129@xxxxxxxxxxxxxxx> <565DBB3E.2010308@xxxxxxxxxxxx> <20151201210417.GY19199@dastard> <CAD-J=zbZdWkJ8sfJHyKmQTZYVvLFbqbbEbWo2HV25jnZyrfTaA@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Dec 01, 2015 at 04:10:45PM -0500, Glauber Costa wrote:
> On Tue, Dec 1, 2015 at 4:04 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> > On Tue, Dec 01, 2015 at 05:22:38PM +0200, Avi Kivity wrote:
> >> On 12/01/2015 04:56 PM, Brian Foster wrote:
> >> mount -o discard.  And yes, overwrites are supposedly more expensive
> >> than trim old data + allocate new data, but maybe if you compare it
> >> with the work XFS has to do, perhaps the tradeoff is bad.
> >
> > Oh, you do realise that using "-o discard" causes significant delays
> > in journal commit processing? i.e. the journal commit completion
> > blocks until all the discards have been submitted and waited on
> > *synchronously*. This is a problem with the linux block layer in
> > that blkdev_issue_discard() is a synchronous operation.....
> >
> > Hence if you are seeing delays in transactions (e.g. timestamp updates)
> > it's entirely possible that things will get much better if you
> > remove the discard mount option. It's much better from a performance
> > perspective to use the fstrim command every so often - fstrim issues
> > discard operations in the context of the fstrim process - it does
> > not interact with the transaction subsystem at all.
> 
> Hi Dave,
> 
> This is news to me.
> 
> However, in the disk that we have used during the acquisition of this
> trace, discard doesn't seem to be supported:
> $ sudo fstrim /data/
> fstrim: /data/: the discard operation is not supported
> 
> In that case, if I understand correctly the discard mount option
> should be a noop, no?

XFS still makes the blkdev_issue_discard() calls, though, because
the block device can turn discard support on and off dynamically.
e.g. raid devices where a faulty drive is replaced temporarily with
a drive that doesn't have discard support. The block device suddenly
starts returning -EOPNOTSUPP to the filesystem from
blkdev_issue_discard() calls. However, the admin then replaces that
drive with a new one that des have discard support, and now
blkdev_issue_discard() works as exepected.

IOWs, if you set the mount option, XFS will always attempt to issue
discards...

> That recommendation is great for our general case, though.

For the moment. Given lots of time, reworking this code could
greatly reduce the impact/overhead of it and so make it practical to
enable. There's a lot of work to get to that point, though...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>