linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Onur <work@onurozkan.dev>
To: Peter Zijlstra <peterz@infradead.org>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	mingo@redhat.com, will@kernel.org, boqun.feng@gmail.com,
	longman@redhat.com, ojeda@kernel.org, alex.gaynor@gmail.com,
	gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
	a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
	dakr@kernel.org, thatslyude@gmail.com
Subject: Re: [PATCH V3] implement `ww_mutex` abstraction for the Rust tree
Date: Thu, 19 Jun 2025 17:33:44 +0300	[thread overview]
Message-ID: <20250619173344.6c72c48a@nimda.home> (raw)
In-Reply-To: <20250619141401.GI1613376@noisy.programming.kicks-ass.net>

On Thu, 19 Jun 2025 16:14:01 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Thu, Jun 19, 2025 at 05:06:56PM +0300, Onur Özkan wrote:
> > +bool rust_helper_ww_mutex_is_locked(struct ww_mutex *lock)
> > +{
> > +	return ww_mutex_is_locked(lock);
> > +}
> 
> Do we really need this? In general I dislike all the _is_locked()
> functions and would ideally like to remove them.
> 
> Pretty much the only useful pattern for any of the _is_locked()
> functions is:
> 
>   WARN_ON_ONCE(!foo_is_locked(&foo));
> 
> Any other use is dodgy as heck.
> 
> 

It's an abstraction of `ww_mutex_is_locked`. Since this is an
abstraction module, as long as `ww_mutex_is_locked` exists I think
we should keep it. FWIW it's also quite useful for tests.

  reply	other threads:[~2025-06-19 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19 14:06 [PATCH V3] implement `ww_mutex` abstraction for the Rust tree Onur Özkan
2025-06-19 14:14 ` Peter Zijlstra
2025-06-19 14:33   ` Onur [this message]
2025-06-19 14:44     ` Alice Ryhl
2025-06-19 14:53       ` Peter Zijlstra
2025-06-19 18:59         ` Boqun Feng
2025-06-19 14:42 ` Benno Lossin
2025-06-21 10:32   ` Onur
2025-06-19 14:43 ` Benno Lossin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250619173344.6c72c48a@nimda.home \
    --to=work@onurozkan.dev \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=lossin@kernel.org \
    --cc=mingo@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=thatslyude@gmail.com \
    --cc=tmgross@umich.edu \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).