Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 0a751df

Browse files
Waiman-Longaxboe
authored andcommitted
blk-throttle: Fix incorrect display of io.max
Commit bf20ab5 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW") attempts to revert the code change introduced by commit cd5ab1b ("blk-throttle: add .low interface"). However, it leaves behind the bps_conf[] and iops_conf[] fields in the throtl_grp structure which aren't set anywhere in the new blk-throttle.c code but are still being used by tg_prfill_limit() to display the limits in io.max. Now io.max always displays the following values if a block queue is used: <m>:<n> rbps=0 wbps=0 riops=0 wiops=0 Fix this problem by removing bps_conf[] and iops_conf[] and use bps[] and iops[] instead to complete the revert. Fixes: bf20ab5 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW") Reported-by: Justin Forbes <jforbes@redhat.com> Closes: containers/podman#22701 (comment) Signed-off-by: Waiman Long <longman@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240530134547.970075-1-longman@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 29459c3 commit 0a751df

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

block/blk-throttle.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,32 +1399,32 @@ static u64 tg_prfill_limit(struct seq_file *sf, struct blkg_policy_data *pd,
13991399
bps_dft = U64_MAX;
14001400
iops_dft = UINT_MAX;
14011401

1402-
if (tg->bps_conf[READ] == bps_dft &&
1403-
tg->bps_conf[WRITE] == bps_dft &&
1404-
tg->iops_conf[READ] == iops_dft &&
1405-
tg->iops_conf[WRITE] == iops_dft)
1402+
if (tg->bps[READ] == bps_dft &&
1403+
tg->bps[WRITE] == bps_dft &&
1404+
tg->iops[READ] == iops_dft &&
1405+
tg->iops[WRITE] == iops_dft)
14061406
return 0;
14071407

14081408
seq_printf(sf, "%s", dname);
1409-
if (tg->bps_conf[READ] == U64_MAX)
1409+
if (tg->bps[READ] == U64_MAX)
14101410
seq_printf(sf, " rbps=max");
14111411
else
1412-
seq_printf(sf, " rbps=%llu", tg->bps_conf[READ]);
1412+
seq_printf(sf, " rbps=%llu", tg->bps[READ]);
14131413

1414-
if (tg->bps_conf[WRITE] == U64_MAX)
1414+
if (tg->bps[WRITE] == U64_MAX)
14151415
seq_printf(sf, " wbps=max");
14161416
else
1417-
seq_printf(sf, " wbps=%llu", tg->bps_conf[WRITE]);
1417+
seq_printf(sf, " wbps=%llu", tg->bps[WRITE]);
14181418

1419-
if (tg->iops_conf[READ] == UINT_MAX)
1419+
if (tg->iops[READ] == UINT_MAX)
14201420
seq_printf(sf, " riops=max");
14211421
else
1422-
seq_printf(sf, " riops=%u", tg->iops_conf[READ]);
1422+
seq_printf(sf, " riops=%u", tg->iops[READ]);
14231423

1424-
if (tg->iops_conf[WRITE] == UINT_MAX)
1424+
if (tg->iops[WRITE] == UINT_MAX)
14251425
seq_printf(sf, " wiops=max");
14261426
else
1427-
seq_printf(sf, " wiops=%u", tg->iops_conf[WRITE]);
1427+
seq_printf(sf, " wiops=%u", tg->iops[WRITE]);
14281428

14291429
seq_printf(sf, "\n");
14301430
return 0;

block/blk-throttle.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,11 @@ struct throtl_grp {
9595
bool has_rules_bps[2];
9696
bool has_rules_iops[2];
9797

98-
/* internally used bytes per second rate limits */
98+
/* bytes per second rate limits */
9999
uint64_t bps[2];
100-
/* user configured bps limits */
101-
uint64_t bps_conf[2];
102100

103-
/* internally used IOPS limits */
101+
/* IOPS limits */
104102
unsigned int iops[2];
105-
/* user configured IOPS limits */
106-
unsigned int iops_conf[2];
107103

108104
/* Number of bytes dispatched in current slice */
109105
uint64_t bytes_disp[2];

0 commit comments

Comments
 (0)