linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Chao Yu <yuchao0@huawei.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	Eric Sandeen <sandeen@sandeen.net>,
	Chen Rong <rongx.a.chen@intel.com>,
	fstests@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	philip.li@intel.com
Subject: Re: xfstests: generic/342 run failed in f2fs
Date: Wed, 27 Dec 2017 22:41:43 -0500	[thread overview]
Message-ID: <20171228034143.GA30269@thunk.org> (raw)
In-Reply-To: <ee17d403-6ede-e7a0-da54-baf276e1fc97@huawei.com>

On Thu, Dec 28, 2017 at 11:17:09AM +0800, Chao Yu wrote:
> > Indeed. Actually, since one of our goals was to reduce fsync latencies for
> > Android, we decided to support posix in a minimum way. In order to avoid
> 
> Agreed, in order to maximize performance of fsync regular file, we'd better
> not change current sematic of f2fs' fsync so far, moreover, there is no
> such requirement from upper layer application.

The cost of forcing an fsync on the parent directory only if the
regular file was just created should really be minimal.  Most of the
performance critical use cases for fsync() is after writing data on an
already-existing file.

Even in the case where a package manager is writing, say, lots of
newly created files followed by an fsync (such as a 21 megabyte docker
binary) the overhead of including a handful of 4k metadata blocks for
the containing directory to make sure /usr/bin/docker exists as part
of the fsync() is in the noise compared to all of the other data
blocks being written by the package manager.

So I suspect the concerns of "oh, we can't provide the same guarantees
as ext4 and f2fs" are a bit overblown here.  But ultimately, that's up
to the f2fs developers...

> > IMHO, as a quick fix, it seems we need to handle MS_DIRSYNC likewse xfs.
> > #define MS_DIRSYNC      128     /* Directory modifications are synchronous */
> 
> We have supported that yet in commit b7e1d800031c ("f2fs: implement -o
> dirsync"). ;)

To be clear, we're not talking about dirsync mode where *all*
directory modifications are synchronous.  What we're talking about
here is the case where if you fsync() a regular file, and the regular
file is newly created --- AND ONLY THAT CASE --- to make sure the
parent directory is included in the set of metadata blocks updated by
the fsync() against the regular file.

Best regards,

						- Ted

  reply	other threads:[~2017-12-28  3:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25  5:28 xfstests: generic/342 run failed in f2fs Chen Rong
2017-12-25  5:56 ` Eric Sandeen
2017-12-25  6:30   ` Chen Rong
2017-12-25  7:47     ` Eric Sandeen
2017-12-25 16:31       ` Theodore Ts'o
2017-12-27 19:11         ` Jaegeuk Kim
2017-12-28  3:17           ` Chao Yu
2017-12-28  3:41             ` Theodore Ts'o [this message]
2017-12-28  9:09           ` Dave Chinner
2017-12-28 16:29             ` Jaegeuk Kim
2017-12-28 16:59             ` Eric Sandeen
2017-12-28 21:21               ` Dave Chinner

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=20171228034143.GA30269@thunk.org \
    --to=tytso@mit.edu \
    --cc=fstests@vger.kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=philip.li@intel.com \
    --cc=rongx.a.chen@intel.com \
    --cc=sandeen@sandeen.net \
    --cc=yuchao0@huawei.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;
as well as URLs for NNTP newsgroup(s).