From patchwork Fri Oct 12 10:08:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 10638301 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 972FC17E3 for ; Fri, 12 Oct 2018 10:08:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 896122B846 for ; Fri, 12 Oct 2018 10:08:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DDCF2B854; Fri, 12 Oct 2018 10:08:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A91962B849 for ; Fri, 12 Oct 2018 10:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbeJLRkc (ORCPT ); Fri, 12 Oct 2018 13:40:32 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:63720 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbeJLRkc (ORCPT ); Fri, 12 Oct 2018 13:40:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1539338933; x=1570874933; h=from:to:cc:subject:date:message-id; bh=QCAxeAYkgMv65bev73gKCeegy9aO7G1Vh8SWUlgLxHc=; b=hpbuRHSHqdwJD9bmFXyzpXtHVdFHryG+nMVuRS3wd2osTsMyvBV3f906 G0tN8zvAyDNb6+v1oEmHZ+sBPl2PSTQYJ1p2ukqcdEOp7aemOBiqwtzJO kY3V/7pWfvw1kF0TnvT9h6iPfSEACRzqVJWKpr37ObSXSHA1XUgjTXtIv mjRWCv46Z5Gg50o0NPABRuUUBlTK0DcdKcONK9/Six0mP6FsXnrxzJ/dn VBixT0FB7v32tUn8CVvgCno55A4HT7Ck6ttiPfLVlOPEt2B+bN31WNVWy 5Nt5ZhPvrma6C5dNDj5wFJXLjLR2RWF2NEg0SXu+DBM7ZTOxaEQYXaYgr g==; X-IronPort-AV: E=Sophos;i="5.54,371,1534780800"; d="scan'208";a="96419659" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 12 Oct 2018 18:08:52 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 12 Oct 2018 02:54:12 -0700 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 12 Oct 2018 03:08:52 -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 Cc: Christoph Hellwig , Matias Bjorling Subject: [PATCH v4 00/11] Zoned block device support improvements Date: Fri, 12 Oct 2018 19:08:39 +0900 Message-Id: <20181012100850.23316-1-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.17.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series improves zoned block device support (reduce overhead) and introduces many simplifications to the code (overall, there are more deletions than insertions). In more details: * Patches 1 to 3 are SCSI side (sd driver) cleanups and improvements reducing the overhead of report zones command execution during disk scan and revalidation. * Patches 4 to 9 improve the useability and user API of zoned block devices. * Patch 10 is the main part of this series. This patch replaces the REQ_OP_ZONE_REPORT BIO/request operation for executing report zones commands with a block device file operation, removing the need for the command reply payload in-place rewriting in the BIO buffer. This leads to major simplification of the code in many places. * Patch 11 further simplifies the code of low level drivers by providing a generic implementation of zoned block device request queue zone bitmaps initialization and revalidation. Please consider the addition of these patches in 4.20. Comments are as always welcome. Changes from v3: * Changed the interface of sd_zbc_check_zones() in patch 3 to return an int and added an argument to return the zone size to avoid potential type overflow with the new int return type. Changes from v2: * Reworked patch 9 to preserve the declaration of struct request_queue nr_zones field being conditional on CONFIG_BLK_DEV_ZONED Changes from v1: * Addressed Christoph's and Bart's comments * Fixed several compilation errors with zoned block device support disabled * Rebased on latest rc including the most recent dm patches Christoph Hellwig (1): block: add a report_zones method Damien Le Moal (10): scsi: sd_zbc: Rearrange code scsi: sd_zbc: Reduce boot device scan and revalidate time scsi: sd_zbc: Fix sd_zbc_check_zones() error checks block: Introduce blkdev_nr_zones() helper block: Limit allocation of zone descriptors for report zones block: Introduce BLKGETZONESZ ioctl block: Introduce BLKGETNRZONES ioctl block: Improve zone reset execution block: Expose queue nr_zones in sysfs block: Introduce blk_revalidate_disk_zones() block/blk-core.c | 1 - block/blk-lib.c | 13 +- block/blk-mq-debugfs.c | 1 - block/blk-sysfs.c | 13 + block/blk-zoned.c | 359 ++++++++++++++--------- block/blk.h | 8 + block/ioctl.c | 4 + drivers/block/null_blk.h | 11 +- drivers/block/null_blk_main.c | 30 +- drivers/block/null_blk_zoned.c | 57 +--- drivers/md/dm-flakey.c | 30 +- drivers/md/dm-linear.c | 35 ++- drivers/md/dm-table.c | 10 + drivers/md/dm-zoned-target.c | 3 +- drivers/md/dm.c | 169 ++++++----- drivers/scsi/sd.c | 15 +- drivers/scsi/sd.h | 15 +- drivers/scsi/sd_zbc.c | 501 +++++++++------------------------ include/linux/blk_types.h | 2 - include/linux/blkdev.h | 30 +- include/linux/device-mapper.h | 12 +- include/trace/events/f2fs.h | 1 - include/uapi/linux/blkzoned.h | 3 + 23 files changed, 602 insertions(+), 721 deletions(-)