[PATCH] Revert "blk-throttle: Fix IO hang for a corner case"

Xiuhong Wang posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
block/blk-throttle.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] Revert "blk-throttle: Fix IO hang for a corner case"
Posted by Xiuhong Wang 1 month, 2 weeks ago
This reverts commit 5b7048b89745c3c5fb4b3080fb7bced61dba2a2b.

The throtl_adjusted_limit function was removed after
commit bf20ab538c81 ("blk-throttle: remove
CONFIG_BLK_DEV_THROTTLING_LOW"), so the problem of not being
able to scale after setting bps or iops to 1 will not occur.
So revert this commit that bps/iops can be set to 1.

Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
---
 block/blk-throttle.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 2c4192e12efa..443d1f47c2ce 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1485,13 +1485,13 @@ static ssize_t tg_set_limit(struct kernfs_open_file *of,
 			goto out_finish;
 
 		ret = -EINVAL;
-		if (!strcmp(tok, "rbps") && val > 1)
+		if (!strcmp(tok, "rbps"))
 			v[0] = val;
-		else if (!strcmp(tok, "wbps") && val > 1)
+		else if (!strcmp(tok, "wbps"))
 			v[1] = val;
-		else if (!strcmp(tok, "riops") && val > 1)
+		else if (!strcmp(tok, "riops"))
 			v[2] = min_t(u64, val, UINT_MAX);
-		else if (!strcmp(tok, "wiops") && val > 1)
+		else if (!strcmp(tok, "wiops"))
 			v[3] = min_t(u64, val, UINT_MAX);
 		else
 			goto out_finish;
-- 
2.25.1
Re: [PATCH] Revert "blk-throttle: Fix IO hang for a corner case"
Posted by Tejun Heo 1 month, 1 week ago
On Fri, Oct 11, 2024 at 09:47:24AM +0800, Xiuhong Wang wrote:
> This reverts commit 5b7048b89745c3c5fb4b3080fb7bced61dba2a2b.
> 
> The throtl_adjusted_limit function was removed after
> commit bf20ab538c81 ("blk-throttle: remove
> CONFIG_BLK_DEV_THROTTLING_LOW"), so the problem of not being
> able to scale after setting bps or iops to 1 will not occur.
> So revert this commit that bps/iops can be set to 1.
> 
> Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
> Cc: Yu Kuai <yukuai3@huawei.com>
> Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>

Please update the description to clarify that it's mostly a cleanup. Other
than that:

  Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun
Re: [PATCH] Revert "blk-throttle: Fix IO hang for a corner case"
Posted by Yu Kuai 1 month, 1 week ago
在 2024/10/11 9:47, Xiuhong Wang 写道:
> This reverts commit 5b7048b89745c3c5fb4b3080fb7bced61dba2a2b.
> 
> The throtl_adjusted_limit function was removed after
> commit bf20ab538c81 ("blk-throttle: remove
> CONFIG_BLK_DEV_THROTTLING_LOW"), so the problem of not being
> able to scale after setting bps or iops to 1 will not occur.
> So revert this commit that bps/iops can be set to 1.
> 
> Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
> Cc: Yu Kuai <yukuai3@huawei.com>
> Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
> Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> ---
>   block/blk-throttle.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
LGRM
Reviewed-by: Yu Kuai <yukuai3@huawei.com>

> diff --git a/block/blk-throttle.c b/block/blk-throttle.c
> index 2c4192e12efa..443d1f47c2ce 100644
> --- a/block/blk-throttle.c
> +++ b/block/blk-throttle.c
> @@ -1485,13 +1485,13 @@ static ssize_t tg_set_limit(struct kernfs_open_file *of,
>   			goto out_finish;
>   
>   		ret = -EINVAL;
> -		if (!strcmp(tok, "rbps") && val > 1)
> +		if (!strcmp(tok, "rbps"))
>   			v[0] = val;
> -		else if (!strcmp(tok, "wbps") && val > 1)
> +		else if (!strcmp(tok, "wbps"))
>   			v[1] = val;
> -		else if (!strcmp(tok, "riops") && val > 1)
> +		else if (!strcmp(tok, "riops"))
>   			v[2] = min_t(u64, val, UINT_MAX);
> -		else if (!strcmp(tok, "wiops") && val > 1)
> +		else if (!strcmp(tok, "wiops"))
>   			v[3] = min_t(u64, val, UINT_MAX);
>   		else
>   			goto out_finish;
> 

Re: [PATCH] Revert "blk-throttle: Fix IO hang for a corner case"
Posted by Michal Koutný 1 month, 1 week ago
Hello.

On Fri, Oct 11, 2024 at 09:47:24AM GMT, Xiuhong Wang <xiuhong.wang@unisoc.com> wrote:
> This reverts commit 5b7048b89745c3c5fb4b3080fb7bced61dba2a2b.
> 
> The throtl_adjusted_limit function was removed after
> commit bf20ab538c81 ("blk-throttle: remove
> CONFIG_BLK_DEV_THROTTLING_LOW"), so the problem of not being
> able to scale after setting bps or iops to 1 will not occur.
> So revert this commit that bps/iops can be set to 1.

What is the use case where the difference between 1 or 2 matters?
(Unless this is meant as a cleanup, then it makes sense to me.)

Thanks
Michal
Re: [PATCH] Revert "blk-throttle: Fix IO hang for a corner case"
Posted by Xiuhong Wang 1 month, 1 week ago
Hi Michal,

Remove this patch to make the code clearer and easier to understand.

Michal Koutný <mkoutny@suse.com> 于2024年10月15日周二 00:45写道:
>
> Hello.
>
> On Fri, Oct 11, 2024 at 09:47:24AM GMT, Xiuhong Wang <xiuhong.wang@unisoc.com> wrote:
> > This reverts commit 5b7048b89745c3c5fb4b3080fb7bced61dba2a2b.
> >
> > The throtl_adjusted_limit function was removed after
> > commit bf20ab538c81 ("blk-throttle: remove
> > CONFIG_BLK_DEV_THROTTLING_LOW"), so the problem of not being
> > able to scale after setting bps or iops to 1 will not occur.
> > So revert this commit that bps/iops can be set to 1.
>
> What is the use case where the difference between 1 or 2 matters?
> (Unless this is meant as a cleanup, then it makes sense to me.)
>
> Thanks
> Michal