From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] xfs: force writes to delalloc regions to unwritten
Date: Thu, 14 Mar 2019 20:13:03 -0700 [thread overview]
Message-ID: <20190315031302.GF4929@magnolia> (raw)
In-Reply-To: <20190314230841.GJ23020@dastard>
On Fri, Mar 15, 2019 at 10:08:41AM +1100, Dave Chinner wrote:
> On Thu, Mar 14, 2019 at 02:29:06PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > When writing to a delalloc region in the data fork, commit the new
> > allocations (of the da reservation) as unwritten so that the mappings
> > are only marked written once writeback completes successfully. This
> > fixes the problem of stale data exposure if the system goes down during
> > targeted writeback of a specific region of a file, as tested by
> > generic/042.
>
> So what does this do to buffered sequential and random write
> performance?
Whacks it quite a bit -- 10-20% depending on how fast the storage is in
the first place. I barely noticed on my usb thumb drive, however. :P
That said, shovelling that many writes through the completion workqueues
creates a thundering herd problem on the ILOCK so maybe it wouldn't be
so bad if we simply dumped the completions on a per-inode queue and only
had one thread handling the completions.
(As we've been discussing on IRC.)
> Next, if the entire delalloc extent being allocated is beyond the
> on-disk EOF (typical for extending sequential buffered writes), why
> do we want those to be allocated as unwritten? i.e. isn't "allocate
> as unwritten" only necessary for delalloc extent allocation
> inside EOF?
I wasn't sure on this point -- for delalloc extents that start at or
above EOF, we can continue go straight to real like we do today. We
still have to use the setfilesize transaction to update isize on disk,
so it probably doesn't make that big of a difference.
If the delalloc extent crosses EOF then I think it makes sense to map it
in as unwritten, issue the write, and convert the extent to real during
io completion, and not split it up just to avoid having unwritten
extents past EOF.
IOWS, there wasn't any particular intentionality behind having the code
not set PREALLOC if the extent is totally beyond EOF; this was just the
bare minimum to get a discussion started. :)
--D
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2019-03-15 3:13 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 21:28 [PATCH 0/4] xfs: various rough fixes Darrick J. Wong
2019-03-14 21:29 ` [PATCH 1/4] xfs: only free posteof blocks on first close Darrick J. Wong
2019-03-15 3:42 ` Dave Chinner
2019-03-14 21:29 ` [PATCH 2/4] xfs: force writes to delalloc regions to unwritten Darrick J. Wong
2019-03-14 23:08 ` Dave Chinner
2019-03-15 3:13 ` Darrick J. Wong [this message]
2019-03-15 3:40 ` Dave Chinner
2019-03-15 12:29 ` Brian Foster
2019-03-17 22:40 ` Dave Chinner
2019-03-18 12:40 ` Brian Foster
2019-03-18 20:35 ` Dave Chinner
2019-03-18 21:50 ` Brian Foster
2019-03-19 18:02 ` Darrick J. Wong
2019-03-19 20:25 ` Dave Chinner
2019-03-20 12:02 ` Brian Foster
2019-03-20 21:10 ` Dave Chinner
2019-03-21 12:27 ` Brian Foster
2019-03-22 1:52 ` Dave Chinner
2019-03-22 12:46 ` Brian Foster
2019-04-03 22:38 ` Darrick J. Wong
2019-04-04 12:50 ` Brian Foster
2019-04-04 15:22 ` Darrick J. Wong
2019-04-04 16:16 ` Brian Foster
2019-04-04 22:08 ` Dave Chinner
2019-04-05 11:24 ` Brian Foster
2019-04-05 15:12 ` Darrick J. Wong
2019-04-08 0:17 ` Dave Chinner
2019-04-08 12:02 ` Brian Foster
2019-03-14 21:29 ` [PATCH 3/4] xfs: trace transaction reservation logcount overflow Darrick J. Wong
2019-03-15 12:30 ` Brian Foster
2019-03-14 21:29 ` [PATCH 4/4] xfs: avoid reflink end cow deadlock Darrick J. Wong
2019-03-15 12:31 ` 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=20190315031302.GF4929@magnolia \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--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;
as well as URLs for NNTP newsgroup(s).