Re: [PATCH v4 09/10] workqueue: Implement system-wide nr_active enforcement for unbound workqueues

From: Tejun Heo
Date: Tue Jan 30 2024 - 23:25:03 EST


On Tue, Jan 30, 2024 at 09:20:31PM -0700, Nathan Chancellor wrote:
> On Tue, Jan 30, 2024 at 06:13:02PM -1000, Tejun Heo wrote:
> > On Tue, Jan 30, 2024 at 09:12:05PM -0700, Nathan Chancellor wrote:
> > > Hi Tejun,
> > >
> > > On Tue, Jan 30, 2024 at 06:02:52PM -1000, Tejun Heo wrote:
> > > > Hello,
> > > >
> > > > Thanks for the report. Can you please test whether the following patch fixes
> > > > the problem?
> > >
> > > I just tested this change on top of 5797b1c18919 but it does not appear
> > > to resolve the issue for any of the three configurations that I tested.
> >
> > Bummer. Can you map the faulting address to the source line?
>
> Sure, here is the arm64 stacktrace run through
> scripts/decode_stacktrace.sh, the line numbers correspond to your tree
> at 5797b1c18919.

Ah, I see. How about the following?

Thanks.

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 9221a4c57ae1..31c1373505d8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1510,7 +1510,7 @@ static void wq_update_node_max_active(struct workqueue_struct *wq, int off_cpu)

lockdep_assert_held(&wq->mutex);

- if (!cpumask_test_cpu(off_cpu, effective))
+ if (off_cpu >= 0 && !cpumask_test_cpu(off_cpu, effective))
off_cpu = -1;

total_cpus = cpumask_weight_and(effective, cpu_online_mask);

--
tejun