From patchwork Thu Sep 29 07:47:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 12993660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A41BC04A95 for ; Thu, 29 Sep 2022 07:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234421AbiI2Hry (ORCPT ); Thu, 29 Sep 2022 03:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234872AbiI2Hrx (ORCPT ); Thu, 29 Sep 2022 03:47:53 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 487F213940E for ; Thu, 29 Sep 2022 00:47:52 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220929074750euoutp02e078e797210148e481bb8b5870013e28~ZRT4MBNnL0229902299euoutp02p for ; Thu, 29 Sep 2022 07:47:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220929074750euoutp02e078e797210148e481bb8b5870013e28~ZRT4MBNnL0229902299euoutp02p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1664437670; bh=pZy4r7iqahFnpHPjfTyCoAjWDosoGm53ntzBPmPZ8tA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f2MxQuSM1UjtVP6YLM0c8dY+rnGVrFlB0x828h/aJb48m5RKfUX1ydTwTL9EO8lSN b3RbQml5SQwg2hELBZdIhzG4wwUhH8uCkBIp5zg46EIBsvlg4UEa3KDKNPje/aB6CO xn3E2cb+gB8khsP3cgbHijxUBGhaNivoZyAHoWR8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220929074748eucas1p13d26244319a6712fba0a351cad4adbe1~ZRT2xxyTw0530905309eucas1p1E; Thu, 29 Sep 2022 07:47:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9C.88.29727.4AD45336; Thu, 29 Sep 2022 08:47:48 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220929074748eucas1p1145790d433b4f57cc9e9238df480091b~ZRT2VEmMa2537025370eucas1p17; Thu, 29 Sep 2022 07:47:48 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220929074748eusmtrp13f39090b305e1b84278746fbbe16ad72~ZRT2UQdNt2626326263eusmtrp1g; Thu, 29 Sep 2022 07:47:48 +0000 (GMT) X-AuditID: cbfec7f2-205ff7000001741f-30-63354da474ab Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 75.C5.10862.3AD45336; Thu, 29 Sep 2022 08:47:48 +0100 (BST) Received: from localhost (unknown [106.210.248.168]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220929074747eusmtip1bcd50b4ea3e9782fab825f111099c12a~ZRT2EkmDP2988729887eusmtip1W; Thu, 29 Sep 2022 07:47:47 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, hch@lst.de Cc: gost.dev@samsung.com, linux-block@vger.kernel.org, damien.lemoal@opensource.wdc.com, Pankaj Raghav Subject: [PATCH v3 1/2] block: adapt blk_mq_plug() to not plug for writes that require a zone lock Date: Thu, 29 Sep 2022 09:47:44 +0200 Message-Id: <20220929074745.103073-2-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929074745.103073-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42LZduznOd0lvqbJBtefylusvtvPZvH77Hlm i5sHdjJZrFx9lMli7y1ti89LW9gd2Dwuny312H2zgc1jZ+t9Vo++LasYPT5vkgtgjeKySUnN ySxLLdK3S+DKOP/3D2vBP6GKtsdvGBsY3/J3MXJySAiYSHS2z2XqYuTiEBJYwShxavJ9dgjn C6NE77U1UJnPjBILb2xggmnpvn+KFSKxnFHi794dUM5LRomdv/4DVXFwsAloSTR2soM0iAjI S3y5vZYFxGYWqJdovvATLC4skCKx+dJzMJtFQFWif94PMJtXwEri1toV7BDL5CVmXvoOZnMK WEus+vCPFaJGUOLkzCdQM+UlmrfOZga5QUJgJYfEs+tv2SCaXSRm7ZgNdbWwxKvjW6CGykic ntzDAmFXSzy98RuquYVRon/nejaQBySAtvWdyQExmQU0Jdbv0ocod5TYdq2PEaKCT+LGW0GI E/gkJm2bzgwR5pXoaBOCqFaS2PnzCdRSCYnLTXOglnpInFqyn3kCo+IsJM/MQvLMLIS9CxiZ VzGKp5YW56anFhvmpZbrFSfmFpfmpesl5+duYgSmltP/jn/awTj31Ue9Q4xMHIyHGCU4mJVE eH8fNUwW4k1JrKxKLcqPLyrNSS0+xCjNwaIkzss2QytZSCA9sSQ1OzW1ILUIJsvEwSnVwOSe v/BAbUpW1dtk2afTuIq+LfTNn/v9U9PKih3ibv7vtfluvy0VePkrVe1KHfPDGaf/+ZcmtByb /eyD/mzzacKC8+6br3N0VE4IZVv8/eO/HzdfG7upfmxSY1hhYndyxRPv0Jj4t/l/Mmy9+/cd WRZmcj6lRPe7VsCSPpUPdv4Gs+LdIgNSThw5d6cpuz/JPPHxi+rYtMTovYl3NN4FPHD6mfXe LnuTkl7XprRp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TYfxWndGxh2csYISWdI Tje/ujgs8UiFj5Dsgr1Ly5jkXfYI1iUqK/zYvvGiEktxRqKhFnNRcSIA5xcQ2QoDAAA= X-CMS-MailID: 20220929074748eucas1p1145790d433b4f57cc9e9238df480091b X-Msg-Generator: CA X-RootMTR: 20220929074748eucas1p1145790d433b4f57cc9e9238df480091b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220929074748eucas1p1145790d433b4f57cc9e9238df480091b References: <20220929074745.103073-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The current implementation of blk_mq_plug() disables plugging for all operations that involves a transfer to the device as we just check if the last bit in op_is_write() function. Modify blk_mq_plug() to disable plugging only for REQ_OP_WRITE and REQ_OP_WRITE_ZEROS as they might require a zone lock. Suggested-by: Christoph Hellwig Suggested-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Pankaj Raghav Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- block/blk-mq.h | 3 ++- block/blk-zoned.c | 9 +++------ include/linux/blkdev.h | 9 +++++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/block/blk-mq.h b/block/blk-mq.h index 8ca453ac243d..0b2870839cdd 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -312,7 +312,8 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap) static inline struct blk_plug *blk_mq_plug( struct bio *bio) { /* Zoned block device write operation case: do not plug the BIO */ - if (bdev_is_zoned(bio->bi_bdev) && op_is_write(bio_op(bio))) + if (IS_ENABLED(CONFIG_BLK_DEV_ZONED) && + bdev_op_is_zoned_write(bio->bi_bdev, bio_op(bio))) return NULL; /* diff --git a/block/blk-zoned.c b/block/blk-zoned.c index a264621d4905..db829401d8d0 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -63,13 +63,10 @@ bool blk_req_needs_zone_write_lock(struct request *rq) if (!rq->q->disk->seq_zones_wlock) return false; - switch (req_op(rq)) { - case REQ_OP_WRITE_ZEROES: - case REQ_OP_WRITE: + if (bdev_op_is_zoned_write(rq->q->disk->part0, req_op(rq))) return blk_rq_zone_is_seq(rq); - default: - return false; - } + + return false; } EXPORT_SYMBOL_GPL(blk_req_needs_zone_write_lock); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8038c5fbde40..74bc30c680d6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1300,6 +1300,15 @@ static inline bool bdev_is_zoned(struct block_device *bdev) return false; } +static inline bool bdev_op_is_zoned_write(struct block_device *bdev, + blk_opf_t op) +{ + if (!bdev_is_zoned(bdev)) + return false; + + return op == REQ_OP_WRITE || op == REQ_OP_WRITE_ZEROES; +} + static inline sector_t bdev_zone_sectors(struct block_device *bdev) { struct request_queue *q = bdev_get_queue(bdev); From patchwork Thu Sep 29 07:47:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 12993661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2409EC6FA82 for ; Thu, 29 Sep 2022 07:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234872AbiI2Hrz (ORCPT ); Thu, 29 Sep 2022 03:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234909AbiI2Hrx (ORCPT ); Thu, 29 Sep 2022 03:47:53 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5398B139F76 for ; Thu, 29 Sep 2022 00:47:52 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220929074751euoutp01a5916f4889ff9caa8185a6aed21553a1~ZRT5PAkq41529715297euoutp01k for ; Thu, 29 Sep 2022 07:47:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220929074751euoutp01a5916f4889ff9caa8185a6aed21553a1~ZRT5PAkq41529715297euoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1664437671; bh=uBgdqevbaKPlqv9MNZMcer/p3GljEYLiI4i1BnQgJlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrMvSSG6rGrk1qM7NLN0rNpmWW0SEmpUGC3FV41JenQs0qtJL13nz8UQHnYl9cYKi g/zUaN2HGW1Pdk42wXDy2txn/aamgHO0HfcVw/ePLAZAocFNXjGwcYlbY2px4tzjRJ 1LCJAFZtA/Ga61f431czOayBrb7N4iwVV0a/Xgvg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220929074750eucas1p1f3314c5972d99f875ac580990175efc5~ZRT4Sm-ds2536125361eucas1p1L; Thu, 29 Sep 2022 07:47:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A6.CC.19378.6AD45336; Thu, 29 Sep 2022 08:47:50 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220929074749eucas1p206ebab35a37e629ed49924506e325554~ZRT3TeKYR2534025340eucas1p2o; Thu, 29 Sep 2022 07:47:49 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220929074749eusmtrp1d99546e03142b5a0cf0ae35b30757e3e~ZRT3SzuVN2626326263eusmtrp1i; Thu, 29 Sep 2022 07:47:49 +0000 (GMT) X-AuditID: cbfec7f5-a35ff70000014bb2-89-63354da61251 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F5.C5.10862.4AD45336; Thu, 29 Sep 2022 08:47:49 +0100 (BST) Received: from localhost (unknown [106.210.248.168]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220929074748eusmtip1540c6a959d1cc932c84323865a339c06~ZRT3AFrjS2987129871eusmtip1e; Thu, 29 Sep 2022 07:47:48 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, hch@lst.de Cc: gost.dev@samsung.com, linux-block@vger.kernel.org, damien.lemoal@opensource.wdc.com, Pankaj Raghav Subject: [PATCH v3 2/2] block: use blk_mq_plug() wrapper consistently in the block layer Date: Thu, 29 Sep 2022 09:47:45 +0200 Message-Id: <20220929074745.103073-3-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929074745.103073-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnleLIzCtJLcpLzFFi42LZduznOd1lvqbJBlf/sVisvtvPZvH77Hlm i5sHdjJZrFx9lMli7y1ti89LW9gd2Dwuny312H2zgc1jZ+t9Vo++LasYPT5vkgtgjeKySUnN ySxLLdK3S+DKeDjhFWtBK3/F10/7GBsYl/J0MXJwSAiYSHxZxNvFyMUhJLCCUWLb1qesEM4X RokpZ2YxQjifGSU+XjnCAtOx5FYFRHw5o0TXladsEM5LRomX2xexgRSxCWhJNHaydzFycogI yEt8ub2WBcRmFqiXaL7wEywuLBAl0XXqABuIzSKgKvHh5GuwGl4BK4m/PfvBaiSAemde+g5m cwpYS6z68I8VokZQ4uTMJ1Az5SWat85mBrlBQmAlh8SL1tmsEM0uEkv/HWeEsIUlXh3fAjVU RuL05B4WCLta4umN31DNLYwS/TvXs0F8aS3RdyYHxGQW0J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Wlqcm55bbKRXnJhbXJqXrpecn7uJERj+24793LKDceWrj3qHGJk4 GA8xSnAwK4nw/j5qmCzEm5JYWZValB9fVJqTWnyI0RTo7onMUqLJ+cAIzCuJNzQzMDU0MbM0 MLU0M1YS5/Us6EgUEkhPLEnNTk0tSC2C6WPi4JRqYKqKUl34b/mT087MMw8Ixjjvjg6qYgyd 6G8SbVNXVLY0KTY+NTpDsqNs9qbaNalcP4yNBcwT5rfKrZxz7BnDq9lV/p/k/IMu3s4Nldhw 9Wnzrl2rLXdoNPOqOryJ2Dbv3qKcXXu61+8vuvS5NvFmzR+VNged7DkKsSfDuwVP9/Kc/m/0 n1+ci/VGSn+14039zbL3Dx84879sRX756YlxzxyWNJxj18kJVLaddGDSrn9V/TWcSYuWZbTY t8hNVg/PmLpnaaj4VbUVC2odjjQwuCcv6/D42vAv/6ndk8REecOfugb53/cL7pjuv2D+cba/ cmuCni/mjPv5keHfcf3ISe5GYaadRicub5XzrYk1VWIpzkg01GIuKk4EAJuSxykIAwAA X-CMS-MailID: 20220929074749eucas1p206ebab35a37e629ed49924506e325554 X-Msg-Generator: CA X-RootMTR: 20220929074749eucas1p206ebab35a37e629ed49924506e325554 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220929074749eucas1p206ebab35a37e629ed49924506e325554 References: <20220929074745.103073-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use blk_mq_plug() wrapper to get the plug instead of directly accessing it in the block layer. Either of the changes should not have led to a bug in zoned devices: - blk_execute_rq_nowait: Only passthrough requests can use this function, and plugging can be performed on those requests in zoned devices. So no issues directly accessing the plug. - blk_flush_plug in bio_poll: As we don't plug the requests that require a zone lock in the first place, flushing should not have any impact. So no issues directly accessing the plug. This is just a cleanup patch to use this wrapper to get the plug consistently across the block layer. Signed-off-by: Pankaj Raghav Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- block/blk-core.c | 2 +- block/blk-mq.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 203be672da52..d0e97de216db 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -850,7 +850,7 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags) !test_bit(QUEUE_FLAG_POLL, &q->queue_flags)) return 0; - blk_flush_plug(current->plug, false); + blk_flush_plug(blk_mq_plug(bio), false); if (bio_queue_enter(bio)) return 0; diff --git a/block/blk-mq.c b/block/blk-mq.c index c11949d66163..5bf245c4bf0a 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1209,12 +1209,14 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq) */ void blk_execute_rq_nowait(struct request *rq, bool at_head) { + struct blk_plug *plug = blk_mq_plug(rq->bio); + WARN_ON(irqs_disabled()); WARN_ON(!blk_rq_is_passthrough(rq)); blk_account_io_start(rq); - if (current->plug) - blk_add_rq_to_plug(current->plug, rq); + if (plug) + blk_add_rq_to_plug(plug, rq); else blk_mq_sched_insert_request(rq, at_head, true, false); }