Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp21278pxb; Tue, 12 Jan 2021 18:45:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ4YbF7/DIhhXDHKEsi/BbF+z4urWcOuUkaFqNL+bzsVX3eVih0mejPeYv00MHJ+38Oa3F X-Received: by 2002:a17:906:b7cc:: with SMTP id fy12mr1287340ejb.390.1610505907350; Tue, 12 Jan 2021 18:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610505907; cv=none; d=google.com; s=arc-20160816; b=L+6bRSLV9+edN1KSCij8gjP/MlJF3SLRFnGdvovaqnrH3zMz+DXsDwC6yifX5OVraZ GqBwWG7w03n7dmDhgD9UiKNTduzfSR/jqtZsb5fkLcPH1aDAixg8fCYnAZo49Ci9/2py 0dJgmQwPokZuRPxkSmMligu079msYuhxAjIws0DBUrcPiM0Qy1tlZv1+7DWisnTPAC/2 m2Uw/0MIMCewBmmHdLgXc2NpiH0ltVJuu4F3gR0GV5Xm/t8yCNNjoAEoMcVv4FjMy+oY GU5HIgsR+pqqQrIcgpYNYUAPcyLL+xCkTfyps1k4mSjZiqFYuMDds4zPOtlTRLdBX5hd hDQw== 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=bR1zl62x1crSRLRZaw4N0mjRNUkzoJkEbrwHjcd/Sig=; b=leqGQzR6pEmGaptxJcCl02y2iapxyGVMHPdpF4nH87flTozOXC2hMLX+LQsmDgYwCd MssnXQqu57FXVCOad0zrFNIbG13dP+rOLKAV0tx/DtHlHvXH8uSONX0fgLFoLXA5BG2u pbJNcbV1lk/rO3S+cE716Zbi67m9qcJN7TNlJHJfnYOPdLpnZQ65NCpV7NJ6BNHz2CZg s7uP3xrQp5vFiV0eFlSFp9Ay4x0vXAfLwJd1+cBVCJDzgt81lHmC7umnBXJlxg29YcXe yQvZeky274QrBTWtCRaG3wsT36jYB3CDKC8JgsjQPwv/MR6J9Iy2V9jhS0HNbyX+MM5C Ju0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=W07FZK1y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb26si22691ejc.384.2021.01.12.18.44.42; Tue, 12 Jan 2021 18:45:07 -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=@oracle.com header.s=corp-2020-01-29 header.b=W07FZK1y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437115AbhALVh2 (ORCPT + 99 others); Tue, 12 Jan 2021 16:37:28 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56190 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437141AbhALVRs (ORCPT ); Tue, 12 Jan 2021 16:17:48 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10CLDwxf169332; Tue, 12 Jan 2021 21:16:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=bR1zl62x1crSRLRZaw4N0mjRNUkzoJkEbrwHjcd/Sig=; b=W07FZK1ysQcddYInZReTNoPBDnq9Voc+vPtNoQ5utzKwJHik6NAhjj2ev9QZxboUiCZI 9DyMdd/oh41Etv4D2DAjq7Q9X6iCr8h1xW9zA8a00RbJ4QDZZutxFq/2IV/2VWoF2WwI DiHYufs18UUo8BHpTfaRawegmtorKZYsS4B3wVc06XHVdAapCddXWYOVnUGgD1lxrzIP rJa+JwhcqgK8/MQPr3ridgoga604sbChyKrTXYm7Yv21Agexj1+zf3SXXI7Thlz99I4j 2SBsj1N0eqb6zzn/TBJ9vBuptdQdQLT3EZ3c0HI7xqvi+Ura5p7EwzVTamLMvoAbZrW+ /g== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 360kcyrhny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Jan 2021 21:16:53 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10CL65Ce072883; Tue, 12 Jan 2021 21:14:53 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 360keye5qr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Jan 2021 21:14:53 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 10CLElAE013096; Tue, 12 Jan 2021 21:14:47 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 Jan 2021 13:14:47 -0800 Date: Tue, 12 Jan 2021 13:14:45 -0800 From: "Darrick J. Wong" To: Andreas Dilger Cc: Christoph Hellwig , Avi Kivity , Andres Freund , 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: <20210112211445.GC1164248@magnolia> References: <20201230062819.yinrrp6uwfegsqo3@alap3.anarazel.de> <20210104181958.GE6908@magnolia> <20210104191058.sryksqjnjjnn5raa@alap3.anarazel.de> <20210112181600.GA1228497@infradead.org> <20210112184339.GA1238746@infradead.org> <1C33DEE4-8BE9-4BF3-A589-E11532382B36@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1C33DEE4-8BE9-4BF3-A589-E11532382B36@dilger.ca> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9862 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101120126 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9862 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1011 mlxlogscore=999 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101120127 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jan 12, 2021 at 11:51:07AM -0700, Andreas Dilger wrote: > On Jan 12, 2021, at 11:43 AM, Christoph Hellwig wrote: > > > > On Tue, Jan 12, 2021 at 11:39:58AM -0700, Andreas Dilger wrote: > >>> 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. > >> > >> Similarly, ext4 also has EXT4_GET_BLOCKS_CREATE_ZERO that can allocate zero > >> filled extents rather than unwritten extents (without clobbering existing > >> data like FALLOC_FL_ZERO_RANGE does), and just needs a flag from fallocate() > >> to trigger it. This is plumbed down to blkdev_issue_zeroout() as well. > > > > XFS_IOC_ALLOCSP64 actually is an ioctl that has been around since 1995 > > on IRIX (as an fcntl). > > I'm not against adding XFS_IOC_ALLOCSP64 to ext4, if applications are actually > using that. Some of them are, but-- ALLOCSP64 can only allocate pre-zeroed blocks as part of extending EOF, whereas a new FZERO flag means that we can pre-zero an arbitrary range of bytes in a file. I don't know if Avi or Andres' usecases demand that kind of flexibilty but I know I'd rather go for the more powerful interface. --D > It also makes sense to me that there also be an fallocate() mode for allocating > zeroed blocks (which was the original request), since fallocate() is already > doing very similar things and is the central interface for managing block > allocation instead of having a filesystem-specific ioctl() to do this. > > Cheers, Andreas > > > > >