Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14042646pxu; Mon, 4 Jan 2021 11:14:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJypAx0z3u7XzokrfcO6VX+C0SN1CiI8ZwKXh8MzNXyIpINR3NyAvsSqoIvGO0ie66IllJwk X-Received: by 2002:a17:906:1197:: with SMTP id n23mr68321684eja.359.1609787644038; Mon, 04 Jan 2021 11:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609787644; cv=none; d=google.com; s=arc-20160816; b=wbX653O+Xswi2TmSVgNd0l2AmV/Vwtz8DkEX07oioEES9CGS1YU9zypuUsvG9ZZGT+ nFucxyjitPPzizQFoSktIeX6aYgRCI5UXhXnIfUrinkn8rom9EIcBMA1Vp8Y1b5Qe5+0 mMOK/4ZUTUySqmG5/cGFkppoCMstKdg6GMOGNzqI2veo//CD3KkS95GkDOY2FN9nhdG2 u8496/gqppEavaDO9xSkxjkm8JCmIh8rPWT1lLpQTOFETPb2K/iT6h+VAUohouPOJ2Sc ke0Lu5Qr6DSSrh7IHQbkyRDvgSsYjp+tnscnfjFfefBZkfIXoCvkAbp44IFviih/h//S mEPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=pZXhUZxCSADzBVQ9ofdJtQeBBSexqsAm8Eg19RhO6cI=; b=bTFIOG+6WqvGHVSRcBfhXbPmX59MRh/gwGXgIgT52kmWzHlXShZafJkIPVvZgnYyS1 pnCi3SsB/j2a3t3U5WwJc4xkztArgEH7puMwtEGI1WL73eseTJ8pKErp1GfIe/skHexZ TB30VTitdFmMeM4gmowbMmgDsij30tzIhoVH2LoF4x1qTujXY6cylx7LeirADW3ZxDMl z8uwVBrfn6h0OXn5AR/qHRyRv2Jhq9SHuZa7H9xGdMT9Jcql/JsFFfe5/bTzsX4MrTub JKFdbjUOKruPWR0X4fIKM/G+EcBljgQhedQf8KaGDh5pAqdh5c3sLlRB+8TJt+dUF93D 2yDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm3 header.b=agiscWQ9; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NOehI7cl; 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 k8si28750913ejg.191.2021.01.04.11.13.40; Mon, 04 Jan 2021 11:14:04 -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=@anarazel.de header.s=fm3 header.b=agiscWQ9; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NOehI7cl; 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 S1727520AbhADTLq (ORCPT + 99 others); Mon, 4 Jan 2021 14:11:46 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:53535 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbhADTLq (ORCPT ); Mon, 4 Jan 2021 14:11:46 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0D2925C0126; Mon, 4 Jan 2021 14:11:00 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 04 Jan 2021 14:11:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=pZXhUZxCSADzBVQ9ofdJtQeBBSe xqsAm8Eg19RhO6cI=; b=agiscWQ98ZDuMJN0olfAXH6/OU4LfJ24tbHICetHAC2 nYx4EZXVTSQ2E2t2AxOYCUAkBuEEpwMjAZA1hG/JLI6E+4pQ7uVmymHY92jaVsXm 0BqMIBILJiEYUwQ3m5KIqfb/3JXeVsI3d48/Ei7Y8Llv3uF/Xzd5EMO0ylY+F06X ccH453M0ISZImILbZHSCV99Wq7A4t+xjeiP85iwf9znW+2Mz/HkjoTN/shrv5ri+ Ro8AnK+iya1ZTqgvaNdNZloEA+4yW+GbXvD5SicIkkopqUPATMIYsvAAsb5GDkt6 SuMu/AnCirpfwdRjvfQ/jdhhnb0wzGwOKhibJHFrLuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=pZXhUZ xCSADzBVQ9ofdJtQeBBSexqsAm8Eg19RhO6cI=; b=NOehI7clTvaRQUcobnnJuU JIS01ZYV2qpr7LkfSG0pgRuWTaf8ZEjoxY/+Nu3NIoRenwkkED6AG3wbVIA3h6C8 6EzHv4XRdHYSZy7RThzuM9gT8u83QBXMxXZ/2sd1MFUUNa+qqFeOP3CmgYov/n4i o5lW4eof7DB/4HQOomUFQ1R8Qo3pYe2wtrcIKYD2EWrxPjjGVuzyj1djpCXfAPCl qJ2qtHJwwkS55pzufZlDK+yXGHiFEIFCHvxwxJ07pWMil+2ITgXQUappRtFxYJaV xI6dSLoijMfXJ+5S6aWRzguUZo5kQnkkG4+KvRvgqcYBoQ9g/x3yQcfgdAKgtoUg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeffedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeff hfeuffdunecukfhppeeijedrudeitddrvddujedrvdehtdenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 7CF531080064; Mon, 4 Jan 2021 14:10:59 -0500 (EST) Date: Mon, 4 Jan 2021 11:10:58 -0800 From: Andres Freund To: "Darrick J. Wong" 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? Message-ID: <20210104191058.sryksqjnjjnn5raa@alap3.anarazel.de> References: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> <20210104181958.GE6908@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210104181958.GE6908@magnolia> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. > Since I assume that if the fallocate fails you'll fall back to writing > zeroes from userspace anyway... And there's non-linux platforms as well, at least that's the rumor I hear. > Second question: Would it help to have a FALLOC_FL_DRY_RUN flag that > could be used to probe if a file supports fallocate without actually > changing anything? I'm (separately) pursuing a fix for the loop device > not being able to figure out if a file actually supports a particular > fallocate mode. Hm. I can see some potential uses of such a flag, but I haven't really wished for it so far. Greetings, Andres Freund