Re: [PATCH -v2 2/9] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

From: Thomas Gleixner
Date: Thu Sep 29 2016 - 10:52:15 EST

On Mon, 26 Sep 2016, Peter Zijlstra wrote:
> This is because rt_mutex_enqueue_pi() and rt_mutex_dequeue_pi()
> are only protected by pi_lock when operating pi waiters, while
> rt_mutex_get_top_task(), will access them with rq lock held but
> not holding pi_lock.
> In order to tackle it, we introduce new "pi_top_task" pointer
> cached in task_struct, and add new rt_mutex_update_top_task()
> to update its value, it can be called by rt_mutex_setprio()
> which held both owner's pi_lock and rq lock. Thus "pi_top_task"
> can be safely accessed by enqueue_task_dl() under rq lock.

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>