Re: [PATCH 4/3] rtmutex: Avoid barrier in rt_mutex_handle_deadlock

From: Peter Zijlstra
Date: Tue Mar 22 2016 - 08:21:22 EST


On Tue, Mar 22, 2016 at 12:32:21PM +0100, Heiko Carstens wrote:
> On Tue, Mar 22, 2016 at 11:21:53AM +0100, Peter Zijlstra wrote:

> > And s390 does something entirely vile, no idea what.
>
> For the two s390 usages tsk equals current. So it could be easily replaced
> with set_current_state().

Hmm indeed, I only saw tsk = find_task_by_pid_ns() and didn't look
further, but you do indeed have an assertion later that ensures task ==
current.

I still don't get that code though; why would you set the current task
state to UNINTERRUPTIBLE, also set need_resched, but then not call
schedule() at all.

Clearly something magical is going on and its not clear.