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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Jul 2014 10:33:18 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...nel.org,
	laijs@...fujitsu.com, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
	josh@...htriplett.org, tglx@...utronix.de, rostedt@...dmis.org,
	dhowells@...hat.com, edumazet@...gle.com, dvhart@...ux.intel.com,
	fweisbec@...il.com, oleg@...hat.com, bobby.prani@...il.com
Subject: Re: [PATCH RFC tip/core/rcu 2/9] rcu: Provide cond_resched_rcu_qs()
 to force quiescent states in long loops

On Tue, Jul 29, 2014 at 07:25:42PM +0200, Peter Zijlstra wrote:
> On Tue, Jul 29, 2014 at 09:22:36AM -0700, Paul E. McKenney wrote:
> > On Tue, Jul 29, 2014 at 09:55:36AM +0200, Peter Zijlstra wrote:
> > > On Mon, Jul 28, 2014 at 03:56:13PM -0700, Paul E. McKenney wrote:
> > > > From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> > > > 
> > > > RCU-tasks requires the occasional voluntary context switch
> > > > from CPU-bound in-kernel tasks.  In some cases, this requires
> > > > instrumenting cond_resched().  However, there is some reluctance
> > > > to countenance unconditionally instrumenting cond_resched() (see
> > > > http://lwn.net/Articles/603252/),
> > > 
> > > No, if its a good reason mention it, if not ignore it.
> > 
> > Fair enough.  ;-)
> > 
> > > > so this commit creates a separate
> > > > cond_resched_rcu_qs() that may be used in place of cond_resched() in
> > > > locations prone to long-duration in-kernel looping.
> > > 
> > > Sounds like a pain and a recipe for mistakes. How is joe kernel hacker
> > > supposed to 1) know about this new api, and 2) decide which to use?
> > > 
> > > Heck, even I wouldn't know, and I just read the damn patch.
> > 
> > When Joe Hacker gets stall warning messages due to loops in the kernel
> > that contain cond_resched(), that is a hint that cond_resched_rcu_qs()
> > is required.  These stall warnings can occur when using RCU-tasks and when
> > using normal RCU in NO_HZ_FULL kernels in cases where the scheduling-clock
> > interrupt is left off while executing a long code path in the kernel.
> > (Of course, in both cases, another eminently reasonable fix is to shorten
> > the offending code path in the kernel.)
> > 
> > I should add words to that effect to Documentation/RCU/stallwarn.txt,
> > shouldn't I?  Done.
> 
> No, but why can't we make the regular cond_resched() do this?

Well, I got a lot of grief when I tried it a few weeks ago.

But from what I can see, you are the maintainer or cond_resched(), so
if you are good with making the normal cond_resched() do this, I am
more than happy to make it so!  ;-)

							Thanx, Paul

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