Re: [PATCH 2/2] test-ww_mutex: Fix deadlock in test_cycle_work

From: Haakon Bugge

Date: Mon Aug 10 2026 - 12:21:06 EST




> On 7 Aug 2026, at 02:29, Bradley Morgan <include@xxxxxxxxx> wrote:
>
> > + workqueue_set_max_active(wq, cycle_ncpus + 1);
> > + workqueue_set_min_active(wq, cycle_ncpus + 1);
>
> Works on any topology. min_active is the floor of that clamp, so
> every node ends up with N + 1 slots.
>
> One thing... set_max before set_min is load bearing, not style. heh
> workqueue_set_min_active() clamps against saved_max_active:
>
> saved_min_active = clamp(min_active, 0, wq->saved_max_active);
>
> so set_min first would silently cap at the old 1024. The comment
> tells the story the other way around, heh. Something like... Feel free to
> bikeshed.
>
> /*
> * test_cycle_work() needs all N + 1 works running at once.
> * Raise max first, min_active is clamped to it.
> */

Let me do some word smithing here in the v2.

> I mean, this doesn't particularly kill the patch. Please add
>
> Reviewed-by: Bradley Morgan <include@xxxxxxxxx>

Thanks for the r-b!


Thxs, Håkon