Re: [QUESTION] Are these issues PREEMPT_RT-specific?
From: Steven Rostedt
Date: Wed Sep 09 2026 - 09:25:29 EST
On Wed, 9 Sep 2026 11:05:05 +0800
Ran Hongyun <ranhongyun1@xxxxxxxxxx> wrote:
> Florian,
>
> Thank you for your reply.
>
> Now I understand that the issues are particularly critical on PREEMPT_RT.
> However, I’m still not entirely clear about the "performance or throughput
> drop" you mentioned for !RT systems. Since !RT kernels are
> non-preemptible, unbounded priority inversion and stalls should not occur.
That is incorrect. !RT kernels have been preemptible for decades. There are
different levels:
SERVER - non preemptible (but no distributions use that)
VOLUNTARY - Has preemptible points in the kernel (might_sleep()) - most distros used this
FULL - Preempts everywhere that doesn't turn off preemption
RT - Turns spin locks into mutexes and preempts there too
Regardless of that, unbound priority inversion can happen even in SERVER
mode. All it takes is three tasks sharing a mutex. Only RT implements
priority inheritance (for all locks but reader locks) in the kernel which
would prevent unbounded priority inversion with normal locks.
> Are there any other factors that could still cause such a performance or
> throughput drop?
>
> In other words, if I am running a !RT system, what benefit can I actually
> expect from switching from rwlock to spinlock?
Lack of priority inheritance is true for both RT and !RT in rwlocks. Hence
that does affect both of them.
-- Steve