[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0BBD3D4E-5FD5-43A9-8677-F6A9D2FBA1BE@oracle.com>
Date: Mon, 21 Jul 2025 16:52:41 +0000
From: Haakon 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: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/1] wait: Relate wait_event_cmd() to its userspace
equivalence
> On 27 Jun 2025, at 12:52, Håkon Bugge <Haakon.Bugge@...cle.com> wrote:
>
> 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>
A gentle ping on this one.
Thxs, Håkon
>
> --
>
> 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