This is a note to let you know that I've just added the patch titled Revert "workqueue: Factor out pwq_is_empty()" to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: revert-workqueue-factor-out-pwq_is_empty.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 5657d3e1d91861a39638e620d7aeaadc530a5a1e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Wed, 3 Apr 2024 16:36:48 +0200 Subject: Revert "workqueue: Factor out pwq_is_empty()" From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> This reverts commit bad184d26a4f68aa00ad75502f9669950a790f71 which is commit afa87ce85379e2d93863fce595afdb5771a84004 upstream. The workqueue patches backported to 6.6.y caused some reported regressions, so revert them for now. Reported-by: Thorsten Leemhuis <regressions@xxxxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Cc: Nathan Chancellor <nathan@xxxxxxxxxx> Cc: Sasha Levin <sashal@xxxxxxxxxx> Cc: Audra Mitchell <audra@xxxxxxxxxx> Link: https://lore.kernel.org/all/ce4c2f67-c298-48a0-87a3-f933d646c73b@xxxxxxxxxxxxx/ Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- kernel/workqueue.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1450,11 +1450,6 @@ static void put_pwq_unlocked(struct pool } } -static bool pwq_is_empty(struct pool_workqueue *pwq) -{ - return !pwq->nr_active && list_empty(&pwq->inactive_works); -} - static void pwq_activate_inactive_work(struct work_struct *work) { struct pool_workqueue *pwq = get_work_pwq(work); @@ -3324,7 +3319,7 @@ reflush: bool drained; raw_spin_lock_irq(&pwq->pool->lock); - drained = pwq_is_empty(pwq); + drained = !pwq->nr_active && list_empty(&pwq->inactive_works); raw_spin_unlock_irq(&pwq->pool->lock); if (drained) @@ -4784,7 +4779,7 @@ static bool pwq_busy(struct pool_workque if ((pwq != pwq->wq->dfl_pwq) && (pwq->refcnt > 1)) return true; - if (!pwq_is_empty(pwq)) + if (pwq->nr_active || !list_empty(&pwq->inactive_works)) return true; return false; @@ -5222,7 +5217,7 @@ void show_one_workqueue(struct workqueue unsigned long flags; for_each_pwq(pwq, wq) { - if (!pwq_is_empty(pwq)) { + if (pwq->nr_active || !list_empty(&pwq->inactive_works)) { idle = false; break; } @@ -5234,7 +5229,7 @@ void show_one_workqueue(struct workqueue for_each_pwq(pwq, wq) { raw_spin_lock_irqsave(&pwq->pool->lock, flags); - if (!pwq_is_empty(pwq)) { + if (pwq->nr_active || !list_empty(&pwq->inactive_works)) { /* * Defer printing to avoid deadlocks in console * drivers that queue work while holding locks Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-6.6/revert-workqueue-move-pwq-max_active-to-wq-max_active.patch queue-6.6/revert-workqueue-replace-pwq_activate_inactive_work-with-pwq_activate_work.patch queue-6.6/revert-workqueue-implement-system-wide-nr_active-enforcement-for-unbound-workqueues.patch queue-6.6/revert-workqueue-introduce-struct-wq_node_nr_active.patch queue-6.6/revert-workqueue-rcu-protect-wq-dfl_pwq-and-implement-accessors-for-it.patch queue-6.6/revert-workqueue-don-t-call-cpumask_test_cpu-with-1-cpu-in-wq_update_node_max_active.patch queue-6.6/revert-workqueue-factor-out-pwq_is_empty.patch queue-6.6/revert-workqueue-shorten-events_freezable_power_efficient-name.patch queue-6.6/revert-workqueue-make-wq_adjust_max_active-round-robin-pwqs-while-activating.patch queue-6.6/revert-workqueue.c-increase-workqueue-name-length.patch queue-6.6/revert-workqueue-move-nr_active-handling-into-helpers.patch