[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250627105207.1613044-1-haakon.bugge@oracle.com>
Date: Fri, 27 Jun 2025 12:52:06 +0200
From: Håkon Bugge <haakon.bugge@...cle.com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>
Cc: Håkon Bugge <haakon.bugge@...cle.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/1] wait: Relate wait_event_cmd() to its userspace equivalence
Relate wait_event_cmd() to userspace's pthread_cond_wait(). This
because when searching for functionality comparable to
pthread_cond_wait(), it is very hard to find wait_event_cmd().
Signed-off-by: Håkon Bugge <haakon.bugge@...cle.com>
--
v1 -> v2:
* Split original patch into two
* Wordsmithing as suggested by Matthew
---
include/linux/wait.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 965a19809c7e5..62df98193a3a7 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -469,6 +469,14 @@ do { \
*
* wake_up() has to be called after changing any variable that could
* change the result of the wait condition.
+ *
+ * This is the kernel's polymorphic implementation of userspace's
+ * pthread_cond_wait().
+ *
+ * When calling this function, cmd1 is typically a lock-release call
+ * and cmd2 a lock-acquire call. The locking primitive can be chosen,
+ * contrary to pthread_cond_wait(), where the locking type is cast in
+ * stone and is a pthread_mutex_t.
*/
#define wait_event_cmd(wq_head, condition, cmd1, cmd2) \
do { \
--
2.43.5
Powered by blists - more mailing lists