public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Theodore Ts'o <tytso@mit.edu>, Andres Freund <andres@anarazel.de>
Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: fallocate(FALLOC_FL_ZERO_RANGE_BUT_REALLY) to avoid unwritten extents?
Date: Mon, 4 Jan 2021 16:40:08 -0600	[thread overview]
Message-ID: <c18d3d32-9504-016a-b7e7-feeddff0cde6@sandeen.net> (raw)
In-Reply-To: <X/NpsZ8tSPkCwsYE@mit.edu>

On 1/4/21 1:17 PM, Theodore Ts'o wrote:
> On Tue, Dec 29, 2020 at 10:28:19PM -0800, Andres Freund wrote:
>>
>> Would it make sense to add a variant of FALLOC_FL_ZERO_RANGE that
>> doesn't convert extents into unwritten extents, but instead uses
>> blkdev_issue_zeroout() if supported?  Mostly interested in xfs/ext4
>> myself, but ...
> 
> One thing to note is that there are some devices which support a write
> zeros operation, but where it is *less* performant than actually
> writing zeros via DMA'ing zero pages.  Yes, that's insane.
> Unfortunately, there are a insane devices out there....
> 
> This is not hypothetical; I know this because we tried using write
> zeros in mke2fs, and I got regression complaints where
> mke2fs/mkfs.ext4 got substantially slower for some devices.

Was this "libext2fs: mkfs.ext3 really slow on centos 8.2" ?

If so, wasn't the problem that it went from a few very large IOs to a
multitude of per-block fallocate calls, a problem which was fixed by
this commit?

commit 86d6153417ddaccbe3d1f4466a374716006581f4 (HEAD)
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sat Apr 25 11:41:24 2020 -0400

    libext2fs: batch calls to ext2fs_zero_blocks2()
    
    When allocating blocks for an indirect block mapped file, accumulate
    blocks to be zero'ed and then call ext2fs_zero_blocks2() to zero them
    in large chunks instead of block by block.
    
    This significantly speeds up mkfs.ext3 since we don't send a large
    number of ZERO_RANGE requests to the kernel, and while the kernel does
    batch write requests, it is not batching ZERO_RANGE requests.  It's
    more efficient to batch in userspace in any case, since it avoids
    unnecessary system calls.
    
    Reported-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>


or do I have the wrong report above?

I ask because mkfs.xfs is now also using FALLOC_FL_ZERO_RANGE

Thanks,
-Eric

  parent reply	other threads:[~2021-01-04 22:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  6:28 fallocate(FALLOC_FL_ZERO_RANGE_BUT_REALLY) to avoid unwritten extents? Andres Freund
2021-01-04 18:19 ` Darrick J. Wong
2021-01-04 19:10   ` Andres Freund
2021-01-04 19:57     ` Avi Kivity
2021-01-12 18:16       ` Christoph Hellwig
2021-01-12 18:39         ` Andreas Dilger
2021-01-12 18:43           ` Christoph Hellwig
2021-01-12 18:51             ` Andreas Dilger
2021-01-12 21:14               ` Darrick J. Wong
2021-01-12 21:36                 ` Andres Freund
2021-01-13  7:44                   ` Avi Kivity
2021-01-19  3:44                     ` Andreas Dilger
2021-01-04 19:17 ` Theodore Ts'o
2021-01-04 19:24   ` Matthew Wilcox
2021-01-04 20:29   ` Andres Freund
2021-01-04 22:40   ` Eric Sandeen [this message]
2021-01-06 22:52 ` Dave Chinner
2021-01-06 23:40   ` Andres Freund
2021-01-08 20:32     ` 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=c18d3d32-9504-016a-b7e7-feeddff0cde6@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=andres@anarazel.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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