Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2714119rdb; Mon, 4 Dec 2023 05:45:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2hXawfLq2BYzzZ75ql83WltWbzWFdfIfypQ5HW41oGtYAaofyieVti1fz5fT+6hGVdJX3 X-Received: by 2002:a17:902:8c8a:b0:1cf:a70b:39cc with SMTP id t10-20020a1709028c8a00b001cfa70b39ccmr1554860plo.40.1701697556101; Mon, 04 Dec 2023 05:45:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701697556; cv=none; d=google.com; s=arc-20160816; b=dA+tGKMIs0FLiQs6wPhF1g6764jjymLzKk1iOLy900L1VZHUnjnSR9nXt4XR7Tq14H yqv5CYhUscEIakQslJEApCZroMUVizJcJfhO/BTQbSlxvTUsAgQruMXhyKZaxCtSjPRo bMQWyvDAcAbaXYnoUZ15jN5/NPUZn/NdSMX6hqlmm8s3fA+05XBw8UBT76rRXdZ7+ntq gswzedmlZnLOebnHWGMlYJ5dE05nP+8ul1JGQZy2TCg1iP8ZO3YDlvDKHn/mMhd6Gvds p2G+jAWbYWWiJVr3p4hArGnaL+tjRsgLeyNB7EHHI1epo1tl6asDdYaU1RwBE2mfkHmu BJeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=iL8qAqst6kaCYnfb4UoKbSMQsve+KXdSW8fBor7n+CY=; fh=3ryIpOVQ48K5xHKHuuMQwdDhzAsDsw1xPz0+MrkgulU=; b=CGNXIL/gLjUl72LEDAObnNAQmkLdPMqX27s53y2SxMGTnfKwxawDeD8IsnxtHzAjEB ZqP8sShi6B+/ezPOnUR/Knw963OKOOZeBUy5xH/Ti2ba/4HSS/MkQXsEHp6O143bwMwi CYSFYmN6Vn3kA3zHrLz4xRRgO+5781cYAVW4Ca0aEcmJLKzQVSWpXqBtTbJ2p0oJAXoy fRBghw6LBDY7kjhRVgvONoO4MS00STKIstvixTUOIcrQ+8zXVeEocp2U1VUn34eTxsDx x2p6rmbQNgIkAEFzHHUwlmIFjLrExNdS+pHM3ihIqQKCeUoHDrTylw/FNbElw7u8rc0T EexA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id j5-20020a170902690500b001cf7c82c00asi7869970plk.499.2023.12.04.05.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 05:45:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id BFD6B8092485; Mon, 4 Dec 2023 05:45:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234055AbjLDNpL (ORCPT + 99 others); Mon, 4 Dec 2023 08:45:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234041AbjLDNpK (ORCPT ); Mon, 4 Dec 2023 08:45:10 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B503BDF; Mon, 4 Dec 2023 05:45:15 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 4613D68B05; Mon, 4 Dec 2023 14:45:10 +0100 (CET) Date: Mon, 4 Dec 2023 14:45:09 +0100 From: Christoph Hellwig To: John Garry Cc: Christoph Hellwig , axboe@kernel.dk, kbusch@kernel.org, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org Subject: Re: [PATCH 17/21] fs: xfs: iomap atomic write support Message-ID: <20231204134509.GA25834@lst.de> References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-18-john.g.garry@oracle.com> <20231109152615.GB1521@lst.de> <20231128135619.GA12202@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 04 Dec 2023 05:45:29 -0800 (PST) On Tue, Nov 28, 2023 at 05:42:10PM +0000, John Garry wrote: > ok, fine, it would not be required for XFS with CoW. Some concerns still: > a. device atomic write boundary, if any > b. other FSes which do not have CoW support. ext4 is already being used for > "atomic writes" in the field - see dubious amazon torn-write prevention. What is the 'dubious amazon torn-write prevention'? > About b., we could add the pow-of-2 and file offset alignment requirement > for other FSes, but then need to add some method to advertise that > restriction. We really need a better way to communicate I/O limitations anyway. Something like XFS_IOC_DIOINFO on steroids. > Sure, but to me it is a concern that we have 2x paths to make robust a. > offload via hw, which may involve CoW b. no HW support, i.e. CoW always Relying just on the hardware seems very limited, especially as there is plenty of hardware that won't guarantee anything larger than 4k, and plenty of NVMe hardware without has some other small limit like 32k because it doesn't support multiple atomicy mode. > And for no HW support, if we don't follow the O_ATOMIC model of committing > nothing until a SYNC is issued, would we allocate, write, and later free a > new extent for each write, right? Yes. Then again if you do data journalling you do that anyway, and as one little project I'm doing right now shows that data journling is often the fastest thing we can do for very small writes.