Re: [PATCH 1/2] libfrog: Prevent unnecessary waking of worker thread when using bounded workqueues

Darrick J. Wong
2025-11-04T16:54:05Z

On Tue, Nov 04, 2025 at 02:44:36PM +0530, Chandan Babu R wrote:
> When woken up, a worker will pick a work item from the workqueue and wake up
> another worker when the current workqueue is a bounded workqueue and if there
> is atleast one more work item remains to be processed.
>
> The commit 12838bda12e669 ("libfrog: fix overly sleep workqueues") prevented
> single-threaded processing of work items by waking up sleeping workers when a
> work item is added to the workqueue. Hence the earlier described mechanism of
> waking workers is no longer required.
>
> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>

That makes sense to me, sorry for forgetting to remove this hunk.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
> libfrog/workqueue.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/libfrog/workqueue.c b/libfrog/workqueue.c
> index db5b3f68b..9384270ff 100644
> --- a/libfrog/workqueue.c
> +++ b/libfrog/workqueue.c
> @@ -51,10 +51,6 @@ workqueue_thread(void *arg)
> wq->next_item = wi->next;
> wq->item_count--;
>
> - if (wq->max_queued && wq->next_item) {
> - /* more work, wake up another worker */
> - pthread_cond_signal(&wq->wakeup);
> - }
> wq->active_threads++;
> pthread_mutex_unlock(&wq->lock);
>
> --
> 2.45.2
>
>