Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14046049pxu; Mon, 4 Jan 2021 11:19:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoJidPEUKxliIM9/a6CfXAR8TvM5bIKd+Npfzyl9jNTvHtK951c9LteJk1xDTSHIM4W4I4 X-Received: by 2002:a17:906:2798:: with SMTP id j24mr67807408ejc.328.1609787956960; Mon, 04 Jan 2021 11:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609787956; cv=none; d=google.com; s=arc-20160816; b=p21zIfcvOA4DxRLDx8W81g0NGqJRjky2/UkQ0sgqIkqLhfbOduy/h7O5cF/ilFHcES fR5M3XBiVUPALgL6UvHRewUQnD6u6lVocstojf8IlbnZlUsPxyXll1pehBZOIBYoJt4T shWgXLZsSLJU82KIFe4RRG0L3cEmzdAmh4FDL2HjI7F8F7Nha1v2Q/AFlj///r3Emj41 o70bvpXhWrAdihl5R82yKbq/+2H3buyI3rIoc/z+jwf6PIhfGXvJx/ak1BDobLBMOj4X nL8LJNMZzb955Z31FaMcbGFDDMwWvhNZza+2bHOTmBs/FHW+/bdGdfHUtzBcoJIknY4Y oHLQ== 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; bh=jIBTbzo9AgMxkH22n4Yr+QsOqA0uvFEbwusyjWc74jI=; b=sXUXq9C+7gxS7ChTQV+hiydoglOYlLRrrJsLhyVc/ubsvGQgZs9TkZnBELLYJgPPMm LRu3JqVI69Q4/QrogigvPYS5CWYm0NTtGXz+3393zjUZH8CKd0cBOEArV9JspB+DMdHz m0rJ2vevOQoNeZCXDdOqbn00PxaiM8uDcOPLmmjDHxo27PHQ7Tw4XJmdPR6PrP8s5bqS JJN4mEBBnsJy63Lmay7amFaihuakh75QHcfAOpqyi3uXyNCjnvHVU/nCDSNXlfXA067g bF8oUzJpRcHpdOZMT+4kbwBzz0T9Q8jUfcmK9ihYCjAkoDdM6OlsXOoB6OasZZQwO6GT 6xIw== 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 lt15si29723388ejb.499.2021.01.04.11.18.53; Mon, 04 Jan 2021 11:19:16 -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 S1726422AbhADTR4 (ORCPT + 99 others); Mon, 4 Jan 2021 14:17:56 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57610 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726338AbhADTR4 (ORCPT ); Mon, 4 Jan 2021 14:17:56 -0500 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 104JH589020547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Jan 2021 14:17:05 -0500 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 37C9B15C3530; Mon, 4 Jan 2021 14:17:05 -0500 (EST) Date: Mon, 4 Jan 2021 14:17:05 -0500 From: "Theodore Ts'o" To: Andres Freund 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: References: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. That doesn't meant that your proposal shouldn't be adopted. But it would be a good idea to have some kind of way to either allow some kind of tuning knob to disable the user of zeroout (either in the block device, file system, or in userspace), and/or some kind of way to try to automatically figure out whether using zeroout is actually a win, since most users aren't going to be up to adjusting a manual tuning knob. - Ted