Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3269789pxb; Tue, 12 Jan 2021 10:18:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVEYRXH3KoPXIXaTNlch+cxAjzxOxivkXmX4kXRIWC3IOvOxJDu11f/3tljt7lCRPTCZ/7 X-Received: by 2002:a17:906:94d2:: with SMTP id d18mr96224ejy.94.1610475483569; Tue, 12 Jan 2021 10:18:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610475483; cv=none; d=google.com; s=arc-20160816; b=sl4bnni59JQNZhGs0aj/BxWCr+E2qvb2xEapUQZU8Bs7dIUB2mTO3tgU6HIzmbKf1G kWkh+q4uBq3iCGm2oFkiY67HgiCupvaq4k0wAJ9dpJjGMQEM0kauBd6bvkwyO83GxqwT LZqJ0e8xqsmFBrxavWTKIsYNakzp3cEarnmhHDchdIYcLGY1wa6+2rzRSHeCHyw0IMoH UbFW/Pf4WfOWEWi7VtxKFRXcxfXQsuTm+hv+l7RPCyE2e1naDNeNRduOjSxTweDZJeZw oL43fVrhK1+7McCfjOllNhynTu2LSvSoKUJ7fOi6/fWElaczGzCeY76BkPnRKsggdvL4 aMEQ== 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; bh=9NZJmYiv3WvaLd4DekuUPhNFoe24SSZqwwyXq3L2EsE=; b=yK3/JvW9tFLchJsJvEx3PAki+rNT4706E/8Eb8vX8kuLLmpEi11PgZsycj/vSB1EhC DVEliax0snRKxYDxgY50GIk1SxwywwC1MyxllA0/4OaV9pNv7O+WEEtnNNq8prMJJD2E ohRoPpHhpuBdYS2HpyMLpHS3Umnzm8d3HbDqcFDtc+Zbl2xI3jImYa6cN7hS5QrFiZG7 rWzHJnmHH2qjLsfAzLXSBGKk2r/tQm/a+uxV4GvUb2Ig9epUCzG8UrKM+tSUj0e7+Z6p 3ufFdUZxUX+/2Ks6W3lVLegniVjUKds7Rf6+gr7dVk7vicjFplkKKUhvD6fH632SNtSS 2jdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XEMEqV6S; 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 bt17si1421633ejb.333.2021.01.12.10.17.37; Tue, 12 Jan 2021 10:18:03 -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=@infradead.org header.s=casper.20170209 header.b=XEMEqV6S; 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 S2406135AbhALSRU (ORCPT + 99 others); Tue, 12 Jan 2021 13:17:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390926AbhALSRT (ORCPT ); Tue, 12 Jan 2021 13:17:19 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E79B9C0617B1; Tue, 12 Jan 2021 10:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9NZJmYiv3WvaLd4DekuUPhNFoe24SSZqwwyXq3L2EsE=; b=XEMEqV6SQPKTYXhyC7rWE0dTYx EyaCqPCtJinetgHQJ5FwZJd+9k7uHqGzbYMGURYfgC9sdoWFWX5lBbosqX9t1NNaQZHuyz6b5mj+n H6gwP83sjvqt1tgakFIPS6FfStjbOV21iBSCL1WwEJozn42dbIv05QSFuDusj8z6xz+OCDMSWh0wl wiej+sOKoAfNQoMhmmA6onM7CuJ3zM9hP5a/i/I4bB7H6TwazCqQLDHtSC/8dmtSMMzq3ChfS/sdM M6T4shIq6yV+/ey6IE4/t83CG/UAeS2c4/PKyo1pVgsC+ninMbpwnEUZb++z91rqzWNhYhqiSwauZ lBz7zrLg==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1kzOD2-005AMI-M8; Tue, 12 Jan 2021 18:16:04 +0000 Date: Tue, 12 Jan 2021 18:16:00 +0000 From: Christoph Hellwig To: Avi Kivity Cc: Andres Freund , "Darrick J. Wong" , 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: <20210112181600.GA1228497@infradead.org> References: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> <20210104181958.GE6908@magnolia> <20210104191058.sryksqjnjjnn5raa@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Jan 04, 2021 at 09:57:48PM +0200, Avi Kivity wrote: > > 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. We already support a WRITE_ZEROES operation, which many (but not all) NVMe devices and some SCSI devices support. The blkdev_issue_zeroout helper can use those, or falls back to writing actual zeroes. XFS already has a XFS_IOC_ALLOCSP64 that is defined to actually allocate written extents. It does not currently use blkdev_issue_zeroout, but could be changed pretty trivially to do so. > But note it will need to be plumbed down to md and dm to be generally > useful. DM and MD already support mddev_check_write_zeroes, at least for the usual targets.