From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
linux-xfs <linux-xfs@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [QUESTION] Long read latencies on mixed rw buffered IO
Date: Wed, 27 Mar 2019 12:29:03 +1100 [thread overview]
Message-ID: <20190327012903.GH23020@dastard> (raw)
In-Reply-To: <CAOQ4uxh9gArhXZdSgOJgT12Ov9JYyPNoMf9H=h-Q-2vwcd8k=Q@mail.gmail.com>
On Tue, Mar 26, 2019 at 05:44:34AM +0200, Amir Goldstein wrote:
> On Tue, Mar 26, 2019 at 1:48 AM Dave Chinner <david@fromorbit.com> wrote:
> > On Mon, Mar 25, 2019 at 09:57:46PM +0200, Amir Goldstein wrote:
> > > Not as bad as v1. Only a little bit worse than master...
> > > The whole deal with the read/write balance and on SSD, I imagine
> > > the balance really changes. That's why I was skeptical about
> > > one-size-fits all read/write balance.
> >
> > You're not testing your SSD. You're testing writes into cache vs
> > reads from disk. There is a massive latency difference in the two
> > operations, so unless you use O_DSYNC for the writes, you are going
> > to see this cache-vs-uncached performance unbalance. i.e. unless the
> > rwsem is truly fair, there is always going to be more writer
> > access to the lock because they spend less time holding it and so
> > can put much more pressure on it.
> >
>
> Yeh, I know. SSD makes the balance better because of faster reads
> from disk. Was pointing out that the worse case I am interested in is
> on spindles. That said, O_DSYNC certainly does improve the balance
> and gives shorter worse case latencies. However, it does not make the
> problem go away. i_rwsem taken (even for 4K reads) takes its toll
> on write latencies (compared to ext4).
Sure, that's because it's serialising access across the entire file,
not just the page that is being read/written to.
The solution here is to move to concurrent buffered writes
similar to how we do direct IO. We need to track IO ranges for that,
though, so we can serialise unaligned and/or overlapping IOs. We
need fast, efficient range locks for this, though.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-03-27 1:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-24 18:18 [QUESTION] Long read latencies on mixed rw buffered IO Amir Goldstein
2019-03-25 0:10 ` Dave Chinner
2019-03-25 6:51 ` Christoph Hellwig
2019-03-25 6:55 ` Amir Goldstein
2019-03-25 7:49 ` Amir Goldstein
2019-03-25 15:47 ` Darrick J. Wong
2019-03-25 16:41 ` Matthew Wilcox
2019-03-25 17:30 ` Amir Goldstein
2019-03-25 18:22 ` Matthew Wilcox
2019-03-25 19:18 ` Amir Goldstein
2019-03-25 19:40 ` Matthew Wilcox
2019-03-25 19:57 ` Amir Goldstein
2019-03-25 23:48 ` Dave Chinner
2019-03-26 3:44 ` Amir Goldstein
2019-03-27 1:29 ` Dave Chinner [this message]
2019-03-25 17:56 ` Amir Goldstein
2019-03-25 18:02 ` Christoph Hellwig
2019-03-25 18:44 ` Amir Goldstein
2019-03-25 23:43 ` Dave Chinner
2019-03-26 4:36 ` Amir Goldstein
2025-06-20 13:46 ` [PATCH] xfs: Remove i_rwsem lock in buffered read Jinliang Zheng
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=20190327012903.GH23020@dastard \
--to=david@fromorbit.com \
--cc=amir73il@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).