lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1400549356.10728.22.camel@pippen.local.home>
Date:	Mon, 19 May 2014 21:29:16 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [patch 2/2] rtmutex: Avoid pointless requeueing in the deadlock
 detection chain walk

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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ