Re: [PATCH V3] implement `ww_mutex` abstraction for the Rust tree
From: Peter Zijlstra
Date: Thu Jun 19 2025 - 10:14:22 EST
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.