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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 14 Dec 2014 10:18:35 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 1/3] tracepoints: Do not use call_rcu_sched() before
 early_initcall()

On Sun, Dec 14, 2014 at 01:15:38PM -0500, Steven Rostedt wrote:
> On Sun, 14 Dec 2014 10:08:54 -0800
> "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com> wrote:
> 
> > On Sun, Dec 14, 2014 at 11:53:32AM -0500, Steven Rostedt wrote:
> > > On Sun, 14 Dec 2014 11:41:05 -0500
> > > Steven Rostedt <rostedt@...dmis.org> wrote:
> > > 
> > > > From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
> > > > 
> > > > In order to move enabling of trace events to just after mm_init(), the
> > > > tracepoint enable code can not use call_rcu_sched() because rcu isn't
> > > > even initialized yet.  Since this can only happen before SMP is set up
> > > > (and even before interrupts are set up), there's no reason to use
> > > > call_rcu_sched() at this point.
> > > > 
> > > > Instead, create a variable called tracepoint_rcu_safe that gets enabled
> > > > via early_initcall() and if that is not set, free the code directly
> > > > instead of using call_rcu_sched().
> > > > 
> > > > This allows us to enable tracepoints early without issues.
> > > > 
> > > > Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> > > > Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> > > > Cc: Thomas Gleixner <tglx@...utronix.de>
> > > > Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> > 
> > With the addition of read_mostly, and given that I am not going to mess
> > with call_rcu() this late in the 3.19 process without a blazingly good
> > reason:
> > 
> > Reviewed-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> 
> Thanks!
> 
> > Please note that you can use call_rcu() and friends as soon as rcu_init()
> > returns.  The callbacks won't be invoked until early_initcall() time,
> > but they will be properly queued.
> > 
> > Please note also that there are places where turning a call_rcu() into
> > a direct function call don't work, even at times when preemption is
> > disabled and there is only one CPU.  One example is where single-threaded
> > code uses call_rcu() on a list element of a list that it is traversing
> > within an RCU read-side critical section.  A direct call to the RCU
> > callback could potentially destroy the pointers that the traversal was
> > going to use to find the next element.  This means that we cannot make
> > call_rcu() do direct calls to the callback, as that would break quite
> > a bit of existing code.
> > 
> > Is there some definite point during boot before which you won't need to
> > invoke call_rcu_sched() for tracing?  I am guessing "no", but have to ask.
> > I can probably make call_rcu_sched() work arbitrarily early, but it is a
> > bit uglier.  And this assumes that irqs_disabled_flags(local_irq_save())
> > returns true during early boot.  I would -hope- this would be true!  ;-)
> 
> With your feed back, and because I would like this to go into 3.19, I
> would like to keep the current patch as is (with the read_mostly
> update, which I'm currently testing). We can always change it later
> after call_rcu() has been changed.

Completely agreed!  ;-)

							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