Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1286729ybz; Wed, 22 Apr 2020 17:41:22 -0700 (PDT) X-Google-Smtp-Source: APiQypLjN38gGfMa9b3aKgdszKVvMLLsk4/nVwCK4RbY+p0sISAm0CNOawIud6pyffG2chgGvFar X-Received: by 2002:a50:c25a:: with SMTP id t26mr915195edf.20.1587602482700; Wed, 22 Apr 2020 17:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587602482; cv=none; d=google.com; s=arc-20160816; b=CWIHa67SK6fHjpRngvyK5pU9YrWFPSNYNPLzV8x0SdNd9tfLiTd/KwzqsbYG+4sNQ2 pEhjtRRE1OQnUZEBUQmf8V+Qc/18SNaYC10SPro0dkOmCciB97A9fR0k3kIwppOL4ysd y4UOdQW8Dwzq7aKtMo8UxCp+s16BHfGwDYJa2FghnvwLRRobxcM2mfelcULoFCv5TrOi fjuiZRyOdKFNQ3F+cQ91wDZu73cEyjoh8qUYaF5L1TeIU7z80glYctta8aWLBJDj5q7T kb7BDEvmsw7Jik4O+IaLbJNleDbRsemVnDYwnhUipVuEFLR9jOX+4PYyCut+kMNCFSYM B6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=oOmHJafDHAiLr+hO/wYNXIjjzE6yoBtPTz0X9wOHrhM=; b=B5urTzjEH2tTUIjgWTHSbYA+DphGz/Ly1rwT1KBJQY8VWnsCilwDYacjY0Y1JZJf7M 76aHjjgAsXV+fXoitBq7iRMcsEwnw9DfnuH7aD/uYSsn7oANBhpfrpLf1y3dwcewpGFI x5I2Q7PvCCUOR4PcPb9UIKvU0Bfg8+FnwWBy8Dy3ydNMdfB35xg6ohsEZiQZAmfv8QR+ Vrk1WRFOTdiDvNQSGNaHldRxgt69EbMV7p1XsYf+IfEoJ1w/Yg/Zhny3xCBZ9P0PTZ47 8SK9yny3NFhJqTNW7uHODnX01OjyANrUXR2dNwAln8ztBezh22nNcROthvsJsSjwLAsO RHZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Jfxj0m+0; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu44si410301ejb.394.2020.04.22.17.40.58; Wed, 22 Apr 2020 17:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=Jfxj0m+0; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbgDWAkw (ORCPT + 99 others); Wed, 22 Apr 2020 20:40:52 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:43620 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbgDWAkw (ORCPT ); Wed, 22 Apr 2020 20:40:52 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03N0eHah139827; Thu, 23 Apr 2020 00:40:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2020-01-29; bh=oOmHJafDHAiLr+hO/wYNXIjjzE6yoBtPTz0X9wOHrhM=; b=Jfxj0m+0g/BDEijGZkMF/w4raZLYKt2CEePPz2s+LXdGZnZ1iOvlgBWsKsdh4vAaadiY 0SAk/4/G5e4mqtVllIPJ9RcTklVPtjgNPAp6hgilpdx9vKV2GAMfHTdF4gUU44es1QgO dFIDpVqjN8j+bjN6Baal9ZARWU5gK627WeEHD4ILA7ghtXPO21As3aZiBpyrpsP3rIE0 bCzkyRZA0unLVnAY/SHkCS9GHlKBFeYOeVfax9ohvzRvO4pSzVrUUAUvo6r+UM+4p0Zf NZXJ+B+QNpf0KVypkTMf6iwIai7I0fyIHWii/YHxbzdhrTP72nnIZsUKATEuFyjzLEIU Pw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 30jhyc4nt3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Apr 2020 00:40:17 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03N0ckul015871; Thu, 23 Apr 2020 00:40:16 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 30gbbjcaa5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Apr 2020 00:40:16 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03N0e62P005519; Thu, 23 Apr 2020 00:40:07 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Apr 2020 17:40:06 -0700 To: Dave Chinner Cc: "Martin K. Petersen" , Chaitanya Kulkarni , hch@lst.de, darrick.wong@oracle.com, axboe@kernel.dk, tytso@mit.edu, adilger.kernel@dilger.ca, ming.lei@redhat.com, jthumshirn@suse.de, minwoo.im.dev@gmail.com, damien.lemoal@wdc.com, andrea.parri@amarulasolutions.com, hare@suse.com, tj@kernel.org, hannes@cmpxchg.org, khlebnikov@yandex-team.ru, ajay.joshi@wdc.com, bvanassche@acm.org, arnd@arndb.de, houtao1@huawei.com, asml.silence@gmail.com, linux-block@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 0/4] block: Add support for REQ_OP_ASSIGN_RANGE From: "Martin K. Petersen" Organization: Oracle Corporation References: <20200329174714.32416-1-chaitanya.kulkarni@wdc.com> <20200402224124.GK10737@dread.disaster.area> <20200403025757.GL10737@dread.disaster.area> <20200407022705.GA24067@dread.disaster.area> <20200419223646.GB9765@dread.disaster.area> Date: Wed, 22 Apr 2020 20:40:01 -0400 In-Reply-To: <20200419223646.GB9765@dread.disaster.area> (Dave Chinner's message of "Mon, 20 Apr 2020 08:36:46 +1000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9599 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230001 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9599 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 mlxscore=0 clxscore=1015 suspectscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230001 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Dave, >> Not before overwriting, no. Once you have allocated an LBA it remains >> allocated until you discard it. > Ok, so you are confirming what I thought: it's almost completely > useless to us. > > i.e. this requires issuing IO to "reserve" space whilst preserving > data before every metadata object goes from clean to dirty in memory. You can only reserve the space prior to writing a block for the first time. Once an LBA has been written ("Mapped" in the SCSI state machine), it remains allocated until it is explicitly deallocated (via a discard/Unmap operation). This part of the SCSI spec was written eons ago under the assumption that when a physical resource backing a given LBA had been established, you could write the block over and over without having to allocate new space. This used to be true, but obviously the introduction of de-duplication blew a major hole in that. I have been perusing the spec over and over trying to understand how block provisioning state transitions are defined when dedup is in the picture. However, much is left unexplained. As a result, I reached out to various folks. Including the people who worked on this feature in the standards way back. And the response that I get from them is that allocation operation got irreparably broken when support for de-duplication was added to the spec. Nobody attempted to fix the state transitions since most vendors only cared about deallocation. Consequently specifying the exact behavior of the allocation operation in the context of dedup fell by the wayside. The recommendation I got was that we should not rely on this feature despite it being advertised as supported by the storage. I looked at whether it was feasible to support it on non-dedup devices only, but it does not look like it's worthwhile to pursue. And as a result there is no need for block layer allocation operation to have parity with SCSI. Although we may want to keep NVMe in mind when defining the semantics. -- Martin K. Petersen Oracle Linux Engineering