blk-iocost: avoid 64-bit division in ioc_timer_fn
Subsystems (3)
PATCH 1/1 blk-iocost: avoid 64-bit division in ioc_timer_fn
From: Arnd Bergmann <[email protected]>
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.
--- block/blk-iocost.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
block/blk-iocost.c +5 -3
@@ -258,6 +258,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,
@@ -296,9 +301,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
Signature · 1 line
2.39.0
Quoted 13 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The behavior of 'enum' types has changed in gcc-13, so now the
UNBUSY_THR_PCTconstant 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'
Quoted 5 lines
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 <[email protected]>
Thanks.
Signature · 1 line
tejun
Quoted 8 lines · Arnd Bergmann
The behavior of 'enum' types has changed in gcc-13, so now the
UNBUSY_THR_PCTconstant 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:[...]
Applied, thanks!
[1/1] blk-iocost: avoid 64-bit division in ioc_timer_fn
commit: 08a39c820686f87351b21c6cf6af76a40677d3af
Best regards,
Signature · 1 line
Jens Axboe