summaryrefslogtreecommitdiff
path: root/block/blk-throttle.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2025-03-05 12:31:21 +0800
committerJens Axboe <axboe@kernel.dk>2025-03-05 16:24:40 -0700
commit6cc477c36875ea5329b8bfbdf4d91f83dc653c91 (patch)
treee070e9d38774aa1ec20702ab03e05d5dd16b8880 /block/blk-throttle.h
parenta9fc8868b350cbf4ff730a4ea9651319cc669516 (diff)
blk-throttle: carry over directly
Now ->carryover_bytes[] and ->carryover_ios[] only covers limit/config update. Actually the carryover bytes/ios can be carried to ->bytes_disp[] and ->io_disp[] directly, since the carryover is one-shot thing and only valid in current slice. Then we can remove the two fields and simplify code much. Type of ->bytes_disp[] and ->io_disp[] has to change as signed because the two fields may become negative when updating limits or config, but both are big enough for holding bytes/ios dispatched in single slice Cc: Tejun Heo <tj@kernel.org> Cc: Josef Bacik <josef@toxicpanda.com> Cc: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20250305043123.3938491-4-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.h')
-rw-r--r--block/blk-throttle.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-throttle.h b/block/blk-throttle.h
index ba8f6e986994..7964cc041e06 100644
--- a/block/blk-throttle.h
+++ b/block/blk-throttle.h
@@ -102,9 +102,9 @@ struct throtl_grp {
unsigned int iops[2];
/* Number of bytes dispatched in current slice */
- uint64_t bytes_disp[2];
+ int64_t bytes_disp[2];
/* Number of bio's dispatched in current slice */
- unsigned int io_disp[2];
+ int io_disp[2];
/*
* The following two fields are updated when new configuration is