From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49E4BC6FA82 for ; Wed, 21 Sep 2022 15:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663774081; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=26W41q9D01iF4RPjEkP2S5gNdp4p45ArrfRI2ijJMbo=; b=TW3kY/k6wmTAPCh8iO1Dq/hdCJEEXiRANWRTtUxTWhZ3ZfGvVip4b8jMbyX2ERRQCxwJnY ZWB1ul1YopBTpsdpItJcCZqYjKtp/6lMYtup1w05Rw+6tcvOb1i4oO1l2R+sC3q8KJcgK6 hzBKYDyi4mCq4jzcASfJ77rPaQZjPx4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-530--uBKgeRXMI2yOStxjNSp_Q-1; Wed, 21 Sep 2022 11:27:59 -0400 X-MC-Unique: -uBKgeRXMI2yOStxjNSp_Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A89BF3C1172F; Wed, 21 Sep 2022 15:27:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 542F8492B05; Wed, 21 Sep 2022 15:27:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0C01D19465B1; Wed, 21 Sep 2022 15:27:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 281A519465A4 for ; Wed, 21 Sep 2022 15:21:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2D62D49BB62; Wed, 21 Sep 2022 15:21:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2668449BB60 for ; Wed, 21 Sep 2022 15:21:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3EE31C05AAE for ; Wed, 21 Sep 2022 15:21:41 +0000 (UTC) Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-643-2vRo4ompNE-fQHIdvtnZHQ-1; Wed, 21 Sep 2022 11:21:40 -0400 X-MC-Unique: 2vRo4ompNE-fQHIdvtnZHQ-1 Received: by mail-qt1-f200.google.com with SMTP id e8-20020ac85988000000b0035c39dd5eb9so4392603qte.16 for ; Wed, 21 Sep 2022 08:21:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=YKklums/Err7Bepni4gts8csmAXQyEMPG5WxwPmhH+I=; b=LllKyni0Gxa/HUm18xvwtoASM82NsGNgZ4vFJa//EiiFZcil8w8v5WpdOeLGU9hEcA usuFAtB1D+EGRjZsgUnAVV+oADNMbz0OorS7WIpd6EcJ72MuiWRoVDbmdmxd6nsIUVfd HOx5l7zg2f2u/ym12+ErTvk3Kcwmt4GknwjH1nvn+250LJMykZUU3pR3fK8YJM55rEoz wHTb4EAaB/DEOYobio1kKwogZEBmchYUslcNZciInBM+OCqNb4qKvF7pvlD/vKqOq0lW 3zWjdQvt5bvfUYfOn8bR0D+CfATJJxbZBXCBYCALFt1FV4HokCmzfakwnifpdh3+bD9M gXvw== X-Gm-Message-State: ACrzQf22lePzbKdEbPo78oxsx8qQEtdUSR/Imif4dPT0oVCiU6oiGin+ 5cSQx++FVGdVhveZgV5f/QpDQMZ5R/cEr+z78Fu7bI4dH9p8/YwEYE4aamao5eigW6s1ar48s9V INCHFKGhlXP7aqA== X-Received: by 2002:a05:622a:613:b0:342:f81f:4f7e with SMTP id z19-20020a05622a061300b00342f81f4f7emr23848802qta.198.1663773699667; Wed, 21 Sep 2022 08:21:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OzWfjG2GRtTFHT6VQqKwenYDGxd0vRx6UOENP8cSn03FrcY2GR/YED/OGOmZJunHnK1JMlw== X-Received: by 2002:a05:622a:613:b0:342:f81f:4f7e with SMTP id z19-20020a05622a061300b00342f81f4f7emr23848782qta.198.1663773699383; Wed, 21 Sep 2022 08:21:39 -0700 (PDT) Received: from localhost ([217.138.198.196]) by smtp.gmail.com with ESMTPSA id cf14-20020a05622a400e00b0031f41ea94easm1815844qtb.28.2022.09.21.08.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 08:21:39 -0700 (PDT) Date: Wed, 21 Sep 2022 11:21:37 -0400 From: Mike Snitzer To: Sarthak Kukreti Message-ID: References: <20220915164826.1396245-1-sarthakkukreti@google.com> <20220915164826.1396245-5-sarthakkukreti@google.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Subject: Re: [dm-devel] [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , linux-block@vger.kernel.org, Theodore Ts'o , "Michael S . Tsirkin" , Jason Wang , Bart Van Assche , Mike Snitzer , linux-kernel@vger.kernel.org, Gwendal Grignou , virtualization@lists.linux-foundation.org, Christoph Hellwig , dm-devel@redhat.com, Andreas Dilger , Daniil Lunev , Stefan Hajnoczi , Paolo Bonzini , linux-ext4@vger.kernel.org, Evan Green , Alasdair Kergon Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Sep 21 2022 at 1:54P -0400, Sarthak Kukreti wrote: > On Tue, Sep 20, 2022 at 12:49 AM Christoph Hellwig wrote: > > > > On Thu, Sep 15, 2022 at 09:48:22AM -0700, Sarthak Kukreti wrote: > > > From: Sarthak Kukreti > > > > > > FALLOC_FL_PROVISION is a new fallocate() allocation mode that > > > sends a hint to (supported) thinly provisioned block devices to > > > allocate space for the given range of sectors via REQ_OP_PROVISION. > > > > So, how does that "provisioning" actually work in todays world where > > storage is usually doing out of place writes in one or more layers, > > including the flash storage everyone is using. Does it give you one > > write? And unlimited number? Some undecided number inbetween? > > Apologies, the patchset was a bit short on describing the semantics so > I'll expand more in the next revision; I'd say that it's the minimum > of regular mode fallocate() guarantees at each allocation layer. For > example, the guarantees from a contrived storage stack like (left to > right is bottom to top): > > [ mmc0blkp1 | ext4(1) | sparse file | loop | dm-thinp | dm-thin | ext4(2) ] > > would be predicated on the guarantees of fallocate() per allocation > layer; if ext4(1) was replaced by a filesystem that did not support > fallocate(), then there would be no guarantee that a write to a file > on ext4(2) succeeds. > > For dm-thinp, in the current implementation, the provision request > allocates blocks for the range specified and adds the mapping to the > thinpool metadata. All subsequent writes are to the same block, so > you'll be able to write to the same block inifinitely. Brian mentioned > this above, one case it doesn't cover is if provision is called on a > shared block, but the natural extension would be to allocate and > assign a new block and copy the contents of the shared block (kind of > like copy-on-provision). It follows that ChromiumOS isn't using dm-thinp's snapshot support? But please do fold in incremental dm-thinp support to properly handle shared blocks (dm-thinp already handles breaking sharing, etc.. so I'll need to see where you're hooking into that you don't get this "for free"). Mike -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BA8DECAAD8 for ; Wed, 21 Sep 2022 15:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbiIUPVo (ORCPT ); Wed, 21 Sep 2022 11:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbiIUPVn (ORCPT ); Wed, 21 Sep 2022 11:21:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C49F9883F7 for ; Wed, 21 Sep 2022 08:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663773702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YKklums/Err7Bepni4gts8csmAXQyEMPG5WxwPmhH+I=; b=TrclK+63LB7OIW1J+V6EXcu3rRvnWI1yR1A0KXXPtEmm8ke+tEI7oNCBxkSkYv13vDzKZA DNtM/ipMAlvEvLzD0YGeT4I+5xMzublmEPR17e0pDm4lrbCHMfmq6AcHF0Iyaw+UKgNQP4 z66UqNsMKi7Hmylk+zcZ/xTWQA2fdmA= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-643-wkzsILhLNm-Pe8FljS23xg-1; Wed, 21 Sep 2022 11:21:40 -0400 X-MC-Unique: wkzsILhLNm-Pe8FljS23xg-1 Received: by mail-qt1-f199.google.com with SMTP id h7-20020ac85047000000b0035a6794699bso4375286qtm.3 for ; Wed, 21 Sep 2022 08:21:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=YKklums/Err7Bepni4gts8csmAXQyEMPG5WxwPmhH+I=; b=o4jIrOxbd6fgFBVddrMyU0yWtnjHYPMs5GRjaFf1nmeLfKzKPPo9EHPrPDAeQwb67V kU3mf62cIn6vro8wmsSSJOqlMfvcRbXAEzT5LcN42SSd1KSoQs9G8g0vFHONoQMffRQ0 VBkqjDA3lA1M00/zw0eg9JS4tMVefmJjnhrC8WldzmoQxLiEJw1sx/+4XgLUZAQ0oi4N OZBvmQeDRfrFvFDTWOFaP2AhzP2XVF09NT+FmwN1kHiCPpLju7x3o9S00lKKdPXfBQjz 5mmUnqannCSafa97sEwJIKBbHoEiOy/uZLHWG7LcKvU7HT+gUzIgrrdtmEQrS+jztd+z uAiA== X-Gm-Message-State: ACrzQf24LhZolzVs4/nJphmDsH+qVv5qBQj35QQUMfMIQCna1NApfbn7 xBxW+4Xe8fXR8sK+5wPzPnx8d5VaBEz5dx4GCi5JexcD+Afh6aZPRtcjewfdIVjkgNlTcBjHid4 dOYjru7Igpmha6vh9BTFSjA== X-Received: by 2002:a05:622a:613:b0:342:f81f:4f7e with SMTP id z19-20020a05622a061300b00342f81f4f7emr23848817qta.198.1663773699685; Wed, 21 Sep 2022 08:21:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OzWfjG2GRtTFHT6VQqKwenYDGxd0vRx6UOENP8cSn03FrcY2GR/YED/OGOmZJunHnK1JMlw== X-Received: by 2002:a05:622a:613:b0:342:f81f:4f7e with SMTP id z19-20020a05622a061300b00342f81f4f7emr23848782qta.198.1663773699383; Wed, 21 Sep 2022 08:21:39 -0700 (PDT) Received: from localhost ([217.138.198.196]) by smtp.gmail.com with ESMTPSA id cf14-20020a05622a400e00b0031f41ea94easm1815844qtb.28.2022.09.21.08.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 08:21:39 -0700 (PDT) Date: Wed, 21 Sep 2022 11:21:37 -0400 From: Mike Snitzer To: Sarthak Kukreti Cc: Christoph Hellwig , dm-devel@redhat.com, linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Jens Axboe , "Michael S . Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Alasdair Kergon , Mike Snitzer , Theodore Ts'o , Andreas Dilger , Bart Van Assche , Daniil Lunev , Evan Green , Gwendal Grignou Subject: Re: [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION Message-ID: References: <20220915164826.1396245-1-sarthakkukreti@google.com> <20220915164826.1396245-5-sarthakkukreti@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed, Sep 21 2022 at 1:54P -0400, Sarthak Kukreti wrote: > On Tue, Sep 20, 2022 at 12:49 AM Christoph Hellwig wrote: > > > > On Thu, Sep 15, 2022 at 09:48:22AM -0700, Sarthak Kukreti wrote: > > > From: Sarthak Kukreti > > > > > > FALLOC_FL_PROVISION is a new fallocate() allocation mode that > > > sends a hint to (supported) thinly provisioned block devices to > > > allocate space for the given range of sectors via REQ_OP_PROVISION. > > > > So, how does that "provisioning" actually work in todays world where > > storage is usually doing out of place writes in one or more layers, > > including the flash storage everyone is using. Does it give you one > > write? And unlimited number? Some undecided number inbetween? > > Apologies, the patchset was a bit short on describing the semantics so > I'll expand more in the next revision; I'd say that it's the minimum > of regular mode fallocate() guarantees at each allocation layer. For > example, the guarantees from a contrived storage stack like (left to > right is bottom to top): > > [ mmc0blkp1 | ext4(1) | sparse file | loop | dm-thinp | dm-thin | ext4(2) ] > > would be predicated on the guarantees of fallocate() per allocation > layer; if ext4(1) was replaced by a filesystem that did not support > fallocate(), then there would be no guarantee that a write to a file > on ext4(2) succeeds. > > For dm-thinp, in the current implementation, the provision request > allocates blocks for the range specified and adds the mapping to the > thinpool metadata. All subsequent writes are to the same block, so > you'll be able to write to the same block inifinitely. Brian mentioned > this above, one case it doesn't cover is if provision is called on a > shared block, but the natural extension would be to allocate and > assign a new block and copy the contents of the shared block (kind of > like copy-on-provision). It follows that ChromiumOS isn't using dm-thinp's snapshot support? But please do fold in incremental dm-thinp support to properly handle shared blocks (dm-thinp already handles breaking sharing, etc.. so I'll need to see where you're hooking into that you don't get this "for free"). Mike From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0269CECAAD8 for ; Wed, 21 Sep 2022 15:21:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6130861038; Wed, 21 Sep 2022 15:21:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6130861038 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GxEcKPUY X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PpueBCkYwFwD; Wed, 21 Sep 2022 15:21:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id D86FE60F4C; Wed, 21 Sep 2022 15:21:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D86FE60F4C Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BD41FC0033; Wed, 21 Sep 2022 15:21:51 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 44706C002D for ; Wed, 21 Sep 2022 15:21:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 12F1761038 for ; Wed, 21 Sep 2022 15:21:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 12F1761038 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WObsb1QI8lHU for ; Wed, 21 Sep 2022 15:21:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3BB0260F4C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3BB0260F4C for ; Wed, 21 Sep 2022 15:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663773709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YKklums/Err7Bepni4gts8csmAXQyEMPG5WxwPmhH+I=; b=GxEcKPUY6x8GKCTIvvYfgU0IKXTcJYP+z8KSGysJujd4QqrGKei51TdQer7gPwU9ZpB4MC 0w7e1lxXmAZsSDoXQmApETCjMkhnryjZFoDM4z6vntA9zYbSAU9z/rMYvJcj8uV1faPSxs 5gInuxDZ03dGL1yZx0SzAn8+egrm6CU= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-511-eSOhAr-MNc2okMu2fW2JrA-1; Wed, 21 Sep 2022 11:21:40 -0400 X-MC-Unique: eSOhAr-MNc2okMu2fW2JrA-1 Received: by mail-qt1-f200.google.com with SMTP id fe14-20020a05622a4d4e00b0035cc376b1d5so4370864qtb.4 for ; Wed, 21 Sep 2022 08:21:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=YKklums/Err7Bepni4gts8csmAXQyEMPG5WxwPmhH+I=; b=xLWcuz/D/GzRl0SM03WPAfekdGuAjh0ozRMRG1HHdQVGm0UKYFJcnES6O15Ytk3NJa cDl7RVaYL0N9kPDHokjDpEgBqp9GZ0gatsRA9vDuprn2eMq4e7xaKXiRbmTf5KiD6UQB nuF4BVeCl1++OTQdI6c8QsF/3k+kwb6XJKyPmsp3L20jgASmF81W8YMKVnEHfoC+Ocn6 6R23MpLm42llVwUl0EZHtrtaxMAbNnl+02H4qTe2Rk4jhPaowu3oVbHagKOLcfPi2Q4+ yOtP11xeP7hno90nvod9wVoQIW/0boF3jGvAo6EKN80TseEHBsywG9fSPCcWp6VikE50 zVVw== X-Gm-Message-State: ACrzQf2oVjl5sb3gq9nSXGIML2C4fsmdk1h+NieqTWCIC5U4ZEpIPnMM iPnDvjmBJvxGpRRXcp5qpxJ5IvLUGLPpTURbq1tulEHCJth3kXybffLAQ7AgjFfIJq8e8DN7A3M irHk6ktQVpVGaK9P/GPnMUoRvd9sNiP8PBrCUk5Mi X-Received: by 2002:a05:622a:613:b0:342:f81f:4f7e with SMTP id z19-20020a05622a061300b00342f81f4f7emr23848816qta.198.1663773699683; Wed, 21 Sep 2022 08:21:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OzWfjG2GRtTFHT6VQqKwenYDGxd0vRx6UOENP8cSn03FrcY2GR/YED/OGOmZJunHnK1JMlw== X-Received: by 2002:a05:622a:613:b0:342:f81f:4f7e with SMTP id z19-20020a05622a061300b00342f81f4f7emr23848782qta.198.1663773699383; Wed, 21 Sep 2022 08:21:39 -0700 (PDT) Received: from localhost ([217.138.198.196]) by smtp.gmail.com with ESMTPSA id cf14-20020a05622a400e00b0031f41ea94easm1815844qtb.28.2022.09.21.08.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 08:21:39 -0700 (PDT) Date: Wed, 21 Sep 2022 11:21:37 -0400 From: Mike Snitzer To: Sarthak Kukreti Subject: Re: [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION Message-ID: References: <20220915164826.1396245-1-sarthakkukreti@google.com> <20220915164826.1396245-5-sarthakkukreti@google.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: Jens Axboe , linux-block@vger.kernel.org, Theodore Ts'o , "Michael S . Tsirkin" , Bart Van Assche , Mike Snitzer , linux-kernel@vger.kernel.org, Gwendal Grignou , virtualization@lists.linux-foundation.org, Christoph Hellwig , dm-devel@redhat.com, Andreas Dilger , Daniil Lunev , Stefan Hajnoczi , Paolo Bonzini , linux-ext4@vger.kernel.org, Evan Green , Alasdair Kergon X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Wed, Sep 21 2022 at 1:54P -0400, Sarthak Kukreti wrote: > On Tue, Sep 20, 2022 at 12:49 AM Christoph Hellwig wrote: > > > > On Thu, Sep 15, 2022 at 09:48:22AM -0700, Sarthak Kukreti wrote: > > > From: Sarthak Kukreti > > > > > > FALLOC_FL_PROVISION is a new fallocate() allocation mode that > > > sends a hint to (supported) thinly provisioned block devices to > > > allocate space for the given range of sectors via REQ_OP_PROVISION. > > > > So, how does that "provisioning" actually work in todays world where > > storage is usually doing out of place writes in one or more layers, > > including the flash storage everyone is using. Does it give you one > > write? And unlimited number? Some undecided number inbetween? > > Apologies, the patchset was a bit short on describing the semantics so > I'll expand more in the next revision; I'd say that it's the minimum > of regular mode fallocate() guarantees at each allocation layer. For > example, the guarantees from a contrived storage stack like (left to > right is bottom to top): > > [ mmc0blkp1 | ext4(1) | sparse file | loop | dm-thinp | dm-thin | ext4(2) ] > > would be predicated on the guarantees of fallocate() per allocation > layer; if ext4(1) was replaced by a filesystem that did not support > fallocate(), then there would be no guarantee that a write to a file > on ext4(2) succeeds. > > For dm-thinp, in the current implementation, the provision request > allocates blocks for the range specified and adds the mapping to the > thinpool metadata. All subsequent writes are to the same block, so > you'll be able to write to the same block inifinitely. Brian mentioned > this above, one case it doesn't cover is if provision is called on a > shared block, but the natural extension would be to allocate and > assign a new block and copy the contents of the shared block (kind of > like copy-on-provision). It follows that ChromiumOS isn't using dm-thinp's snapshot support? But please do fold in incremental dm-thinp support to properly handle shared blocks (dm-thinp already handles breaking sharing, etc.. so I'll need to see where you're hooking into that you don't get this "for free"). Mike _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization