mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk
Date: Mon, 19 May 2014 21:29:16 -0400	[thread overview]
Message-ID: <1400549356.10728.22.camel@pippen.local.home> (raw)
In-Reply-To: <alpine.DEB.2.02.1405200936320.7325@ionos.tec.linutronix.de>

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);
> > }
> > 
> > Shouldn't that be: return detect || waiter != NULL;
> > 
> 
> No. We do not care about whether the caller handed in detect or not.

Bah, you're right. I was getting confused between try_to_take_rt_mutex()
and task_blocks_on_rt_mutex(). The former passes in a NULL waiter when
taking the first time, but it's the task_blocks_on_rt_mutex() that does
the test, and yes, the waiter is never NULL when boosting.

I may send you a patch to add comments to these little idiosyncrasies.

> 
> > 
> > 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.

Yes it is confusing. I use to know this code really well, and now over
the years, it's not something to look at quickly and produce a
comprehensive response. The sad part is, I looked at it quite a bit
before sending my response and I still got confused :-p

-- Steve




  reply	other threads:[~2014-05-20  1:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 20:03 [patch 0/2] rtmutex: Fix the deadlock detector for real Thomas Gleixner
2014-05-14 20:03 ` [patch 1/2] rtmutex: Fix " Thomas Gleixner
2014-05-14 20:03 ` [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk Thomas Gleixner
2014-05-15  6:47   ` Ingo Molnar
2014-05-15 21:49     ` Steven Rostedt
2014-05-15 17:04   ` Steven Rostedt
2014-05-20  0:43     ` Thomas Gleixner
2014-05-20  1:29       ` Steven Rostedt [this message]
2014-05-15 21:39   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400549356.10728.22.camel@pippen.local.home \
    --to=rostedt@goodmis.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®