Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14160891pxu; Mon, 4 Jan 2021 14:41:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyxJq/CU731pdHchqry6B8FIvccDL8IB1k2+UmXL5w5QZIZ4j6ukt3hZYX+BEAU7/zsvZQ X-Received: by 2002:aa7:c558:: with SMTP id s24mr74072357edr.257.1609800090274; Mon, 04 Jan 2021 14:41:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609800090; cv=none; d=google.com; s=arc-20160816; b=QUt4c9SMlEo1WVkhS/Jg1gC3t0hpLxysGyFx4jOdVaolyHzkhaI4WfJTY0+NyYgTjH HeFL+HKoxsuLR1QLCHtMmfuRF1lF1iJ7+EuDD2jyN5I1IVcNs38hHGGD3ujmc0GvWBdt sAqn69AO9M5sf5OwaERwh0QDKemZdbkqfWVG2N7owTt+bo9//Ud52bYwrRcoaSk0NN1q dftVd++H7Z4nEG8ofu8oZxP0jdRy2xY0m+G/yIi9Nr124d1U+ecjJuulRlMaf5eJGC2Z dEYrEd1ZGsKAmtW3OZgLL1/CcI1FWzhS51RTdrF8T/g5cG4doqxZoORb9MlpviDW6x9C cPog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=nku/sVhxYb/wyVYWfMvxoE1KTWc+xAsuGHmF/EWd/D0=; b=EdLCTbM6U6AfT6n0BAT4gadHv6IHbDSln8Su6nx0wHS13aNejyc6c36/yLlZAoRJLM FQp1U3RYsWM+TBa2T3q65c78V7Jje7Dm7RdOgwzQR8skaAUTHat0YpemeMZ6ayT9JoJ4 qMr7907VMBenw/4FIc8g0Ug0kXXLAj1ORmcFxKT+PNcaqzlb4MzJot9TJfdEBFskwo5Y qJ01GvSVqbAomIfTbu0ZgNlP8VAuKSDVEvBLroIhxrb8RU4ukQ6fUrDQLB95CtU6uO5j T7N16FRl564sImrO4G+q058NQuq0oCLHrf3fuNvmLE4eOlX+P5mJc/mZxzLPB03lzk6Y VNIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si27174673edw.339.2021.01.04.14.41.04; Mon, 04 Jan 2021 14:41:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbhADWku (ORCPT + 99 others); Mon, 4 Jan 2021 17:40:50 -0500 Received: from sandeen.net ([63.231.237.45]:47872 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbhADWkt (ORCPT ); Mon, 4 Jan 2021 17:40:49 -0500 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 664FF483534; Mon, 4 Jan 2021 16:38:46 -0600 (CST) To: Theodore Ts'o , Andres Freund Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-block@vger.kernel.org References: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> From: Eric Sandeen Subject: Re: fallocate(FALLOC_FL_ZERO_RANGE_BUT_REALLY) to avoid unwritten extents? Message-ID: Date: Mon, 4 Jan 2021 16:40:08 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 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 Signed-off-by: Theodore Ts'o or do I have the wrong report above? I ask because mkfs.xfs is now also using FALLOC_FL_ZERO_RANGE Thanks, -Eric