From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "Ober, Frank" <frank.ober@intel.com>
Cc: "linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: write atomicity with xfs ... current status?
Date: Mon, 16 Mar 2020 14:59:13 -0700 [thread overview]
Message-ID: <20200316215913.GV256767@magnolia> (raw)
In-Reply-To: <MW3PR11MB46974637E20D2ED949A7A47E8BF90@MW3PR11MB4697.namprd11.prod.outlook.com>
On Mon, Mar 16, 2020 at 08:59:54PM +0000, Ober, Frank wrote:
> Hi, Intel is looking into does it make sense to take an existing,
> popular filesystem and patch it for write atomicity at the sector
> count level. Meaning we would protect a configured number of sectors
> using parameters that each layer in the kernel would synchronize on.
> We could use a parameter(s) for this that comes from the NVMe
> specification such as awun or awunpf
<gesundheit>
Oh, that was an acronym...
> that set across the (affected)
> layers to a user space program such as innodb/MySQL which would
> benefit as would other software. The MySQL target is a strong use
> case, as its InnoDB has a double write buffer that could be removed if
> write atomicity was protected at 16KiB for the file opens and with
> fsync().
We probably need a better elaboration of the exact usecases of atomic
writes since I haven't been to LSF in a couple of years (and probably
not this year either). I can think of a couple of access modes off the
top of my head:
1) atomic directio write where either you stay under the hardware atomic
write limit and we use it, or...
2) software atomic writes where we use the xfs copy-on-write mechanism
to stage the new blocks and later map them back into the inode, where
"later" is either an explicit fsync or an O_SYNC write or something...
3) ...or a totally separate interface where userspace does something
along the lines of:
write_fd = stage_writes(fd);
which creates an O_TMPFILE and reflinks all of fd's content to it
write(write_fd...);
err = commit_writes(write_fd, fd);
which then uses extent remapping to push all the changed blocks back to
the original file if it hasn't changed. Bonus: other threads don't see
the new data until commit_writes() finishes, and we can introduce new
log items to make sure that once we start committing we can finish it
even if the system goes down.
> My question is why hasn't xfs write atomicity advanced further, as it
> seems in 3.x kernel time a few years ago this was tried but nothing
> committed. as documented here:
>
> http://git.infradead.org/users/hch/vfs.git/shortlog/refs/heads/O_ATOMIC
>
> Is xfs write atomicity still being pursued , and with what design
> objective. There is a long thread here,
> https://lwn.net/Articles/789600/ on write atomicity, but with no
> progress, lots of ideas in there but not any progress, but I am
> unclear.
>
> Is my design idea above simply too simplistic, to try and protect a
> configured block size (sector count) through the filesystem and block
> layers, and what really is not making it attainable?
Lack of developer time, AFAICT.
--D
> Thanks for the feedback
> Frank Ober
next prev parent reply other threads:[~2020-03-16 22:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 20:59 write atomicity with xfs ... current status? Ober, Frank
2020-03-16 21:59 ` Darrick J. Wong [this message]
2020-03-16 23:32 ` Dave Chinner
2020-03-17 22:56 ` Ober, Frank
2020-03-18 2:27 ` Dave Chinner
2020-03-18 8:00 ` Christoph Hellwig
2020-03-19 1:07 ` Ober, Frank
2020-03-17 19:19 ` Christoph Hellwig
2020-03-17 22:55 ` Dave Chinner
2020-03-18 7:54 ` Christoph Hellwig
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=20200316215913.GV256767@magnolia \
--to=darrick.wong@oracle.com \
--cc=frank.ober@intel.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