[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b08772b-a69c-1f00-a43f-afcc5861ab4e@efficios.com>
Date: Sat, 27 May 2023 13:21:58 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Peter Zijlstra <peterz@...radead.org>,
torvalds@...ux-foundation.org, keescook@...omium.org,
gregkh@...uxfoundation.org, pbonzini@...hat.com
Cc: linux-kernel@...r.kernel.org, ojeda@...nel.org,
ndesaulniers@...gle.com, mingo@...hat.com, will@...nel.org,
longman@...hat.com, boqun.feng@...il.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com, paulmck@...nel.org,
frederic@...nel.org, quic_neeraju@...cinc.com,
joel@...lfernandes.org, josh@...htriplett.org,
jiangshanlai@...il.com, rcu@...r.kernel.org, tj@...nel.org,
tglx@...utronix.de
Subject: Re: [PATCH v2 0/2] Lock and Pointer guards
On 5/26/23 16:52, Peter Zijlstra wrote:
> By popular demand, a new and improved version :-)
>
> New since -v1 ( https://lkml.kernel.org/r/20230526150549.250372621@infradead.org )
>
> - much improved interface for lock guards: guard() and scoped () { }
> as suggested by Linus.
<name bikeshedding>
I know I'm the one who hinted at C++ "std::scoped_lock" as a similar
preexisting API, but I find that "scoped()" is weird in the newly
proposed form. "scoped_lock" is fine considering that "scoped" is an
adjective applying to "lock", but in the case of e.g. scoped(rcu) { },
then we are really declaring a "scope" of type "rcu". I suspect that in
this case:
scope(rcu) { }
would be less unexpected than the adjective form:
scoped(rcu) { }
Especially if we go for the name "guard()", rather than the adjective
guarded(), for its counterpart.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
Powered by blists - more mailing lists