[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aF1kdYvCQQdIttoC@casper.infradead.org>
Date: Thu, 26 Jun 2025 16:17:09 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Håkon Bugge <haakon.bugge@...cle.com>
Cc: Alan Stern <stern@...land.harvard.edu>,
Andrea Parri <parri.andrea@...il.com>,
Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Nicholas Piggin <npiggin@...il.com>,
David Howells <dhowells@...hat.com>,
Jade Alglave <j.alglave@....ac.uk>,
Luc Maranget <luc.maranget@...ia.fr>,
"Paul E. McKenney" <paulmck@...nel.org>,
Akira Yokosawa <akiyks@...il.com>,
Daniel Lustig <dlustig@...dia.com>,
Joel Fernandes <joelagnelf@...dia.com>,
Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, lkmm@...ts.linux.dev,
linux-doc@...r.kernel.org
Subject: Re: [PATCH 1/1] docs/memory-barriers.txt: Add wait_event_cmd() and
wait_event_exclusive_cmd()
On Thu, Jun 26, 2025 at 04:37:05PM +0200, Håkon Bugge wrote:
> Add said functions to the documentation and relate them to userspace's
> pthread_cond_wait(). The latter because when searching for
> functionality comparable to pthread_cond_wait(), it is very hard to
> find wait_event_cmd().
Would it not go better in the kernel-doc for wait_event_cmd() in
include/linux/wait.h?
>
> +Note that the wait_event_cmd() and wait_event_exclusive_cmd() are the
> +kernel's polymorphic implementation of userspace's
> +pthread_cond_wait().
Pet peeve: "Note that" adds nothing to this sentence. You can just
write:
The wait_event_cmd() and wait_event_exclusive_cmd() functions are the
kernel's polymorphic implementation of userspace's pthread_cond_wait().
> +Using wait_event_cmd() or wait_event_exclusive_cmd(), 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.
> +
>
> MISCELLANEOUS FUNCTIONS
> -----------------------
> --
> 2.43.5
>
>
Powered by blists - more mailing lists