Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-19 Thread Steven Rostedt
On Tue, 2014-05-20 at 09:43 +0900, Thomas Gleixner wrote: > In kernel/locking/rtmutex.h: > > > > static inline int debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter > > *waiter, > > int detect) > > { > > return (waiter != NULL); > > }

Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-19 Thread Thomas Gleixner
On Thu, 15 May 2014, Steven Rostedt wrote: > On Wed, 14 May 2014 20:03:27 - > Thomas Gleixner wrote: > > > In case the dead lock detector is enabled we follow the lock chain to > > the end in rt_mutex_adjust_prio_chain, even if we could stop earlier > > due to the priority/waiter constellatio

Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-15 Thread Steven Rostedt
On Thu, 15 May 2014 08:47:09 +0200 Ingo Molnar wrote: > > A couple of suggestions: > > 1) > > * Thomas Gleixner wrote: > > > + if (requeue) { > > + if (waiter == rt_mutex_top_waiter(lock)) { > > So we have a 'top_waiter' local variable already at this point, and we > use it her

Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-15 Thread Steven Rostedt
On Wed, 14 May 2014 20:03:27 - Thomas Gleixner wrote: > /* Release the task */ > raw_spin_unlock_irqrestore(&task->pi_lock, flags); > + /* > + * We must abort the chain walk if there is no lock owner even > + * in the dead lock detection case, as we have nothing to

Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-15 Thread Steven Rostedt
On Wed, 14 May 2014 20:03:27 - Thomas Gleixner wrote: > In case the dead lock detector is enabled we follow the lock chain to > the end in rt_mutex_adjust_prio_chain, even if we could stop earlier > due to the priority/waiter constellation. I'm assuming that we want to detect deadlocks for a

Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-14 Thread Ingo Molnar
A couple of suggestions: 1) * Thomas Gleixner wrote: > + if (requeue) { > + if (waiter == rt_mutex_top_waiter(lock)) { So we have a 'top_waiter' local variable already at this point, and we use it here: > + /* Boost the owner */ > + rt

[patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

2014-05-14 Thread Thomas Gleixner
In case the dead lock detector is enabled we follow the lock chain to the end in rt_mutex_adjust_prio_chain, even if we could stop earlier due to the priority/waiter constellation. But once we are not longer the top priority waiter in a certain step or the task holding the lock has already the sam