Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp416750rwb; Thu, 22 Sep 2022 01:09:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uRJCELWXQz+n0gw8W/A6Tsym8VYAMacgc0wfBMD1u02yccWH3makgIIRm3A8REmM44U1K X-Received: by 2002:a17:906:ef90:b0:77f:8f0d:e925 with SMTP id ze16-20020a170906ef9000b0077f8f0de925mr1729675ejb.622.1663834197659; Thu, 22 Sep 2022 01:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663834197; cv=none; d=google.com; s=arc-20160816; b=LsN9criGYFTiH2YFx4wReUbmdJvDrir50cd0N+HkYrzpyS/DQTgLZ1MMyafy//8/dQ hPBwR5YPJTqK8z3Nx0+e9mBnhDoxLz7TsCNWTJ/D3C3TaoXIcHs9JZTqw/NR6TskN4+W p18pz8+rVn6Ylj9Rpz4H3reTFGPq0gzonv22BmVmxq1kzx8Ock7DJamTXJo6+P9pCp3v X+rv2CR3L6ZOcb+nkuYR9FIYfmv3XflfOf65uWsR8lOqCaqdidAadF6zGdg6o5kiHYn9 6WW5CSfsIdfmW45DJxiB6EmqTzQWbdTB5F6rT77lJzuM5qnQdNpAasB/dEQrkBS6EDu+ sgiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iXb0cbDYs80FVQvp3dlURrNlpg98/EoNXEVRyzUkW50=; b=p35gO/Mxo+kpfK4sWSfu51p2s/hReAS+HF8U6TqGoDM76Rr1cHTMScdl6T45kxHpNk XqGuQCXhtAhdKGxw5R+Guk+q3llGzsLHf/isfbTbWnGv7N0bUQHVvnugczWEliEnu+Qr CK0hEQOWtYd6DbuIqhHcACfOHLGXYPAR2/1mvb3U+zZ1E2WWBWAE13OHFjKiK+aKUgjQ 7ZRoSpdb29UdHmvuSdVovmVwl0MWhrzd36LVQgy/U6nyEvNeSkTvJq2gCuEwWDPgXeia f4l1uVuBkeiywxCMR6a42GOesrpyRScG0pBt65q9Dc/EnE3RWwoHkD8jnQmz5WZx9j85 wMrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IHpFXTxM; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a05640227ce00b004520b01a355si5425946ede.52.2022.09.22.01.09.31; Thu, 22 Sep 2022 01:09:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IHpFXTxM; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbiIVIIT (ORCPT + 99 others); Thu, 22 Sep 2022 04:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbiIVIIS (ORCPT ); Thu, 22 Sep 2022 04:08:18 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8C62CC8EB for ; Thu, 22 Sep 2022 01:08:16 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id bj12so19144504ejb.13 for ; Thu, 22 Sep 2022 01:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=iXb0cbDYs80FVQvp3dlURrNlpg98/EoNXEVRyzUkW50=; b=IHpFXTxMzEFLQHuCqKnKjLgk03sYFq1tMjEvHAzozOB9BfCb+i3KBMhvs3JlKgQj/+ bEMZSL0mvAsy3XH8Hmf/XLkjX9u4gNiXsuA45KPErhXW9/EHW/LMcxrQm6ohuyOJEzLP WpezbHIfEgfsuCUS3VzgSBfjXcGiuMBnnuLlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=iXb0cbDYs80FVQvp3dlURrNlpg98/EoNXEVRyzUkW50=; b=4doqN9ZFgBQj0tII41pB2hnq2Rd5n/a2rP7BAp3Nc/FVv0sTdMmB5GKWWihLtjsjG2 eu3KemWBInPnP38N/peOg+je7jM7/r7dODZJLrcILpIxChIHHSG+5O4r3pdWIWSM5Wml E9cqBMwt1DnX+k67S1G/EpxI/7bCTtXUqdMEdiaoECwk4V1h6zf8XQCKW3PT6K9ceiyO M8fbb5fjeaWOLhAvl9FNOQRNKhphGkHeRp7SfJ9JGxCrUhiuoP28KZyPkmaSXTSGLPRq Jdxlx9FklFx2T2zI93PECcZ433ILJTs/BqglQP4nD8IUSxVj0KsN8AeetrdrM6rw25xa mSWg== X-Gm-Message-State: ACrzQf2WPHRh/A0c8odgGGc3gfwYQEdIMyCPbk7zU0xn3UUyioUrA8uB loLDuBcdLxJNfXXG2mwo4AM3Rb7+xgZTE+f7fLaaNw== X-Received: by 2002:a17:907:968d:b0:782:66dc:4b89 with SMTP id hd13-20020a170907968d00b0078266dc4b89mr478912ejc.386.1663834095090; Thu, 22 Sep 2022 01:08:15 -0700 (PDT) MIME-Version: 1.0 References: <20220915164826.1396245-1-sarthakkukreti@google.com> <20220915164826.1396245-5-sarthakkukreti@google.com> In-Reply-To: From: Sarthak Kukreti Date: Thu, 22 Sep 2022 01:08:03 -0700 Message-ID: Subject: Re: [PATCH RFC 4/8] fs: Introduce FALLOC_FL_PROVISION To: Mike Snitzer 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Sep 21, 2022 at 8:21 AM Mike Snitzer wrote: > > 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? > Not at the moment, but we definitely have ideas to explore re:snapshot and dm-thinp (like A-B updates with thin volume snapshots), where this would definitely be useful! > 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"). > Will do in v2. Thanks for the feedback. Best Sarthak > Mike >