mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] workqueue: Fix kernel-doc comment of unplug_oldest_pwq()
@ 2024-02-09 17:06 Waiman Long
  2024-02-09 21:04 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Waiman Long @ 2024-02-09 17:06 UTC (permalink / raw)
  To: Tejun Heo, Lai Jiangshan, Jonathan Corbet; +Cc: linux-kernel, Waiman Long

Fix the kernel-doc comment of the unplug_oldest_pwq() function to enable
proper processing and formatting of the embedded ASCII diagram.

Signed-off-by: Waiman Long <longman@redhat.com>
---
 kernel/workqueue.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cd2c6edc5c66..ddcdeb7b9f26 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1787,14 +1787,12 @@ static bool pwq_activate_first_inactive(struct pool_workqueue *pwq, bool fill)
 }
 
 /**
- * unplug_oldest_pwq - restart an oldest plugged pool_workqueue
- * @wq: workqueue_struct to be restarted
+ * unplug_oldest_pwq - unplug the oldest pool_workqueue
+ * @wq: workqueue_struct where its oldest pwq is to be unplugged
  *
- * pwq's are linked into wq->pwqs with the oldest first. For ordered
- * workqueues, only the oldest pwq is unplugged, the others are plugged to
- * suspend execution until the oldest one is drained. When this happens, the
- * next oldest one (first plugged pwq in iteration) will be unplugged to
- * restart work item execution to ensure proper work item ordering.
+ * This function should only be called for ordered workqueues where only the
+ * oldest pwq is unplugged, the others are plugged to suspend execution to
+ * ensure proper work item ordering::
  *
  *    dfl_pwq --------------+     [P] - plugged
  *                          |
@@ -1804,6 +1802,11 @@ static bool pwq_activate_first_inactive(struct pool_workqueue *pwq, bool fill)
  *            1    3        5
  *            |    |        |
  *            2    4        6
+ *
+ * When the oldest pwq is drained and removed, this function should be called
+ * to unplug the next oldest one to start its work item execution. Note that
+ * pwq's are linked into wq->pwqs with the oldest first, so the first one in
+ * the list is the oldest.
  */
 static void unplug_oldest_pwq(struct workqueue_struct *wq)
 {
-- 
2.39.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] workqueue: Fix kernel-doc comment of unplug_oldest_pwq()
  2024-02-09 17:06 [PATCH v2] workqueue: Fix kernel-doc comment of unplug_oldest_pwq() Waiman Long
@ 2024-02-09 21:04 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-02-09 21:04 UTC (permalink / raw)
  To: Waiman Long; +Cc: Lai Jiangshan, Jonathan Corbet, linux-kernel

On Fri, Feb 09, 2024 at 12:06:11PM -0500, Waiman Long wrote:
> Fix the kernel-doc comment of the unplug_oldest_pwq() function to enable
> proper processing and formatting of the embedded ASCII diagram.
> 
> Signed-off-by: Waiman Long <longman@redhat.com>

Applied to wq/for-6.9.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-09 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 17:06 [PATCH v2] workqueue: Fix kernel-doc comment of unplug_oldest_pwq() Waiman Long
2024-02-09 21:04 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®