Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2160028rdb; Mon, 9 Oct 2023 15:03:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVhLn2MqdoJyJJJaTh5JvpgMN0GCCTaoPcbhxsDYmamVH4/b5nByaC6mpvqK/tlimsiRpa X-Received: by 2002:a05:6a20:1612:b0:149:9b2f:a79d with SMTP id l18-20020a056a20161200b001499b2fa79dmr17387201pzj.6.1696888997063; Mon, 09 Oct 2023 15:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696888997; cv=none; d=google.com; s=arc-20160816; b=cRG/xH9KlPcPlcMXxcpdXvkdO0UgJ7wPfS7QigaJNJnsfEE5pgMwYHfCDd4fK0/9xL jhlm4mLyioRpp80+LnNewSNZ7XcU+biWbcNchak7OADxj6s6Mwlfw0Mtq8RgugnwNE3x jmiP8H/7a5dbIuC5WlFYS8wMepjCMAnWdXzMRk5qOg1UyLWz26hfc3Px4BB4gXQ01/7Z aqUpnUuR2soJFVwm/e3vAa10C+xx3fzfxVEsAEwO+2qI9x+L8L6dX1GPDA4v0iTDFmEP tnisiCSBmUf+2RF4HYkENvcElhkWquvSTjsYp0el1laHoQwD255ls+gJt8UFc8uyddvu yhOA== 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=FbRz1UHmb7XUmCqoAt2aiODWlREyMNkavGrCa5bn36A=; fh=RaXYVC6Qx3XZFuYDqRtQFf51PuyjbZU/bkv99Q4moNI=; b=S5raWK4G6S2K2H2u/FSzf1zOUmrfwt6NMXgCw4eWcHB2UyUP7sYNMzi2Bi10GyavAc 6jq11Qkui+hWaZIb+44NvSN9ynVeOzPHNZu+DRkskXnHvSPlxdYFnv0TFRw+P0c5okl7 +6iKsAC72sYckhYPV0UMOLS+Yt3BHNRtcOJL5yD6iNSD3maCU/EzOLVMlFK1+qo7XAlw FcM8+cq0ZopMJZK6Ulji3ETajdwD6PGgZKUJ+Ib4mbNcMc95SvArqlbbt5MUDb69Df83 7xAZRazOJ9+WOOwfBPYFaiuU9+Ga+JN8dSS7121p8BmXqxB7VMlMKd38uCcsziytJTDD J1Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=MZMZEj7z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id j8-20020a170903024800b001c0eefc0dfesi11205966plh.130.2023.10.09.15.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 15:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=MZMZEj7z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1065680B632A; Mon, 9 Oct 2023 15:03:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378734AbjJIWC7 (ORCPT + 99 others); Mon, 9 Oct 2023 18:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378742AbjJIWC6 (ORCPT ); Mon, 9 Oct 2023 18:02:58 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95959A7 for ; Mon, 9 Oct 2023 15:02:56 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-690bd59322dso3668453b3a.3 for ; Mon, 09 Oct 2023 15:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1696888976; x=1697493776; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FbRz1UHmb7XUmCqoAt2aiODWlREyMNkavGrCa5bn36A=; b=MZMZEj7zdsBoJQlEqyQ7v1u73ywMatHnYxtzMTLOIChOW5Fj5hbsue8BCDnwZxtqcQ Kg+DivpcL9YfAptxhH8yBJ1QRQvqUx0k4LOax7iqK/dELisMRFbtBkUqtrtY47lZ+ofy DGm8KhkoYBL5jytjoP/T80KHYkA5DyDw0wbhfOBiZ74IUgR7mwfVq35XMRjYwhfdJeTb O0MlsmOH5kEpAoBcmicazdkPWXfIlXgrE+3XEi02pKf0KPAfCQ7//DufBBPsRP1ceV4x h9xi5Hslq6LovCeR5XflppE5Ctm7zCmejNMN3aBsgvGKiAd9KCHi9Q0hwBn+IFLL63fB Rr7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696888976; x=1697493776; 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 :message-id:reply-to; bh=FbRz1UHmb7XUmCqoAt2aiODWlREyMNkavGrCa5bn36A=; b=f32oaWqNJ2hetBkJSFhmjFC2Bnwm1od3jnPcyWih28bCO7OxpYaGSarpZZKvrAfGM1 yD6Tc6x9hfw6rhXRdRamLzJq5N5QZOTbazFQaMOaJMMZ5K4lc1B8RWkGmWNNHilppR6B l8YYMvrxXFFT7fnBIyPpqzylM7/N4v+j+OWdF6lFBTtDT98f7dMaXgaiuV2QMf3Nig/i mEARtDx1urXPqa2AEnhndqQauxrfGMEFUqT90QcBHwKAfju3XM9Kb/nkJfmFV9iMA8/U /B22ksg8q/XhO0KLJRSZW1Uw9urq63bEcTTy6tiIppA71PJ+Qm1v1G+2BA5tlwx3N7dg tz/g== X-Gm-Message-State: AOJu0Yxnt7T43UEpCcut6vzZyCRiYUhJwUfkCNWaAAnId+WTPbdaeRyg zEoQ5/v5V2fZ2s6dhzPIFV8HYQ== X-Received: by 2002:a05:6a20:734b:b0:166:6582:a7d5 with SMTP id v11-20020a056a20734b00b001666582a7d5mr16692295pzc.3.1696888976074; Mon, 09 Oct 2023 15:02:56 -0700 (PDT) Received: from dread.disaster.area (pa49-180-20-59.pa.nsw.optusnet.com.au. [49.180.20.59]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b00682868714fdsm7023146pfn.95.2023.10.09.15.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 15:02:55 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qpyKz-00BhaC-06; Tue, 10 Oct 2023 09:02:53 +1100 Date: Tue, 10 Oct 2023 09:02:53 +1100 From: Dave Chinner To: Jeremy Bongio Cc: John Garry , axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, 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, linux-api@vger.kernel.org, Prasad Singamsetty Subject: Re: [PATCH 04/21] fs: Add RWF_ATOMIC and IOCB_ATOMIC flags for atomic write support Message-ID: References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-5-john.g.garry@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 15:03:14 -0700 (PDT) X-Spam-Level: ** On Fri, Oct 06, 2023 at 11:15:11AM -0700, Jeremy Bongio wrote: > What is the advantage of using write flags instead of using an atomic > open flag (O_ATOMIC)? With an open flag, write, writev, pwritev would > all be supported for atomic writes. And this would potentially require > less application changes to take advantage of atomic writes. Atomic writes are not a property of the file or even the inode itself, they are an attribute of the specific IO being issued by the application. Most applications that want atomic writes are using it as a performance optimisation. They are likely already using DIO with either AIO, pwritev2 or io_uring and so are already using the interfaces that support per-IO attributes. Not every IO to every file needs to be atomic, so a per-IO attribute makes a lot of sense for these applications. Add to that that implementing atomic IO semantics in the generic IO paths (e.g. for buffered writes) is much more difficult. It's not an unsolvable problem (especially now with high-order folio support in the page cache), it's just way outside the scope of this patchset. -Dave. -- Dave Chinner david@fromorbit.com