]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 15:07:50 +0000 (17:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 15:07:50 +0000 (17:07 +0200)
added patches:
blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch

queue-5.15/blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch b/queue-5.15/blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch
new file mode 100644 (file)
index 0000000..170a64d
--- /dev/null
@@ -0,0 +1,57 @@
+From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Wed, 18 Jan 2023 09:07:01 +0100
+Subject: blk-iocost: avoid 64-bit division in ioc_timer_fn
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+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>
+---
+ block/blk-iocost.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/block/blk-iocost.c
++++ b/block/blk-iocost.c
+@@ -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
index 66340ac1c6d62a9cd1325c551cd01e99f5518d69..4fa92bf5739ae955a98e5ca6d6f1956cc4e1006e 100644 (file)
@@ -7,3 +7,4 @@ i40e-use-int-for-i40e_status.patch
 i40e-fix-build-warning-in-ice_fltr_add_mac_to_list.patch
 bonding-gcc13-synchronize-bond_-a-t-lb_xmit-types.patch
 f2fs-fix-iostat-lock-protection.patch
+blk-iocost-avoid-64-bit-division-in-ioc_timer_fn.patch