Re: [PATCH v2] locking/rtmutex: Annotate API and implementation
From: Sebastian Andrzej Siewior
Date: Tue May 05 2026 - 10:04:43 EST
On 2026-05-05 09:50:11 [+0200], Bart Van Assche wrote:
>
> On 5/5/26 9:32 AM, Sebastian Andrzej Siewior wrote:
> > I see. I don't know why CONTEXT_ANALYSIS_rtmutex was skipped. Was this
> > just a regular compile with newer clang or was there more to it? I do
> > remember clang was not complaining but then context-analysis flag was
> > missing…
>
> Hi Sebastian,
Hi Bart,
> This was noticed by enabling CONFIG_WARN_CONTEXT_ANALYSIS_ALL=n. I'm not
> sure why this was not noticed earlier. Maybe as the result of an
> oversight?
I have here clang-22 and make with CONFIG_WARN_CONTEXT_ANALYSIS_ALL=n
and CONFIG_WARN_CONTEXT_ANALYSIS=y. I don't see any warning without your
patch during "make kernel/locking/".
The change
CONTEXT_ANALYSIS_rtmutex.o := y
is not needed because rtmutex.o is not compiled on its own:
| $ git grep "rtmutex\.c" kernel/locking/
| kernel/locking/rtmutex_api.c:#include "rtmutex.c"
| kernel/locking/rwsem.c:#include "rtmutex.c"
| kernel/locking/spinlock_rt.c:#include "rtmutex.c"
| kernel/locking/ww_rt_mutex.c:#include "rtmutex.c"
or do I miss something here?
I tried with PREEMPT_RT enabled and disabled. Also with and without
LOCKDEP in case it makes a change.
> Thanks,
>
> Bart.
Sebastian