Re: [PATCH v2 2/2] rtmutex: Kill pi_waiters_leftmost from task_struct

From: Peter Zijlstra
Date: Wed Apr 06 2016 - 14:15:35 EST


On Wed, Apr 06, 2016 at 08:59:16PM +0800, Xunlei Pang wrote:
> Current code use pi_waiters_leftmost to record the leftmost waiter,
> but actually it can be get directly from task_struct::pi_waiters
> using rb_first(). The performance penalty introduced by rb_first()
> should be fine, because normally there aren't that many rtmutexes
> chained together for one task.
>
> We don't remove rt_mutex:pi_waiters_leftmost, as it is quite possible
> for many tasks sharing one rtmutex.
>
> Thus, hereby remove pi_waiters_leftmost from task_struct.

Again, I would like Thomas to chime in. This isn't about usual, but very
much about worst case performance -- its RT code after all.