From patchwork Sun Oct 27 14:05:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 11214117 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF911112B for ; Sun, 27 Oct 2019 14:06:40 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90A0E20679 for ; Sun, 27 Oct 2019 14:06:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ebBTR8C+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90A0E20679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572185199; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rKjY1el+GrcxxTsJn1fox4PqfLVN//2PhOl/E0ab5yI=; b=ebBTR8C+ZdjziRWKwQNdJIy/OifTcHGST+4W1gEoNRgtAprkiHfhufPyDgD+kIpdaqCEDV LhaJgv6G8Z52pp9MHchCITBV/gXIe8yqaQMbUX0pWlIfc+xH5I/PTVxlgLuSbVdkW8vgO8 cQN5Ui8kuDlt14lNQ1Fa2oXKlDpUpRo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-DaJS1xjqObKBArcne-9Nzg-1; Sun, 27 Oct 2019 10:06:37 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08A39801E56; Sun, 27 Oct 2019 14:06:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B95E1001B2D; Sun, 27 Oct 2019 14:06:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 020F94E589; Sun, 27 Oct 2019 14:06:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9RE6QrV007588 for ; Sun, 27 Oct 2019 10:06:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78C4F5C207; Sun, 27 Oct 2019 14:06:26 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 333125C1D4; Sun, 27 Oct 2019 14:06:21 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B61A308FBFC; Sun, 27 Oct 2019 14:06:00 +0000 (UTC) IronPort-SDR: 7qF4FkKIXpBjyjdKzi1MDXpmVCRRou0GkFJln9Bd2RivwEh21CtBbBao56ZnGAIsctMy7A4m33 qNua8k9jxxeFb0hLC9Yc9yCddssK3P0iog3N516nFFBHP9mjr7soVbcA9hyCgTBqkOY0rCNwYY QyAfPjCGVKLvwDgNUeIyBKc0bRscfydxZLGyjuo6/E8uxczXtddsTfroZLtzX2G5lpFT5ylEcu 4yyZNu5+XQ3PRZfx9nTgx2iTNW8vXhTHTlKbAsroEFCHSC5zQgyQopD0oFmyWzknDFTiybEzyK Jf4= X-IronPort-AV: E=Sophos;i="5.68,236,1569254400"; d="scan'208";a="122197749" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 27 Oct 2019 22:05:52 +0800 IronPort-SDR: +wRE+NAorOU1GkV0AxPkqvaZbikX/KDx0xUp5ntbWnA19qWMMAIWk+G0bGiiCBfJaaa3nodobY Ze2xjZ+/rqul7GHHHOZXQdnkVRbj4E5rxLIsGUIO17sDWHw5r1qIPIZByQqjdPMTmB5ajHSh/6 wnV0+lITPMNZuZa8Tpn6MVZTGIld4t/dlvOXre9+q5blRNl/lSqfn1ZcOjFY0bwI7FvjNpV4SM 7jkT9Xb6P8oBXDNXDY92vSXHa3H5zR06eNMYX7JQyL2IHTswLwqL0vBOZhStQs8mVS1hCh6137 f7LuBanDlQtspXqzlKqVSOdg Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2019 07:01:20 -0700 IronPort-SDR: +RZzKRYzw04dKAZWap4nRW126plQWlg5ewBORgqIOHsG+JaBctwQxupeWsJuzTXv5gowAeF0eh X8WPaAQu3Vur/D8ASXdNogN+xAudZYi6dYSbj4KKAof4dUKREP1ajzZN5vsocLv0BFf/9AgGiH 7XeurbURQa/MmJ0MRgnKi359C/OqtsdN8FbD7S/uS+pPaE6RWYTKX1mLxV+7ss73+B6Z8A+KQH h1ajkIbfurdX22hvijRmEq1rpG/6yTkjZhbjuoNPK2oj8Q/wmf9g95hhlY8ogoQLwchkUqFNA8 was= WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Oct 2019 07:05:50 -0700 From: Damien Le Moal To: linux-block@vger.kernel.org, Jens Axboe , linux-scsi@vger.kernel.org, "Martin K . Petersen" , dm-devel@redhat.com, Mike Snitzer Date: Sun, 27 Oct 2019 23:05:41 +0900 Message-Id: <20191027140549.26272-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sun, 27 Oct 2019 14:06:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sun, 27 Oct 2019 14:06:13 +0000 (UTC) for IP:'216.71.153.144' DOMAIN:'esa5.hgst.iphmx.com' HELO:'esa5.hgst.iphmx.com' FROM:'damien.lemoal@wdc.com' RCPT:'' X-RedHat-Spam-Score: -2.399 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED, SPF_HELO_NONE) 216.71.153.144 esa5.hgst.iphmx.com 216.71.153.144 esa5.hgst.iphmx.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: dm-devel@redhat.com Cc: Dmitry Fomichev , Keith Busch , Hans Holmberg , Ajay Joshi , Matias Bjorling Subject: [dm-devel] [PATCH 0/8] Zone management commands support X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: DaJS1xjqObKBArcne-9Nzg-1 X-Mimecast-Spam-Score: 0 This series implements a few improvements and cleanups to zone block device zone reset operations with the first three patches. The remaining of the series patches introduce zone open, close and finish support, allowing users of zoned block devices to explicitly control the condition (state) of zones. While these operations are not stricktly necessary for the correct operation of zoned block devices, the open and close operations can improve performance for some device implementations of the ZBC and ZAC standards under write workloads. The finish zone operation, which transition a zone to the full state, can also be useful to protect a zone data by preventing further zone writes. These operations are implemented by introducing the new REQ_OP_ZONE_OPEN, REQ_OP_ZONE_CLOSE and REQ_OP_ZONE_FINISH request codes and the function blkdev_zone_mgmt() to issue these requests. This new function also replaces the former blkdev_reset_zones() function to reset zones write pointer. The new ioctls BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE are also defined to allow applications to issue these new requests without resorting to a device passthrough interface (e.g. SG_IO). Support for these operations is added to the SCSI sd driver, to the dm infrastructure (dm-linear and dm-flakey targets) and to the null_blk driver. Ajay Joshi (5): block: add zone open, close and finish operations block: add zone open, close and finish ioctl support scsi: sd_zbc: add zone open, close, and finish support dm: add zone open, close and finish support null_blk: add zone open, close, and finish support Damien Le Moal (3): block: Remove REQ_OP_ZONE_RESET plugging block: Simplify REQ_OP_ZONE_RESET_ALL handling scsi: sd_zbc: Fix sd_zbc_complete() block/blk-core.c | 12 +++-- block/blk-zoned.c | 99 ++++++++++++++++++---------------- block/ioctl.c | 5 +- drivers/block/null_blk_zoned.c | 33 ++++++++++-- drivers/md/dm-flakey.c | 7 ++- drivers/md/dm-linear.c | 2 +- drivers/md/dm-zoned-metadata.c | 6 +-- drivers/md/dm.c | 5 +- drivers/scsi/sd.c | 15 +++++- drivers/scsi/sd.h | 8 +-- drivers/scsi/sd_zbc.c | 43 +++++++-------- fs/f2fs/segment.c | 3 +- include/linux/blk_types.h | 25 +++++++++ include/linux/blkdev.h | 15 +++--- include/uapi/linux/blkzoned.h | 17 ++++-- 15 files changed, 192 insertions(+), 103 deletions(-)