Thread (14 messages) 14 messages, 3 authors, 2023-07-25

Re: Consider switching to WQ_UNBOUND messages (was: Re: [PATCH v2 6/7] workqueue: Report work funcs that trigger automatic CPU_INTENSIVE mechanism)

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2023-07-25 14:46:58
Also in: dri-devel, linux-ide, linux-mmc, linux-pm, linux-renesas-soc, linux-riscv, linux-rtc, lkml, netdev

Hi Tejun,

On Wed, Jul 19, 2023 at 12:01 AM Tejun Heo [off-list ref] wrote:
On Tue, Jul 18, 2023 at 11:54:58AM +0200, Geert Uytterhoeven wrote:
quoted
I gave it a try on a system with an 800 MHz Cortex A9, only to discover
it makes no difference, as that machine has 1600 BogoMIPS:
Oops.
quoted
workqueue: blk_mq_run_work_fn hogged CPU for >10000us 4 times,
consider switching to WQ_UNBOUND
It could be that we actually want to switch to UNBOUND for some reports but
the above triggering most likely indicates that the threshold is too
aggressive.
quoted
Artificially low BogoMIPS numbers only happen on systems that have
the related timers (Cortex A7/A15 and later, Cortex A9 MPCore,
and arm64).
Ah, I see. Thanks for the explanation.
quoted
I will test on more systems, but that will probably not happen until
next week...
Thanks, really appreciate it. Can you try the following instead when you
have time? I just pushed up the lower boundary to 4000 MIPS. The scaling is
still capped at 1s.
Thanks, with the below, I see no more WQ_UNBOUND messages.
From 8555cbd4b22e5f85eb2bdcb84fd1d1f519a0a0d3 Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Mon, 17 Jul 2023 12:50:02 -1000
Subject: [PATCH] workqueue: Scale up wq_cpu_intensive_thresh_us if BogoMIPS is
 below 4000
quoted hunk ↗ jump to hunk
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
quoted hunk ↗ jump to hunk
@@ -6513,6 +6516,42 @@ void __init workqueue_init_early(void)
               !system_freezable_power_efficient_wq);
 }

+static void __init wq_cpu_intensive_thresh_init(void)
+{
+       unsigned long thresh;
+       unsigned long mips;
This fails to build on mips.
Apparently mips is a predefined preprocessor macro:

$ echo | mipsel-linux-gnu-gcc -dM -E - | grep -w mips
#define mips 1

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help