Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2758454rdb; Wed, 4 Oct 2023 10:28:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwh3X7SxIUh/4NhLvxVnLJbqv6/XaMANY4iRNSCJf07I39ZB8yumLltW2faK3PMLceVlib X-Received: by 2002:a17:90b:3891:b0:274:862f:3439 with SMTP id mu17-20020a17090b389100b00274862f3439mr2790576pjb.13.1696440521501; Wed, 04 Oct 2023 10:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696440521; cv=none; d=google.com; s=arc-20160816; b=WIgXPzTtnhDkez7PX0Q5mbuo8zpeolZsn3JRAUEktvsPrzksxtKgAzOyoWXe7wbdQO UAqSDw0ns+xc3AqbSuEyMp8MHWg9UoxqCnJVx/KIUl2sx2EA85+LDhG4Rr+6JiNyEHbw IB+5JbGrXfeTNcJNzsuXN0GmUegInLAcNhD5B6HyRsiShxS0bZpdJTLQW8BgllKhW8qU NI2u6CaOfD8fFlheOwVKlXE62eWNKoIbW+/MCiM5EDzfCufVtxjr7i0EKtyrSVSQ+pQX oLC2dMd3YKZ52JYyXB9vCkZ77NsaHUAyp237/eC6TgGJQ1fkjNDtqC3t/BRvW/TyWkW1 HPBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=7LK6nH29B+DiFq/Dp1LOVmQEn5e8xZV4jVqq1U2i/KY=; fh=19tgvLdhHM6I2wep8ws8M7ck/3tcq87o6WdkTfz6SCc=; b=0+dEzKpxcmpnEOUj84GNr0TvoVWd/1gG15Ek4HTAqvACfwPYrxbb6U+wHONxx0awMv rsVCoSpposkvM8GtHIAE6hz+n0Mjq+y27t15L8jM5p80YsoFYXIaZRZnRb1WdkIauu36 ULwVvhfJilKTDGs92hqvdtopCGbHjbpAc3lqFReZpPOx8d4D3LtbLPHo6IKejIchatgI wyZnn2hRW1URpnpgCdWtt+hcweNsc4fFcc9hysuImWkpSIdMD9F23jteMt8QD9lRg5B6 LrHSl5npgFnzCMixwxtE2Z3Kvthpu8jrhgxpV9d7+67W3JlH0XWTQG1UsTVuATizHPsf tSIQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id kb1-20020a17090ae7c100b0026810b074afsi2150172pjb.3.2023.10.04.10.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:28:41 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 0D8C981C4A8F; Wed, 4 Oct 2023 10:28:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243695AbjJDR2T (ORCPT + 99 others); Wed, 4 Oct 2023 13:28:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243438AbjJDR2S (ORCPT ); Wed, 4 Oct 2023 13:28:18 -0400 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24EB9A6; Wed, 4 Oct 2023 10:28:15 -0700 (PDT) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1c760b34d25so18374715ad.3; Wed, 04 Oct 2023 10:28:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440494; x=1697045294; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7LK6nH29B+DiFq/Dp1LOVmQEn5e8xZV4jVqq1U2i/KY=; b=d3cNyMigZLNhhG+JB71gJp6VEGNrHV/19qOfI1goG2vWRlvGeCE3GukhOarH9nox3S ceCHsyIZ6xjPtSZriMKaCWjKeRZ96tZleCp3WnXgAvpjAMC6ATDhRvHvcy4CPrrWJWia OTf6wBDLG9noK1PLBy61NT+6LDB9EQEjVxIwEZ09g/XLjGWzQPNdoOXdn1GclOVBaKbt DYMPSgNylqovUDVRVACHXyFozj7FBQmF7WMNNhliIeYYBNqq0poMlI5ZKltvk9Z4XJ2L uFiyDaS0TdHqbQFfcczTWbz1qNOwjAHvQ8nORMT0UX1hAfFsIeXtOO/dY9BRzcySQKfa OOcA== X-Gm-Message-State: AOJu0YzPs04CRzb60vXrj3XAA1vd0kCh0Ih1cNwhy0z219oPcBwlPM8G BCqssUugmNDj8u4H1oh5VEQ= X-Received: by 2002:a17:903:26c3:b0:1c5:de65:f8a8 with SMTP id jg3-20020a17090326c300b001c5de65f8a8mr2878682plb.1.1696440494355; Wed, 04 Oct 2023 10:28:14 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:969d:167a:787c:a6c7? ([2620:15c:211:201:969d:167a:787c:a6c7]) by smtp.gmail.com with ESMTPSA id u11-20020a17090282cb00b001bf11cf2e21sm3947140plz.210.2023.10.04.10.28.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 10:28:13 -0700 (PDT) Message-ID: <776ff7e4-879f-4967-ba46-fd170804a9e0@acm.org> Date: Wed, 4 Oct 2023 10:28:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/21] block: Add atomic write operations to request_queue limits Content-Language: en-US To: "Martin K. Petersen" Cc: John Garry , axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.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, Himanshu Madhani References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-2-john.g.garry@oracle.com> <7f031c7a-1830-4331-86f9-4d5fbca94b8a@acm.org> From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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]); Wed, 04 Oct 2023 10:28:39 -0700 (PDT) On 10/3/23 20:00, Martin K. Petersen wrote: > > Bart, > >> also that there are no guarantees that the data written by an >> atomic write will survive a power failure. See also the difference >> between the NVMe parameters AWUN and AWUPF. > > We only care about *PF. The *N variants were cut from the same cloth > as TRIM and UNMAP. In my opinion there is a contradiction between the above reply and patch 19/21 of this series. Data written with the SCSI WRITE ATOMIC command is not guaranteed to survive a power failure. The following quote from SBC-5 makes this clear: "4.29.2 Atomic write operations that do not complete If the device server is not able to successfully complete an atomic write operation (e.g., the command is terminated or aborted), then the device server shall ensure that none of the LBAs specified by the atomic write operation have been altered by any logical block data from the atomic write operation (i.e., the specified LBAs return logical block data as if the atomic write operation had not occurred). If a power loss causes loss of logical block data from an atomic write operation in a volatile write cache that has not yet been stored on the medium, then the device server shall ensure that none of the LBAs specified by the atomic write operation have been altered by any logical block data from the atomic write operation (i.e., the specified LBAs return logical block data as if the atomic write operation had not occurred and writes from the cache to the medium preserve the specified atomicity)." In other words, if a power failure occurs, SCSI devices are allowed to discard the data written with a WRITE ATOMIC command if no SYNCHRONIZE CACHE command has been submitted after that WRITE ATOMIC command or if the SYNCHRONIZE CACHE command did not complete before the power failure. Thanks, Bart.