Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2610971pxb; Tue, 13 Apr 2021 06:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKPDLe/7DwWKn3SnP2v97Loz/ccLDiF16YtyWulWQzsdRiOI6V8f27NcdHEJIDiVKrggH2 X-Received: by 2002:a17:906:fb81:: with SMTP id lr1mr6271175ejb.62.1618319575760; Tue, 13 Apr 2021 06:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618319575; cv=none; d=google.com; s=arc-20160816; b=BjUQ/VOreApr9OOIR6J4rr4Ah3K5LTTPwH2u83pIc/T127QrqePF7Dt+ZXPjFt7+Ie uCgnb4bla2KZvU2gNM6xk6cYzcFCVFXl9AEN8xb6pamq+AtY/h9K8KcAO3NEiucIaVaa PoauN99X+oFllgWnTpn7rWOYaXv6T23ItZ2SUlWiEdocoNY17m1RSOy5bU9uWEAHJDBJ 5kDCJYHLZKvPRMWfxaSKmEy1QgJvoGszQaNqxHqTHLm/Q6yt3YGz1BwVBta7NcjKKuAY WngmD6qS1HfigUpwHiyIFFTArpeq8OpGDUyLrGkUO0aJazITr9bzjRza5C3Eu7dRnGIJ f9KA== 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=WK5F/GR0LHJuohdPUrFdSYQgBi94i/jQRwh9sI/W3IA=; b=oLfDdVrAE+jhofN0ujlFDzafxtBSjqSR0DYFc/VGjoDtDjEKLh+tsiqHYSPFjrxUUp xMZ8dLLtWzli1F5U6qAffScjZJOiGk6hAv/tabSTxGSNhovBTaZb1NIRfScZYBXEYav1 4ByvugrrmsR7E2vT5YOYVwP9DtUcxd23KskaU1W6oEJib6LqL3oFfBug9BcJVlmt1Vbv LCRkfq0mI6cke0F6VQcMeE4s1Ye8TWrUP4Lk3++KUpkRBqntl/S7Aqy1dh/MFZFoXpyx x6hu50bN8PuZoVgFAZBIc9ZNG8uq0W+EV+2yJLxZuFmz3Kag13xuMbUT0XwTTxxfxR0X W8Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=LmZbMk9R; 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 a23si9613537edy.94.2021.04.13.06.12.21; Tue, 13 Apr 2021 06:12:55 -0700 (PDT) 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=LmZbMk9R; 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 S1344231AbhDMDN0 (ORCPT + 99 others); Mon, 12 Apr 2021 23:13:26 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:19226 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240462AbhDMDNX (ORCPT ); Mon, 12 Apr 2021 23:13:23 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210413031303epoutp04213e8e57b8e261cadeee9658d7098f9e~1TFg-GdmR0546805468epoutp04I for ; Tue, 13 Apr 2021 03:13:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210413031303epoutp04213e8e57b8e261cadeee9658d7098f9e~1TFg-GdmR0546805468epoutp04I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1618283583; bh=WK5F/GR0LHJuohdPUrFdSYQgBi94i/jQRwh9sI/W3IA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LmZbMk9R98lB2i/TF1o5L97BDSkdwXTWiXY8A/acId3LCC3uARyxnGDemMGgiwlS2 cUKyD3mhH+uD3yaOoNHas8BN/lBnPaZHHlY7JSG6SR2/NIhEqHxC/dvKofimeXAigv UPdytuQxJh+Z9hcUvQB0NSG8gVannk6AIM12r4JQ= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20210413031302epcas1p40ce82f736800e19d1c7a906e2b69a300~1TFgOLQgO0918909189epcas1p4n; Tue, 13 Apr 2021 03:13:02 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.159]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4FK9f45wrMz4x9Pp; Tue, 13 Apr 2021 03:13:00 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id DB.25.07927.C3C05706; Tue, 13 Apr 2021 12:13:00 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20210413031259epcas1p4406eaed9ba20e684fc038bf1937b94ff~1TFeFgCVr0918909189epcas1p4k; Tue, 13 Apr 2021 03:12:59 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210413031259epsmtrp2fc064183fac0eec4e3a0431161a92e5e~1TFeEREhR3149931499epsmtrp2e; Tue, 13 Apr 2021 03:12:59 +0000 (GMT) X-AuditID: b6c32a35-9a5ff70000011ef7-4c-60750c3cbc05 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 92.C5.08745.B3C05706; Tue, 13 Apr 2021 12:12:59 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.99.105]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210413031259epsmtip2d16d0608920fd61652a9cb65a841453e~1TFdx2Tgl1215112151epsmtip2V; Tue, 13 Apr 2021 03:12:59 +0000 (GMT) From: Changheun Lee To: damien.lemoal@wdc.com, bvanassche@acm.org, Johannes.Thumshirn@wdc.com, asml.silence@gmail.com, axboe@kernel.dk, gregkh@linuxfoundation.org, hch@infradead.org, linux-block@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 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 v7 3/3] bio: add limit_bio_size sysfs Date: Tue, 13 Apr 2021 11:55:02 +0900 Message-Id: <20210413025502.31579-4-nanich.lee@samsung.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210413025502.31579-1-nanich.lee@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xTVxzHd3rb21ZhXgqDs67RWsUgCrRA4TjLNBHJNUqELWYJLJYO7nis r/XBdLKEWAQEBBqIZpW3RBmPoch7MBbYmB3IUGQVFwQDxrHMgiAGJsy1XMj47/c7v8/3fM/v d87hYLwXOJ+TrDZQOrVCKcK3MFv79vr5yVyMceK+ZW9UUtsKUN14AY4uzy1j6ELWKwYyXWvE 0UBhFQPlTZ9nodWcxwy0+ESPuh/tQyOdJTjqLTIx0JXbJRj6fWKQjfoejzLRk2ozhoas8yxU NnUY/XPjZ4Bml2xs9Gt7EYYau5fxw57kyIPjpNlkZ5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-CMS-MailID: 20210413031259epcas1p4406eaed9ba20e684fc038bf1937b94ff X-Msg-Generator: 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: 20210413031259epcas1p4406eaed9ba20e684fc038bf1937b94ff References: <20210413025502.31579-1-nanich.lee@samsung.com> 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 --- 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 4dc7f0d499a8..220d183a4c11 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. +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 0f4f0c8a7825..4625d5319daf 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -294,6 +294,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) @@ -625,6 +626,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, @@ -659,6 +661,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.29.0