Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp151727rwd; Tue, 6 Jun 2023 20:22:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6rzBu0JI5pD6GjI66D5ljf92iD446AyJC/2pl34RjFoaLQ+ZIK/avaLkZ44inzF6j26sft X-Received: by 2002:a17:90a:11:b0:256:6167:c725 with SMTP id 17-20020a17090a001100b002566167c725mr3706558pja.6.1686108139048; Tue, 06 Jun 2023 20:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686108139; cv=none; d=google.com; s=arc-20160816; b=IQDie85SCKw3mOVHYyxZEsKPmTq7we/bkxEEt6vQWNC5M5LHingYlhTd7x3XD+pDhu p1JZ8S6NZGmq2xMQlulz8qejAkv1m6+RbIXf0FXiQi0/wQIJIzJGAFIsgujXeIIjikmq m5xDgdS7KXO+8HrxKl0uUsFO1OWIhMIFVEflUhI3803moRlkeBo3B1JSTwODF3gT5GJm CC1Bg/Kjmc8XZHWuuv3yiNfzY8/4IKlfJ+BrpTVOMBNJsG6EuHJArog5msIeOnHE/miV u7H4HUtjnTyOmdEW1iWfwNFgua80ij4jOJyShtriFk1OznfFP2UevCauZ8rZW9MWC3mp NRCw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oQUlCOcqt0tuXvcUCaoZv+EjOka/kZ7fKStDDBCleig=; b=gIpA0tH6owf1aVBxA1sReTPQvZm21UkAkM6uAdE9xReLmN58xb1ELyRUMJe5dmQaQ3 rMVFVpkQVBgKRC9SKiuJyklLJRx90RhCGMu1BSjtEHT4RB0EfHFZ2KEAOnZFVfztmgdR zKf7rTF9UbojFq7O0W+HSL/r5vP7bGfllec/8L9gqKHOV4QKYA7Yq6ZqeZT9ILDA0UTR LgyfMNch+wbFNfuXs7v8CRX8CiS5ND7pU/E/Z5TOLiDCk+3WpG3ueN5ZJN268raLixpd Ai+P3exYBQ1Jn2JpaAs9HmKYfGlHKTNHi8Df2uH5OvOfm7mPc2RMBT69BKcdaQG+y+j8 32Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=q+TsFLfQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv12-20020a17090b1b4c00b00256b986e608si437728pjb.132.2023.06.06.20.22.05; Tue, 06 Jun 2023 20:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=q+TsFLfQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240725AbjFGCPY (ORCPT + 99 others); Tue, 6 Jun 2023 22:15:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240715AbjFGCPT (ORCPT ); Tue, 6 Jun 2023 22:15:19 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B71111BC0 for ; Tue, 6 Jun 2023 19:15:16 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b24b34b59fso5059825ad.3 for ; Tue, 06 Jun 2023 19:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1686104116; x=1688696116; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=oQUlCOcqt0tuXvcUCaoZv+EjOka/kZ7fKStDDBCleig=; b=q+TsFLfQE4gn0cXqpEsWkLsNprKrqq8d0lYmxTWIi38uAFA2ziC8yx5o/30ncBczrn zLmgXFV/zcNyl9FhreLy3L7DJsJ7E+hRoIj4bQznRSdPefG7jMnHzzoQ5Xn/0kfLegPL hO3hfWhbjtLOYTpkZpFeXMikvagv4kvfPHiq2e0C7uDCC8qd9AJOIhPkTNhO1SJYJtAI y+r3wMfkE/TExvpTLnn1QuvGByptzbVUv+EQEpzJ576IwooDMl/13BjSEYQKAqpmzwYD Q91cRCAHRlV6YEuT/2Wy8hE1qV3spvT7z/V+UxhL8TXfaJmNPhgBfHDiJDovUX8a5e1e eiXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686104116; x=1688696116; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oQUlCOcqt0tuXvcUCaoZv+EjOka/kZ7fKStDDBCleig=; b=IjxUcx0UABGRLbD9WB9eYnoAdt9K6om9isYkZBA7S1r1BZz4T3sGygNEAkZFvsoNAo VRk+UI3JhCrP6CjJYHKgIJdP6L8WYrjnts2ScpsDK/OFmlmommDG5H4pILdZxyVGgX/o eT0l7sRDLWtvmZ1mxCSopFkztuj9iqktUr/7FZgJ/rmzH51JGm1xdChXWRZ1apKFyndv cuuQyoSiNbBk1SnSCD00Dua2fR60PS2LTx+RQoJ9SUDV0lZyYrznpjB5UrnbJOd2sB5Y nSf1bRZMxiSabNsKLHbA2YF6u0dYEFPLi4BMxxEWd1x8fkLH7ipbvQFUd+ok0idJPU5B euFQ== X-Gm-Message-State: AC+VfDy2zXh6IBUFQavB6P7N4dG8H1yeV9CsKojLYcudfa5mA6IC4Vz0 uLX4hA132SI4lVXu43D0VT6DQg== X-Received: by 2002:a17:902:db0f:b0:1b0:4bc7:31ee with SMTP id m15-20020a170902db0f00b001b04bc731eemr3975802plx.32.1686104116012; Tue, 06 Jun 2023 19:15:16 -0700 (PDT) Received: from dread.disaster.area (pa49-179-79-151.pa.nsw.optusnet.com.au. [49.179.79.151]) by smtp.gmail.com with ESMTPSA id p21-20020a170902ead500b00199203a4fa3sm9173051pld.203.2023.06.06.19.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 19:15:15 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1q6ihc-008ieJ-1f; Wed, 07 Jun 2023 12:15:12 +1000 Date: Wed, 7 Jun 2023 12:15:12 +1000 From: Dave Chinner To: Sarthak Kukreti Cc: Mike Snitzer , Jens Axboe , linux-block@vger.kernel.org, Joe Thornber , "Michael S. Tsirkin" , Jason Wang , "Darrick J. Wong" , Brian Foster , Bart Van Assche , linux-kernel@vger.kernel.org, Christoph Hellwig , dm-devel@redhat.com, Andreas Dilger , Stefan Hajnoczi , linux-fsdevel@vger.kernel.org, Theodore Ts'o , linux-ext4@vger.kernel.org, Joe Thornber , Alasdair Kergon Subject: Re: [PATCH v7 0/5] Introduce provisioning primitives Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-kernel@vger.kernel.org On Mon, Jun 05, 2023 at 02:14:44PM -0700, Sarthak Kukreti wrote: > On Sat, Jun 3, 2023 at 8:57 AM Mike Snitzer wrote: > > On Fri, Jun 02 2023 at 8:52P -0400, > > Dave Chinner wrote: > > > On Fri, Jun 02, 2023 at 11:44:27AM -0700, Sarthak Kukreti wrote: > > > > > The only way to distinquish the caller (between on-behalf of user data > > > > > vs XFS metadata) would be REQ_META? > > > > > > > > > > So should dm-thinp have a REQ_META-based distinction? Or just treat > > > > > all REQ_OP_PROVISION the same? > > > > > > > > > I'm in favor of a REQ_META-based distinction. > > > > > > Why? What *requirement* is driving the need for this distinction? > > > > Think I answered that above, XFS delalloc accounting parity on thinp. > > > I actually had a few different use-cases in mind (apart from the user > data provisioning 'fear' that you pointed out): in essence, there are > cases where userspace would benefit from having more control over how > much space a snapshot takes: > > 1) In the original RFC patchset [1], I alluded to this being a > mechanism for pre-allocating space for preserving space for thin > logical volumes. The use-case I'd like to explore is delta updatable > read-only filesystems similar to systemd system extensions [2]: In > essence: > a) Preserve space for a 'base' thin logical volume that will contain a > read-only filesystem on over-the-air installation: for filesystems > like squashfs and erofs, pretty much the entire image is a compressed > file that I'd like to reserve space for before installation. > b) Before update, create a thin snapshot and preserve enough space to > ensure that a delta update will succeed (eg. block level diff of the > base image). Then, the update is guaranteed to have disk space to > succeed (similar to the A-B update guarantees on ChromeOS). On > success, we merge the snapshot and reserve an update snapshot for the > next possible update. On failure, we drop the snapshot. Sounds very similar to the functionality blksnap is supposed to provide.... https://lore.kernel.org/linux-fsdevel/20230404140835.25166-1-sergei.shtepa@veeam.com/ > 2) The other idea I wanted to explore was rollback protection for > stateful filesystem features: in essence, if an update from kernel 4.x > to 5.y failed very quickly (due to unrelated reasons) and we enabled > some stateful filesystem features that are only supported on 5.y, we'd > be able to rollback to 4.x if we used short-lived snapshots (in the > ChromiumOS world, the lifetime of these snapshots would be < 10s per > boot). Not sure that blksnap has a "roll origin back to read-only snapshot" feature yet, but that's what you'd need for this. i.e. on success, drop the snapshot. On failure, "roll origin back to snapshot and reboot". Cheers, Dave. -- Dave Chinner david@fromorbit.com