All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandan Babu R <chandanbabu@kernel.org>
To: linux-xfs@vger.kernel.org
Cc: Chandan Babu R <chandanbabu@kernel.org>,
	cem@kernel.org, djwong@kernel.org
Subject: [PATCH 1/2] libfrog: Prevent unnecessary waking of worker thread when using bounded workqueues
Date: Tue,  4 Nov 2025 14:44:36 +0530	[thread overview]
Message-ID: <20251104091439.1276907-1-chandanbabu@kernel.org> (raw)

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>
---
 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


             reply	other threads:[~2025-11-04  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04  9:14 Chandan Babu R [this message]
2025-11-04  9:14 ` [PATCH 2/2] repair/prefetch.c: Create one workqueue with multiple workers Chandan Babu R
2025-11-04 10:59   ` Christoph Hellwig
2025-11-04 16:55   ` Darrick J. Wong
2025-11-06  4:01     ` Chandan Babu R
2025-11-04 10:58 ` [PATCH 1/2] libfrog: Prevent unnecessary waking of worker thread when using bounded workqueues Christoph Hellwig
2025-11-04 16:54 ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251104091439.1276907-1-chandanbabu@kernel.org \
    --to=chandanbabu@kernel.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.