Re: [PATCH] workqueue: release PENDING in __queue_work() drain/destroy reject path
From: Tejun Heo
Date: Fri May 08 2026 - 14:04:38 EST
Hello,
On Thu, 07 May 2026 04:04:46 -0700, Breno Leitao wrote:
> The caller of __queue_work() owns WORK_STRUCT_PENDING, won via
> test_and_set_bit() in queue_work_on()/__queue_delayed_work(). The
> state machine documented above __queue_work() requires that owner
> to either hand the token to a pwq (insert_work() -> set_work_pwq()),
> hand it to a timer, or release it via set_work_pool_and_clear_pending().
> try_to_grab_pending() relies on this: when it observes
> "PENDING && off-queue" it busy-loops, trusting the current owner to
> make progress.
>
> [...]
Applied to wq/for-7.1-fixes (capitalized the first word of the
subject).
Thanks.
--
tejun