From patchwork Fri Jun 4 05:03:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changheun Lee X-Patchwork-Id: 12298701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14DCFC47083 for ; Fri, 4 Jun 2021 05:22:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBCC561413 for ; Fri, 4 Jun 2021 05:22:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbhFDFXu (ORCPT ); Fri, 4 Jun 2021 01:23:50 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:41713 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbhFDFXu (ORCPT ); Fri, 4 Jun 2021 01:23:50 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210604052202epoutp04243f4b794cb9a2938a8df644789fc97a~FSY-LXDsV0208402084epoutp04G for ; Fri, 4 Jun 2021 05:22:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210604052202epoutp04243f4b794cb9a2938a8df644789fc97a~FSY-LXDsV0208402084epoutp04G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1622784122; bh=Z5gPkkkwNmkerIkN8A6SpUu5QE5hqC0QGYq+H7582yU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZ/1JyIgjnRylcNozkbDAzgG56HlkIDmH21NPy181TLl6Jd/zylj0c9jeWm2KQa7a FRL6vd7tUdscvW9/gsX7JTaMbTp384e08C7dYPmHNxeAQ0aHoqK9xTZ63vkABVwmqS eVGwg9B1pYI086SVfRZxPoAtBNhlmqt6o1toRwKw= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20210604052200epcas1p10927392bc76b5389fff7e85b92972e35~FSY9hYDgT2530225302epcas1p1O; Fri, 4 Jun 2021 05:22:00 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.165]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4FxB2v4CYMz4x9Q6; Fri, 4 Jun 2021 05:21:59 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 62.75.09578.778B9B06; Fri, 4 Jun 2021 14:21:59 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20210604052159epcas1p4370bee98aad882ab335dda1565db94fb~FSY70cdHZ2130721307epcas1p4Y; Fri, 4 Jun 2021 05:21:59 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210604052159epsmtrp2483687fa9bc6c0402628969aec0a5cc6~FSY7yOIyp3141131411epsmtrp2a; Fri, 4 Jun 2021 05:21:59 +0000 (GMT) X-AuditID: b6c32a35-fcfff7000000256a-0a-60b9b8771f45 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E1.6E.08163.678B9B06; Fri, 4 Jun 2021 14:21:58 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.99.105]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210604052158epsmtip1cb265bbb9d65fd9ad6d7fa7d75c088c7~FSY7iCoi-0136401364epsmtip1T; Fri, 4 Jun 2021 05:21:58 +0000 (GMT) From: Changheun Lee To: Johannes.Thumshirn@wdc.com, alex_y_xu@yahoo.ca, asml.silence@gmail.com, axboe@kernel.dk, bgoncalv@redhat.com, jejb@linux.ibm.com, martin.petersen@oracle.com, cang@codeaurora.org, avri.altman@wdc.com, alim.akhtar@samsung.com, bvanassche@acm.org, damien.lemoal@wdc.com, gregkh@linuxfoundation.org, hch@infradead.org, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, ming.lei@redhat.com, osandov@fb.com, patchwork-bot@kernel.org, tj@kernel.org, tom.leiming@gmail.com, yi.zhang@redhat.com Cc: jisoo2146.oh@samsung.com, junho89.kim@samsung.com, mj0123.lee@samsung.com, seunghwan.hyun@samsung.com, sookwan7.kim@samsung.com, woosung2.lee@samsung.com, yt0928.kim@samsung.com, Changheun Lee Subject: [PATCH v12 1/3] bio: control bio max size Date: Fri, 4 Jun 2021 14:03:22 +0900 Message-Id: <20210604050324.28670-2-nanich.lee@samsung.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210604050324.28670-1-nanich.lee@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02TaVBTVxTH576XvAQ71EdAucO0FtPqFGRJCMtVwQFRfIOW0tp+aGcceIVX goYkTQKttbZgWGSHCWAbQBAoOmihIIWAxdogg1hgimyVspbFAWQRKmXTaUig5ds59/z+5z/n 3DlcnFfPseGGS1WMQkpL+MQOVk2jnaPj57q6YEH+1B5U3n+Lg4av1hAor6wGoMmVbgLdHEgn UH1HAUA58ys4WqgoZaO4hCUMqYsrCPRbRhGGxiq0OCr6owZDKWOX2Oh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HCbgvjttVlNuion3kmm2vQ9+QrU0pWz8SlZ6tWzkzV zmJ+9M+5LGgiz+TSX+IfuEsDY5sbtLqfTXDe3Msffvm2xfmCDRZcLK6zXfe5zFPcHBEmJChR mP9YJsP//lQRIz6l6rnXb/5kT2t0nO2dO786e/r7C+nnLWb+2BX95t0io0ZL021rhZfPvTBh klOmauKU8/0Kh3m3LAn9YlU394TQzWBht9aue+GfjNozhIwu2Lsfm/V37SbzM5Pe8zNltXWm XjaRUGIpzkg01GIuKk4EAG+o8xGEAwAA X-CMS-MailID: 20210604052159epcas1p4370bee98aad882ab335dda1565db94fb X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210604052159epcas1p4370bee98aad882ab335dda1565db94fb References: <20210604050324.28670-1-nanich.lee@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org bio size can grow up to 4GB after muli-page bvec has been enabled. But sometimes large size of bio would lead to inefficient behaviors. Control of bio max size will be helpful to improve inefficiency. Below is a example for inefficient behaviours. In case of large chunk direct I/O, - 32MB chunk read in user space - all pages for 32MB would be merged to a bio structure if the pages physical addresses are contiguous. It makes some delay to submit until merge complete. bio max size should be limited to a proper size. When 32MB chunk read with direct I/O option is coming from userspace, kernel behavior is below now in do_direct_IO() loop. It's timeline. | bio merge for 32MB. total 8,192 pages are merged. | total elapsed time is over 2ms. |------------------ ... ----------------------->| | 8,192 pages merged a bio. | at this time, first bio submit is done. | 1 bio is split to 32 read request and issue. |---------------> |---------------> |---------------> ...... |---------------> |--------------->| total 19ms elapsed to complete 32MB read done from device. | If bio max size is limited with 1MB, behavior is changed below. | bio merge for 1MB. 256 pages are merged for each bio. | total 32 bio will be made. | total elapsed time is over 2ms. it's same. | but, first bio submit timing is fast. about 100us. |--->|--->|--->|---> ... -->|--->|--->|--->|--->| | 256 pages merged a bio. | at this time, first bio submit is done. | and 1 read request is issued for 1 bio. |---------------> |---------------> |---------------> ...... |---------------> |--------------->| total 17ms elapsed to complete 32MB read done from device. | As a result, read request issue timing is faster if bio max size is limited. Current kernel behavior with multipage bvec, super large bio can be created. And it lead to delay first I/O request issue. Signed-off-by: Changheun Lee --- block/bio.c | 17 ++++++++++++++--- block/blk-settings.c | 19 +++++++++++++++++++ include/linux/bio.h | 4 +++- include/linux/blkdev.h | 3 +++ 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/block/bio.c b/block/bio.c index 44205dfb6b60..73b673f1684e 100644 --- a/block/bio.c +++ b/block/bio.c @@ -255,6 +255,13 @@ void bio_init(struct bio *bio, struct bio_vec *table, } EXPORT_SYMBOL(bio_init); +unsigned int bio_max_bytes(struct bio *bio) +{ + struct block_device *bdev = bio->bi_bdev; + + return bdev ? bdev->bd_disk->queue->limits.max_bio_bytes : UINT_MAX; +} + /** * bio_reset - reinitialize a bio * @bio: bio to reset @@ -866,7 +873,7 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page, struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1]; if (page_is_mergeable(bv, page, len, off, same_page)) { - if (bio->bi_iter.bi_size > UINT_MAX - len) { + if (bio->bi_iter.bi_size > bio_max_bytes(bio) - len) { *same_page = false; return false; } @@ -995,6 +1002,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) { unsigned short nr_pages = bio->bi_max_vecs - bio->bi_vcnt; unsigned short entries_left = bio->bi_max_vecs - bio->bi_vcnt; + unsigned int bytes_left = bio_max_bytes(bio) - bio->bi_iter.bi_size; struct bio_vec *bv = bio->bi_io_vec + bio->bi_vcnt; struct page **pages = (struct page **)bv; bool same_page = false; @@ -1010,7 +1018,8 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) BUILD_BUG_ON(PAGE_PTRS_PER_BVEC < 2); pages += entries_left * (PAGE_PTRS_PER_BVEC - 1); - size = iov_iter_get_pages(iter, pages, LONG_MAX, nr_pages, &offset); + size = iov_iter_get_pages(iter, pages, bytes_left, nr_pages, + &offset); if (unlikely(size <= 0)) return size ? size : -EFAULT; @@ -1038,6 +1047,7 @@ static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter) { unsigned short nr_pages = bio->bi_max_vecs - bio->bi_vcnt; unsigned short entries_left = bio->bi_max_vecs - bio->bi_vcnt; + unsigned int bytes_left = bio_max_bytes(bio) - bio->bi_iter.bi_size; struct request_queue *q = bio->bi_bdev->bd_disk->queue; unsigned int max_append_sectors = queue_max_zone_append_sectors(q); struct bio_vec *bv = bio->bi_io_vec + bio->bi_vcnt; @@ -1058,7 +1068,8 @@ static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter) BUILD_BUG_ON(PAGE_PTRS_PER_BVEC < 2); pages += entries_left * (PAGE_PTRS_PER_BVEC - 1); - size = iov_iter_get_pages(iter, pages, LONG_MAX, nr_pages, &offset); + size = iov_iter_get_pages(iter, pages, bytes_left, nr_pages, + &offset); if (unlikely(size <= 0)) return size ? size : -EFAULT; diff --git a/block/blk-settings.c b/block/blk-settings.c index 902c40d67120..e270e31519a1 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -32,6 +32,7 @@ EXPORT_SYMBOL_GPL(blk_queue_rq_timeout); */ void blk_set_default_limits(struct queue_limits *lim) { + lim->max_bio_bytes = UINT_MAX; lim->max_segments = BLK_MAX_SEGMENTS; lim->max_discard_segments = 1; lim->max_integrity_segments = 0; @@ -100,6 +101,24 @@ void blk_queue_bounce_limit(struct request_queue *q, enum blk_bounce bounce) } EXPORT_SYMBOL(blk_queue_bounce_limit); +/** + * blk_queue_max_bio_bytes - set bio max size for queue + * @q: the request queue for the device + * @bytes : bio max bytes to be set + * + * Description: + * Set proper bio max size to optimize queue operating. + **/ +void blk_queue_max_bio_bytes(struct request_queue *q, unsigned int bytes) +{ + struct queue_limits *limits = &q->limits; + unsigned int max_bio_bytes = round_up(bytes, PAGE_SIZE); + + limits->max_bio_bytes = max_t(unsigned int, max_bio_bytes, + BIO_MAX_VECS * PAGE_SIZE); +} +EXPORT_SYMBOL(blk_queue_max_bio_bytes); + /** * blk_queue_max_hw_sectors - set max sectors for a request for this queue * @q: the request queue for the device diff --git a/include/linux/bio.h b/include/linux/bio.h index a0b4cfdf62a4..3959cc1a0652 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -106,6 +106,8 @@ static inline void *bio_data(struct bio *bio) return NULL; } +extern unsigned int bio_max_bytes(struct bio *bio); + /** * bio_full - check if the bio is full * @bio: bio to check @@ -119,7 +121,7 @@ static inline bool bio_full(struct bio *bio, unsigned len) if (bio->bi_vcnt >= bio->bi_max_vecs) return true; - if (bio->bi_iter.bi_size > UINT_MAX - len) + if (bio->bi_iter.bi_size > bio_max_bytes(bio) - len) return true; return false; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1255823b2bc0..861888501fc0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -326,6 +326,8 @@ enum blk_bounce { }; struct queue_limits { + unsigned int max_bio_bytes; + enum blk_bounce bounce; unsigned long seg_boundary_mask; unsigned long virt_boundary_mask; @@ -1132,6 +1134,7 @@ extern void blk_abort_request(struct request *); * Access functions for manipulating queue properties */ extern void blk_cleanup_queue(struct request_queue *); +extern void blk_queue_max_bio_bytes(struct request_queue *, unsigned int); void blk_queue_bounce_limit(struct request_queue *q, enum blk_bounce limit); extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); extern void blk_queue_chunk_sectors(struct request_queue *, unsigned int); From patchwork Fri Jun 4 05:03:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changheun Lee X-Patchwork-Id: 12298703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DF04C4709A for ; Fri, 4 Jun 2021 05:22:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB1686140C for ; Fri, 4 Jun 2021 05:22:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbhFDFXx (ORCPT ); Fri, 4 Jun 2021 01:23:53 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:41749 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbhFDFXv (ORCPT ); Fri, 4 Jun 2021 01:23:51 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210604052204epoutp047789c10534cb2b05e443c852f4a1bf4a~FSZApdwzJ0365103651epoutp04K for ; Fri, 4 Jun 2021 05:22:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210604052204epoutp047789c10534cb2b05e443c852f4a1bf4a~FSZApdwzJ0365103651epoutp04K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1622784124; bh=dBTkcRF1EwwTLRDQEUEpnUBw+DAWxtwHogmD1mCaBqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d6hh90nRdNTBC149eFv15RdRs8LJmgzpBKmuVJdkDoRft+hT4g9LteGxcAtHT63Rp lwl+gR7pxA6aKJWGQJEGNiFUuy6IuXqh8Om1Q6Vq4c2qP5oGIjJDKE4gJ4P08Yzal8 l92I7J//bKlnYIZm6mrUY7IZNK68qMYxjoGyTw5k= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20210604052202epcas1p140e2c4bc04907484ff1fcc613e96d017~FSY-dJOMI0225902259epcas1p1g; Fri, 4 Jun 2021 05:22:02 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.164]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4FxB2x4dcfz4x9Pr; Fri, 4 Jun 2021 05:22:01 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 54.7F.09736.978B9B06; Fri, 4 Jun 2021 14:22:01 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210604052200epcas1p10754a3187476a0fcbfcc89c103a6d436~FSY9ISwf10225902259epcas1p1T; Fri, 4 Jun 2021 05:22:00 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210604052200epsmtrp18ee4ce07b450a1cdebb70976cc044751~FSY9GhmKz0501405014epsmtrp1N; Fri, 4 Jun 2021 05:22:00 +0000 (GMT) X-AuditID: b6c32a39-8d9ff70000002608-c1-60b9b879ca12 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 44.6E.08163.878B9B06; Fri, 4 Jun 2021 14:22:00 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.99.105]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210604052200epsmtip13ec7151c706c93536dbc88b8f538c07e~FSY81ghg13167931679epsmtip1h; Fri, 4 Jun 2021 05:22:00 +0000 (GMT) From: Changheun Lee To: Johannes.Thumshirn@wdc.com, alex_y_xu@yahoo.ca, asml.silence@gmail.com, axboe@kernel.dk, bgoncalv@redhat.com, jejb@linux.ibm.com, martin.petersen@oracle.com, cang@codeaurora.org, avri.altman@wdc.com, alim.akhtar@samsung.com, bvanassche@acm.org, damien.lemoal@wdc.com, gregkh@linuxfoundation.org, hch@infradead.org, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, ming.lei@redhat.com, osandov@fb.com, patchwork-bot@kernel.org, tj@kernel.org, tom.leiming@gmail.com, yi.zhang@redhat.com Cc: jisoo2146.oh@samsung.com, junho89.kim@samsung.com, mj0123.lee@samsung.com, seunghwan.hyun@samsung.com, sookwan7.kim@samsung.com, woosung2.lee@samsung.com, yt0928.kim@samsung.com, Changheun Lee Subject: [PATCH v12 2/3] blk-sysfs: add max_bio_bytes Date: Fri, 4 Jun 2021 14:03:23 +0900 Message-Id: <20210604050324.28670-3-nanich.lee@samsung.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210604050324.28670-1-nanich.lee@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTZxTfd2+5LWzYO5T5QTJkzaYDgVKx8Ol4GXS5iy4hLibDF3RwU8j6 Sm9ZZG6TUVYtzyIOYuWxAIMF0SaFYelkkIIxCGO68lDCQwKzg4THeDhAIWu5uPHf75zzO+d3 zu/Lx8O9LFxfXppCQ6sVEpmA8OA0dwQIgzMsLUmh5TN+6PZwAxc9rWgmUFl9M0BTq/0EujlS SCDro0qASuZXcbRgqnVD311+jiFttYlA3YYqDE2ajDiqetyMobzJLDe0njOKoeVxBrUO7Ud2 axmBcgctBKq7v4EhW7EWQ6WNZTgaGOvhoo7Rfg4arynCUW/XghuqmIhFa3X3AJpbGeSiB5Zi HA32lhDI1LpKxPpT9r7jlL0gH6OKtLNcqsU4wqUafwqk7L+lU+Z6PUEZqtoB1VbewKX+/nOI Q8392k9QBU31gFo0+1GX23MxymarxeP5p2WRqbQkhVb704pkZUqa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1zfTu4vLqmHL3kl0p4+3/6+V+a3CvaQpu W/VuhRJLcUaioRZzUXEiAIhwMjmDAwAA X-CMS-MailID: 20210604052200epcas1p10754a3187476a0fcbfcc89c103a6d436 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210604052200epcas1p10754a3187476a0fcbfcc89c103a6d436 References: <20210604050324.28670-1-nanich.lee@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add max_bio_bytes block sysfs node to show current maximum bio size. Signed-off-by: Changheun Lee --- Documentation/ABI/testing/sysfs-block | 10 ++++++++++ Documentation/block/queue-sysfs.rst | 7 +++++++ block/blk-sysfs.c | 7 +++++++ 3 files changed, 24 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index e34cdeeeb9d4..8c8a793c04b4 100644 --- a/Documentation/ABI/testing/sysfs-block +++ b/Documentation/ABI/testing/sysfs-block @@ -316,3 +316,13 @@ Description: does not complete in this time then the block driver timeout handler is invoked. That timeout handler can decide to retry the request, to fail it or to start a device recovery strategy. + +What: /sys/block//queue/max_bio_bytes +Date: June 2021 +Contact: Changheun Lee +Description: + max_bio_bytes is the maximum bio size to be submitted in bytes. + It shows current maximum bio size, and bio size to be submitted + will be limited with this. Default value is UINT_MAX, and + the minimum value is 1MB. 1MB(=BIO_MAX_VECS * PAGE_SIZE) is + legacy maximum bio size. diff --git a/Documentation/block/queue-sysfs.rst b/Documentation/block/queue-sysfs.rst index 4dc7f0d499a8..90af56899aa9 100644 --- a/Documentation/block/queue-sysfs.rst +++ b/Documentation/block/queue-sysfs.rst @@ -286,4 +286,11 @@ sequential zones of zoned block devices (devices with a zoned attributed that reports "host-managed" or "host-aware"). This value is always 0 for regular block devices. +max_bio_bytes (RO) +--------------------------- +This is the maximum number of bytes that bio size to be submitted will be +limited. A value of 4,294,967,295(UINT_MAX) means no limit of bio size, +and it's a default value. The minimum value is 1MB. It's legacy maximum +bio size. (=BIO_MAX_VECS * PAGE_SIZE) + Jens Axboe , February 2009 diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index e03bedf180ab..c4cae6bbcb3b 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -108,6 +108,11 @@ queue_ra_store(struct request_queue *q, const char *page, size_t count) return ret; } +static ssize_t queue_max_bio_bytes_show(struct request_queue *q, char *page) +{ + return queue_var_show(q->limits.max_bio_bytes, (page)); +} + static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) { int max_sectors_kb = queue_max_sectors(q) >> 1; @@ -577,6 +582,7 @@ static struct queue_sysfs_entry _prefix##_entry = { \ QUEUE_RW_ENTRY(queue_requests, "nr_requests"); QUEUE_RW_ENTRY(queue_ra, "read_ahead_kb"); +QUEUE_RO_ENTRY(queue_max_bio_bytes, "max_bio_bytes"); QUEUE_RW_ENTRY(queue_max_sectors, "max_sectors_kb"); QUEUE_RO_ENTRY(queue_max_hw_sectors, "max_hw_sectors_kb"); QUEUE_RO_ENTRY(queue_max_segments, "max_segments"); @@ -635,6 +641,7 @@ QUEUE_RW_ENTRY(queue_stable_writes, "stable_writes"); static struct attribute *queue_attrs[] = { &queue_requests_entry.attr, &queue_ra_entry.attr, + &queue_max_bio_bytes_entry.attr, &queue_max_hw_sectors_entry.attr, &queue_max_sectors_entry.attr, &queue_max_segments_entry.attr, From patchwork Fri Jun 4 05:03:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changheun Lee X-Patchwork-Id: 12298705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12F86C47097 for ; Fri, 4 Jun 2021 05:22:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF5876140C for ; Fri, 4 Jun 2021 05:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbhFDFXy (ORCPT ); Fri, 4 Jun 2021 01:23:54 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:35995 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbhFDFXw (ORCPT ); Fri, 4 Jun 2021 01:23:52 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210604052205epoutp01dac8e1f6e287968aaa3fb16fb9574b0d~FSZBhpvq-1453114531epoutp012 for ; Fri, 4 Jun 2021 05:22:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210604052205epoutp01dac8e1f6e287968aaa3fb16fb9574b0d~FSZBhpvq-1453114531epoutp012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1622784125; bh=rZO51Mk7B139Snj8jqy48Ck58v6JJKw1P5EeJY4VRY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PAXD7v849JlqSLw6mzh7OoooSDq6f8cp3Bt9DjyhkMBqq0MN4v2YTdFwzQBCOTnh8 opw90PkSw4oo1n+dtL+vQq9CtZuloCh7stXaJDFSDja+5bOmJj4j8pHkFDCED8e4SK Mzhv+Ne63I/iMcHnSP3oVkXIdcTh9zIl5ZDxegnY= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20210604052203epcas1p19d5a2bc9e6ada62c39b0bd0b6adb1a66~FSZAU8PGO0722107221epcas1p1C; Fri, 4 Jun 2021 05:22:03 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.164]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4FxB2y3yqgz4x9Pt; Fri, 4 Jun 2021 05:22:02 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 08.7F.09736.A78B9B06; Fri, 4 Jun 2021 14:22:02 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20210604052201epcas1p41a27660b20d70b7fc4295c8f131d33ce~FSY_aI2jr2460424604epcas1p4N; Fri, 4 Jun 2021 05:22:01 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210604052201epsmtrp22d5dc7dfcb41d74b8215bf29e9e73783~FSY_Yo09v3149731497epsmtrp2w; Fri, 4 Jun 2021 05:22:01 +0000 (GMT) X-AuditID: b6c32a39-8d9ff70000002608-c7-60b9b87a1549 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 69.31.08637.978B9B06; Fri, 4 Jun 2021 14:22:01 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.99.105]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210604052201epsmtip197db2faddef4d760ee11fb730a5f385b~FSY_EnKSQ0192801928epsmtip1W; Fri, 4 Jun 2021 05:22:01 +0000 (GMT) From: Changheun Lee To: Johannes.Thumshirn@wdc.com, alex_y_xu@yahoo.ca, asml.silence@gmail.com, axboe@kernel.dk, bgoncalv@redhat.com, jejb@linux.ibm.com, martin.petersen@oracle.com, cang@codeaurora.org, avri.altman@wdc.com, alim.akhtar@samsung.com, bvanassche@acm.org, damien.lemoal@wdc.com, gregkh@linuxfoundation.org, hch@infradead.org, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, ming.lei@redhat.com, osandov@fb.com, patchwork-bot@kernel.org, tj@kernel.org, tom.leiming@gmail.com, yi.zhang@redhat.com Cc: jisoo2146.oh@samsung.com, junho89.kim@samsung.com, mj0123.lee@samsung.com, seunghwan.hyun@samsung.com, sookwan7.kim@samsung.com, woosung2.lee@samsung.com, yt0928.kim@samsung.com, Changheun Lee Subject: [PATCH v12 3/3] ufs: set max_bio_bytes with queue max sectors Date: Fri, 4 Jun 2021 14:03:24 +0900 Message-Id: <20210604050324.28670-4-nanich.lee@samsung.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210604050324.28670-1-nanich.lee@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xbZRTPd2+5LWjZpZvsCy6IFRfHa3RQ+JiwLMLwLsOEZMYsM5Fe4Voa S9v1MQVNBMsb1vJQ3gxTkWmHkBTGCsokBaU45LGOx2AUlqHbXGAbDWQwh7YUIv+dc36/c37f 73w5HJzXw/bjSGRqRimjpXzCi9XVfyg0NMvcLQqv/u5l1Ha7lY0WLnYRqMHYBdCD9QkCXZ7T E6hnvAmgqsfrOFppb/FAeQVrGNJ+206g62UGDC221+HIMN2FodLFLz3Q82I7hlbvqFDvTDCy 9TQQqGTKTKBLg5sYslRqMVTd0YCjyflhNuq3T7DQneZyHI0MrXigi3ePo41LvwL06OkUG/1u rsTR1EgVgdp714njAZTt5inKpruAUeXaZTbVXTfHpjq+D6Jsf2gok7GIoMoMfYD6pbGVTT35 c4ZFPbo2QVC6TiOgHCZ/qqCvBKMslhY8ec9ZaWw6Q6cxygBGlipPk8jEcfxTp1PiU4RR4YJQ QQ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UYi4qTgQA9SDou4QDAAA= X-CMS-MailID: 20210604052201epcas1p41a27660b20d70b7fc4295c8f131d33ce X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210604052201epcas1p41a27660b20d70b7fc4295c8f131d33ce References: <20210604050324.28670-1-nanich.lee@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Set max_bio_bytes same with queue max sectors. It will lead to fast bio submit when bio size is over than queue max sectors. And it might be helpful to align submit bio size in some case. Signed-off-by: Changheun Lee --- drivers/scsi/ufs/ufshcd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3eb54937f1d8..37365a726517 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4858,6 +4858,7 @@ static int ufshcd_slave_configure(struct scsi_device *sdev) { struct ufs_hba *hba = shost_priv(sdev->host); struct request_queue *q = sdev->request_queue; + unsigned int max_bio_bytes; blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1); if (hba->quirks & UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE) @@ -4868,6 +4869,10 @@ static int ufshcd_slave_configure(struct scsi_device *sdev) ufshcd_crypto_setup_rq_keyslot_manager(hba, q); + if (!check_shl_overflow(queue_max_sectors(q), + SECTOR_SHIFT, &max_bio_bytes)) + blk_queue_max_bio_bytes(q, max_bio_bytes); + return 0; }