lkml.org 
[lkml]   [2014]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk
On Thu, 15 May 2014, Steven Rostedt wrote:
> On Wed, 14 May 2014 20:03:27 -0000
> Thomas Gleixner <tglx@linutronix.de> 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 all futex calls
> even when CONFIG_DEBUG_RT_MUTEXES is set?
>
> In kernel/locking/rtmutex_common.h:
>
> #ifdef CONFIG_DEBUG_RT_MUTEXES
> # include "rtmutex-debug.h"
> #else
> # include "rtmutex.h"
> #endif
>
> In kernel/locking/rtmutex.h:
>
> #define debug_rt_mutex_detect_deadlock(w,d) (d)
>
> In kernel/locking/rtmutex.h:
>
> static inline int debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter,
> int detect)
> {
> return (waiter != NULL);
> }
>
> Shouldn't that be: return detect || waiter != NULL;
>

No. We do not care about whether the caller handed in detect or not.

>
> I know this a separate issue from this patch series, but it's
> something that I just noticed.

It's not really intuitive. We might make the call sites hand in
constants. RTMUTEX_DETECT_DEADLOCK, RTMUTEX_IGNORE_DEADLOCK or
something like that and switch it depending on
CONFIG_DEBUG_RT_MUTEXES.

Thanks,

tglx


\
 
 \ /
  Last update: 2014-05-20 03:21    [W:0.317 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site