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

From: Lai Jiangshan
Date: Mon Jan 29 2024 - 11:01:17 EST


Hello, Tejun

On Fri, Jan 26, 2024 at 1:06 AM Tejun Heo <tj@xxxxxxxxxx> wrote:

> @@ -5121,6 +5374,9 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)
>
> wq->flags &= ~__WQ_ORDERED;
> wq->saved_max_active = max_active;
> + if (wq->flags & WQ_UNBOUND)
> + wq->saved_min_active = min(wq->saved_min_active, max_active);
> +

wq_update_node_max_active() must be also called here.

Thanks
Lai

> wq_adjust_max_active(wq);
>
> mutex_unlock(&wq->mutex);