Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14066595pxu; Mon, 4 Jan 2021 11:59:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2HX3xsVHO76hREyq2YNj5eJIPGY6fCwkMYyAVLD7TZYW7GcP7ob9hqnfagL4zHc0LXAHD X-Received: by 2002:a05:6402:1102:: with SMTP id u2mr42560253edv.18.1609790354265; Mon, 04 Jan 2021 11:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609790354; cv=none; d=google.com; s=arc-20160816; b=L0Xo2eAENfTSeg+NPqonWCxYzr1ar8fuduUvreFgOAJdHrlbvh6Ma/r9L61cbkSMAw m0uETIeSDUJ3PE67ow/kjlayQFBYe8KTQ0WPEAs14UlKw2XuxY4JJDAaHugCGHPGqBAK Oc/YT8vZ4rAZ1Ue1A6mrY4SCg+EIoxRWRyjuxC8vCslcIzr9RwroLpt0XLqPMj+a2udD FwpVdzSS+69xQAdAeEfGjOh7nw0A/Qj75+RYgEgLxbP6sMwSNkddMxy6O3iDZL1c7pF6 lmDhN5c6x5p/Bn5ZihCxJVh8RiQjLhAJ7euD0SqflqkOfphQqGMmQ1oVXx42AasL3Noq Qfuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=ej0OIFO+0mGGo2YkH0+skzJSTijcTNuOuUrtv7QADVU=; b=JoZLe9MWqeJ5DrHFA7NnJKI1Tws8ksMuNunZZdebJGVso6sT3YmMnsrOsSIA+Q8pvH fxCHFCQbxUV+fWjsEkbgWHwL1Oka7YnLuvJ+m5xP6QPIitHwxTwxElQ0dW9tQ/7N8QUs kdJqJhniIjtk4ZE5M3CD/EDVyUB44NOQc+4B10iDzNkgrtAmdynZY/nSmFbhK5OFWQEb tvcLKZ3sY0rUKnS3IbqKhb95K68iJGPtj4cu7ia2YeKwbmOaAP1mf5zcFAPybu+IjVAV SB9EVOE+4CSVhOsPaTy0ZKE8sPQljaxAIgCGshAGDcgBFjRHCpyN8hOh4kR9q5I+hOyJ HjRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@scylladb-com.20150623.gappssmtp.com header.s=20150623 header.b="K/p1TYjh"; 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 a3si32611795edn.541.2021.01.04.11.58.48; Mon, 04 Jan 2021 11:59:14 -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; dkim=pass header.i=@scylladb-com.20150623.gappssmtp.com header.s=20150623 header.b="K/p1TYjh"; 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 S1727888AbhADT6d (ORCPT + 99 others); Mon, 4 Jan 2021 14:58:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727415AbhADT6c (ORCPT ); Mon, 4 Jan 2021 14:58:32 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1409FC061793 for ; Mon, 4 Jan 2021 11:57:52 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id y17so33363351wrr.10 for ; Mon, 04 Jan 2021 11:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ej0OIFO+0mGGo2YkH0+skzJSTijcTNuOuUrtv7QADVU=; b=K/p1TYjhBPrjwYWg42hO8xCm9nV7t1BzsFy+MkG6NZuoSgZ2fd9YUiwhayFIt/hC2m At3oo0ImnAeAYRKSwydDWgzPGJlQNfaIiNTO2kIsu1GPjKa1d3em2vZNoBUT6KTRlA6K sjLsixuyl2+VWR3WvSpyvoEYwnFG4yt+Hky6IxPRW55KNXIY5AgsvDBd2N3xHfVC1Mmr PKU4zOacSu1Ox9gX1BMCgomcfojfwsxRkH3bqM0A7agdpT45UWRMAAvrPN3/t5gkMfPZ IM9Oh394lhiv9DcuLFQdnT4oLSIvYEbh+/9ioNVLVO8QYrqB3hJM16MgEUL4MDHH/RbI xGRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=ej0OIFO+0mGGo2YkH0+skzJSTijcTNuOuUrtv7QADVU=; b=BLUGoKMRKi3nBQlM6ax1ioh19+1aRiX8ZaA9/aYQKJ6v1Tv+tgzZdqwkQ2Y6wfE6Z0 sLlIBSAEuro2lb7k9sNQ5PeGH4GWQugTD3mPvaFulblBr7ZfMMChkyasDzTF3ncbp7hl yRBBfRb8kIV7qW4mmfeZEheyNnO72Q3hC3ARL8Q4+QaOGH9cQsyfd4uJmg8wRs2yO97l XI+x1qTn7b6l2FWNhSCaBVAHKVNbIniQvtAQk+2Ed+bP34G97QWHYge2FD4a5/4J+fmh a8prYqyeOfYFV0phAuteQNGAMgpJw3g7cXMsJpcp9NNAkd6RB4YebEfuLKVa1839r7VU DdzA== X-Gm-Message-State: AOAM532cAedLouW5muozgj8zfExjJhcQoRKiGxgHh8fBeuG0RHbMhBUq WJl7ZkC0hW1M5LRgCB+3ZWXd9g== X-Received: by 2002:adf:e4ca:: with SMTP id v10mr82787551wrm.260.1609790270744; Mon, 04 Jan 2021 11:57:50 -0800 (PST) Received: from [10.0.0.1] (system.cloudius-systems.com. [199.203.229.89]) by smtp.gmail.com with ESMTPSA id u13sm94488427wrw.11.2021.01.04.11.57.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 11:57:49 -0800 (PST) Subject: Re: fallocate(FALLOC_FL_ZERO_RANGE_BUT_REALLY) to avoid unwritten extents? To: Andres Freund , "Darrick J. Wong" 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> <20210104181958.GE6908@magnolia> <20210104191058.sryksqjnjjnn5raa@alap3.anarazel.de> From: Avi Kivity Organization: ScyllaDB Message-ID: Date: Mon, 4 Jan 2021 21:57:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210104191058.sryksqjnjjnn5raa@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 04/01/2021 21.10, Andres Freund wrote: > Hi, > > On 2021-01-04 10:19:58 -0800, Darrick J. Wong 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 ... >>> >>> Doing so as a variant of FALLOC_FL_ZERO_RANGE seems to make the most >>> sense, as that'd work reasonably efficiently to initialize newly >>> allocated space as well as for zeroing out previously used file space. >>> >>> >>> As blkdev_issue_zeroout() already has a fallback path it seems this >>> should be doable without too much concern for which devices have write >>> zeroes, and which do not? >> Question: do you want the kernel to write zeroes even for devices that >> don't support accelerated zeroing? > I don't have a strong opinion on it. A complex userland application can > do a bit better job managing queue depth etc, but otherwise I suspect > doing the IO from kernel will win by a small bit. And the queue-depth > issue presumably would be relevant for write-zeroes as well, making me > lean towards just using the fallback. > The new flag will avoid requiring DMA to transfer the entire file size, and perhaps can be implemented in the device by just adjusting metadata. So there is potential for the new flag to be much more efficient. But note it will need to be plumbed down to md and dm to be generally useful.