summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-01-18 11:07:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-11 17:03:41 +0300
commita744060574889927f2c22a0562d69aa820e3c9e1 (patch)
tree48758c76af7b780c66cffbfc5fd89fd585fa55e0 /block
parent7ac1a137beb391198a888f1ba24d42d664717f91 (diff)
downloadlinux-a744060574889927f2c22a0562d69aa820e3c9e1.tar.xz
blk-iocost: avoid 64-bit division in ioc_timer_fn
commit 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 upstream. The behavior of 'enum' types has changed in gcc-13, so now the UNBUSY_THR_PCT constant is interpreted as a 64-bit number because it is defined as part of the same enum definition as some other constants that do not fit within a 32-bit integer. This in turn leads to some inefficient code on 32-bit architectures as well as a link error: arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: block/blk-iocost.o: in function `ioc_timer_fn': blk-iocost.c:(.text+0x68e8): undefined reference to `__aeabi_uldivmod' arm-linux-gnueabi-ld: blk-iocost.c:(.text+0x6908): undefined reference to `__aeabi_uldivmod' Split the enum definition to keep the 64-bit timing constants in a separate enum type from those constants that can clearly fit within a smaller type. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-iocost.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index bfc33fa9a063..b706fd0efeda 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -256,6 +256,11 @@ enum {
VRATE_MIN = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION,
VRATE_CLAMP_ADJ_PCT = 4,
+ /* switch iff the conditions are met for longer than this */
+ AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
+};
+
+enum {
/* if IOs end up waiting for requests, issue less */
RQ_WAIT_BUSY_PCT = 5,
@@ -294,9 +299,6 @@ enum {
/* don't let cmds which take a very long time pin lagging for too long */
MAX_LAGGING_PERIODS = 10,
- /* switch iff the conditions are met for longer than this */
- AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
-
/*
* Count IO size in 4k pages. The 12bit shift helps keeping
* size-proportional components of cost calculation in closer