Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp208380pxb; Wed, 3 Feb 2021 03:39:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyD9gPeQlyG67Guz9B/ivPYL7vwUsR0K0v3BidRNMQPlZDtsxoDJw9a/5QItcbnsz1HxORu X-Received: by 2002:a50:d90a:: with SMTP id t10mr2566069edj.162.1612352394135; Wed, 03 Feb 2021 03:39:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612352394; cv=none; d=google.com; s=arc-20160816; b=NFlIdEBGEeesWUAzz4k55wtaL+B7aw5Ct0icnF1S0GRrDeuxkwsbpIm1VzIP/oRHmy Nh7zabc3T8zIOu4LCOKi+BA1ftHKqQVyaFVzGmfduKE+OCBc/iPldAv82nAUJGKWfCY4 UKOmDlTlQ7vZZtpe0qxQvLrfUmOk5LDka9zAOrAM1hvxupERUZ4kVGTLlaeHmuEjY9wH kidVilJxCHpQ36F/aZJgc1BMUvJUvEL8N1TlJLiILLDfnsPewWjV1n8jyjAt06rXRamT MvXVV2ZdrN2zozI2CRqvQ4GLE80Xcwh57HhUBHvYgBWQ2InHI3KlNZkZNp+H5V67Zmcf AyIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:mime-version:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=HLhTdSPNvRZEoke9hAXZQYndHxV8j9rsdk5X9AlrZdY=; b=KF5Tp4mdMngr18SZHd0PXl8U4f87wV7qoJCtwCmdGRHVm5H1p86SdSKNPMK8EDyMbJ 1M8REHYVm6DoLiyEncw7SVwk6zQ0p4R+qzInk2CjNrXoThwLDfb4XgGS7UauElxXTr8r 0O5elqxWauQTd9DuS7l1L+bfE7c9wLXhfsvy2WmvAFwZTlKfmabOKuJuL/mLOHagVXG0 x3S7DQwAR4PyRpAp0XoxVMirSPtI3ZewmjEGCHxjGjxUqs+2fTqMSkAG1D/SdTMvjYEI NfTQmT9r96/hqBw8LTz8tv+6QDGLRJm679uchK7XTD0eNonJhBee0Hd6AGpg4QVj12wz 647Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ZNikr+iG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa7si1145472ejb.28.2021.02.03.03.39.29; Wed, 03 Feb 2021 03:39:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@samsung.com header.s=mail20170921 header.b=ZNikr+iG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234383AbhBCLiN (ORCPT + 99 others); Wed, 3 Feb 2021 06:38:13 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:45370 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234116AbhBCLhm (ORCPT ); Wed, 3 Feb 2021 06:37:42 -0500 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210203113653epoutp04158b2e848b83c1b3a3b756da6c66a788~gOcugLSsY1202212022epoutp04Y for ; Wed, 3 Feb 2021 11:36:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210203113653epoutp04158b2e848b83c1b3a3b756da6c66a788~gOcugLSsY1202212022epoutp04Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1612352213; bh=HLhTdSPNvRZEoke9hAXZQYndHxV8j9rsdk5X9AlrZdY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZNikr+iG1xKzmQwVIUywL5+6LDeV3a4i4iX7nZolW2b1QqxohsdN8Hn/y0N27MuY9 IpuuWV5pDwM1FYdLxWYiD+y9sAMW3b6vaHA7+/pPgBb2CPcFEX+hJBGv7hc2PXTvXe TEVJTjx0n8Huex3/4PsxPkyqKINq3doCpHjLenjU= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20210203113652epcas1p1f3ca086965769afd3e9ef5ed8cdd051b~gOctoFI4L1413214132epcas1p1R; Wed, 3 Feb 2021 11:36:52 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.162]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4DW05H0SrKz4x9Pv; Wed, 3 Feb 2021 11:36:51 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 84.AE.63458.2DA8A106; Wed, 3 Feb 2021 20:36:50 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20210203113650epcas1p2ea64df5b6349975fa92c1605edc92961~gOcraZMg60872708727epcas1p2q; Wed, 3 Feb 2021 11:36:49 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210203113649epsmtrp2074590656f4ea6065faf0ba7667cf8b8~gOcrYc45a2720227202epsmtrp2V; Wed, 3 Feb 2021 11:36:49 +0000 (GMT) X-AuditID: b6c32a36-6dfff7000000f7e2-98-601a8ad24e09 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 11.C7.13470.1DA8A106; Wed, 3 Feb 2021 20:36:49 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.99.105]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210203113649epsmtip17d32a97ab4e7a6ff6ef077cbd124a079~gOcrEsdxW2976029760epsmtip1c; Wed, 3 Feb 2021 11:36:49 +0000 (GMT) From: Changheun Lee To: gregkh@linuxfoundation.org Cc: Johannes.Thumshirn@wdc.com, asml.silence@gmail.com, axboe@kernel.dk, damien.lemoal@wdc.com, hch@infradead.org, jisoo2146.oh@samsung.com, junho89.kim@samsung.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ming.lei@redhat.com, mj0123.lee@samsung.com, nanich.lee@samsung.com, osandov@fb.com, patchwork-bot@kernel.org, seunghwan.hyun@samsung.com, sookwan7.kim@samsung.com, tj@kernel.org, tom.leiming@gmail.com, woosung2.lee@samsung.com, yt0928.kim@samsung.com Subject: [PATCH 2/2] bio: add limit_bio_size sysfs Date: Wed, 3 Feb 2021 20:21:07 +0900 Message-Id: <20210203112107.18279-1-nanich.lee@samsung.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJsWRmVeSWpSXmKPExsWy7bCmvu6lLqkEg63TzC3mrNrGaLH6bj+b RWv7NyaL5sXr2SxOT1jEZNHzpInV4m/XPSaLrw+LLfbe0ra4vGsOm8Whyc1MFtM3z2G2uHb/ DLvF4XtXWSweLpnIbHHu5CdWi3mPHSx+LT/KaPH+x3V2i1M7JjNbrN/7k81B1GNi8zt2j52z 7rJ7bF6h5XH5bKnHplWdbB77565h93i/7yqbR9+WVYwenzfJebQf6GYK4IrKsclITUxJLVJI zUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLxCdB1y8wBelBJoSwxpxQoFJBYXKyk b2dTlF9akqqQkV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ator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210203113650epcas1p2ea64df5b6349975fa92c1605edc92961 References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add limit_bio_size block sysfs node to limit bio size. Queue flag QUEUE_FLAG_LIMIT_BIO_SIZE will be set if limit_bio_size is set. And bio max size will be limited by queue max sectors via QUEUE_FLAG_LIMIT_BIO_SIZE set. Signed-off-by: Changheun Lee Signed-off-by: nanich.lee --- Documentation/ABI/testing/sysfs-block | 10 ++++++++++ Documentation/block/queue-sysfs.rst | 7 +++++++ block/blk-sysfs.c | 3 +++ 3 files changed, 20 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index e34cdeeeb9d4..86a7b15410cf 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/limit_bio_size +Date: Feb, 2021 +Contact: Changheun Lee +Description: + (RW) Toggle for set/clear QUEUE_FLAG_LIMIT_BIO_SIZE queue flag. + Queue flag QUEUE_FLAG_LIMIT_BIO_SIZE will be set if limit_bio_size + is set. And bio max size will be limited by queue max sectors. + QUEUE_FLAG_LIMIT_BIO_SIZE will be cleared if limit_bio_size is + cleard. And limit of bio max size will be cleard. diff --git a/Documentation/block/queue-sysfs.rst b/Documentation/block/queue-sysfs.rst index 2638d3446b79..cd371a821855 100644 --- a/Documentation/block/queue-sysfs.rst +++ b/Documentation/block/queue-sysfs.rst @@ -273,4 +273,11 @@ devices are described in the ZBC (Zoned Block Commands) and ZAC do not support zone commands, they will be treated as regular block devices and zoned will report "none". +limit_bio_size (RW) +------------------- +This indicates QUEUE_FLAG_LIMIT_BIO_SIZE queue flag value. And +QUEUE_FLAG_LIMIT_BIO_SIZE can be changed via set(1)/clear(0) this node. +bio max size will be limited by queue max sectors via set this node. And +limit of bio max size will be cleard via clear this node. + Jens Axboe , February 2009 diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index b513f1683af0..840d97f427e6 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -288,6 +288,7 @@ QUEUE_SYSFS_BIT_FNS(nonrot, NONROT, 1); QUEUE_SYSFS_BIT_FNS(random, ADD_RANDOM, 0); QUEUE_SYSFS_BIT_FNS(iostats, IO_STAT, 0); QUEUE_SYSFS_BIT_FNS(stable_writes, STABLE_WRITES, 0); +QUEUE_SYSFS_BIT_FNS(limit_bio_size, LIMIT_BIO_SIZE, 0); #undef QUEUE_SYSFS_BIT_FNS static ssize_t queue_zoned_show(struct request_queue *q, char *page) @@ -615,6 +616,7 @@ QUEUE_RW_ENTRY(queue_nonrot, "rotational"); QUEUE_RW_ENTRY(queue_iostats, "iostats"); QUEUE_RW_ENTRY(queue_random, "add_random"); QUEUE_RW_ENTRY(queue_stable_writes, "stable_writes"); +QUEUE_RW_ENTRY(queue_limit_bio_size, "limit_bio_size"); static struct attribute *queue_attrs[] = { &queue_requests_entry.attr, @@ -648,6 +650,7 @@ static struct attribute *queue_attrs[] = { &queue_rq_affinity_entry.attr, &queue_iostats_entry.attr, &queue_stable_writes_entry.attr, + &queue_limit_bio_size_entry.attr, &queue_random_entry.attr, &queue_poll_entry.attr, &queue_wc_entry.attr, -- 2.28.0