[packages/kernel/LINUX_5_4] backport one more gcc 13 fix
atler
atler at pld-linux.org
Wed May 3 10:54:55 CEST 2023
commit ee05efb30202449eaccc1967d4acf354b544c0ea
Author: Jan Palus <jpalus at fastmail.com>
Date: Wed May 3 10:54:17 2023 +0200
backport one more gcc 13 fix
gcc13.patch | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
---
diff --git a/gcc13.patch b/gcc13.patch
index f48904c8..3dccb94b 100644
--- a/gcc13.patch
+++ b/gcc13.patch
@@ -460,3 +460,62 @@ index b34d11e226366..320afd3cf8e82 100644
--
cgit
+From 5f2779dfa7b8cc7dfd4a1b6586d86e0d193266f3 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Wed, 18 Jan 2023 09:07:01 +0100
+Subject: blk-iocost: avoid 64-bit division in ioc_timer_fn
+
+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 at arndb.de>
+Acked-by: Tejun Heo <tj at kernel.org>
+Link: https://lore.kernel.org/r/20230118080706.3303186-1-arnd@kernel.org
+Signed-off-by: Jens Axboe <axboe at kernel.dk>
+---
+ block/blk-iocost.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+(limited to 'block')
+
+diff --git a/block/blk-iocost.c b/block/blk-iocost.c
+index 6955605629e4f..b691b6bb498f3 100644
+--- 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 {
+ SURPLUS_SCALE_ABS = HWEIGHT_WHOLE / 50, /* + 2% */
+ SURPLUS_MIN_ADJ_DELTA = HWEIGHT_WHOLE / 33, /* 3% */
+
+- /* 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
+--
+cgit
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/ee05efb30202449eaccc1967d4acf354b544c0ea
More information about the pld-cvs-commit
mailing list