Re: [PATCH] rtmutex: Introduce __cleanup() based infrastructure
From: Thomas Böhler
Date: Mon Feb 02 2026 - 13:59:56 EST
On Mon Feb 2, 2026 at 6:58 PM CET, Sebastian Andrzej Siewior wrote:
> On 2026-02-02 18:04:43 [+0100], Thomas Böhler wrote:
>> Commit 54da6a092431 ("locking: Introduce __cleanup() based
>> infrastructure") introduced lock guards for mutexes in
>> include/linux/mutex.h, but, presumably as PREEMPT_RT wasn't merged at
>> the time, the guard for rt_mutex was never created. Do this now so this
>> infrastructure exists for rt_mutex as well.
>
> Wait, what? rt_mutex can be used independently of PREEMPT_RT.
I wasn't aware of that, sorry for the confusion. I'm still pretty
new to the Linux Kernel; my assumption was wrong here.
> I suggest you focus on what this patch does in its description and
> repost it with the locking maintainer in Cc.
Thanks, I'll do that for a potential v2!
> Do you plan to have any users of this?
No. I discovered this was "missing" while developing out-of-tree. I'm
aware that an interface should have in-tree users, but I'm also a bit
confused about who is using rt_mutex in-tree in the first place as it
looks like there are only a handful of users.
I'll make sure to do more research before I might post a v2.
Please do tell me if this isn't going to be merged due to missing users,
I'll drop this then. No problem, and sorry for the noise if that's the
case. :)
>> Signed-off-by: Thomas Böhler <witcher@xxxxxxxxxxxxx>
>
> Sebastian
--
Thomas Böhler