[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250220103727.39114d65@gandalf.local.home>
Date: Thu, 20 Feb 2025 10:37:27 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: Willy Tarreau <w@....eu>, Laurent Pinchart
<laurent.pinchart@...asonboard.com>, James Bottomley
<James.Bottomley@...senpartnership.com>, "Martin K. Petersen"
<martin.petersen@...cle.com>, Dan Carpenter <dan.carpenter@...aro.org>,
Christoph Hellwig <hch@...radead.org>, Miguel Ojeda
<miguel.ojeda.sandonis@...il.com>, rust-for-linux
<rust-for-linux@...r.kernel.org>, Linus Torvalds
<torvalds@...ux-foundation.org>, Greg KH <gregkh@...uxfoundation.org>,
David Airlie <airlied@...il.com>, linux-kernel@...r.kernel.org,
ksummit@...ts.linux.dev
Subject: Re: Rust kernel policy
On Thu, 20 Feb 2025 09:26:55 +0300
Alexey Dobriyan <adobriyan@...il.com> wrote:
> > But we should be encouraging the use of:
> >
> > scoped_guard(mutex)(&my_mutex) {
> > /* Do the work needed for for my_mutex */
> > }
>
> Meh...
>
> with_rcu() {
> }
>
> with_mutex(g_mutex) {
> }
>
> with_spin_lock(g_lock) {
> }
>
> > Which does work out very well. And the fact that the code guarded by the
> > mutex is now also indented, it makes it easier to review.
>
> It only works only for ~1-2 indents then the code flow away :-(
Then perhaps you should start using helper functions ;-)
-- Steve
Powered by blists - more mailing lists