[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 8 Aug 2014 18:51:12 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Oleg Nesterov <oleg@...hat.com>, 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, dhowells@...hat.com,
edumazet@...gle.com, dvhart@...ux.intel.com, fweisbec@...il.com,
bobby.prani@...il.com, masami.hiramatsu.pt@...achi.com
Subject: Re: [PATCH v3 tip/core/rcu 3/9] rcu: Add synchronous grace-period
waiting for RCU-tasks
On Fri, Aug 08, 2014 at 09:39:05AM -0700, Paul E. McKenney wrote:
> On Fri, Aug 08, 2014 at 06:27:14PM +0200, Peter Zijlstra wrote:
> > On Fri, Aug 08, 2014 at 10:58:58AM -0400, Steven Rostedt wrote:
> >
> > > > > No, they are also used by optimized kprobes. This is why optimized
> > > > > kprobes depend on !CONFIG_PREEMPT. [ added Masami to the discussion ].
> > > >
> > > > How do those work? Is that one where the INT3 relocates the instruction
> > > > stream into an alternative 'text' and that JMPs back into the original
> > > > stream at the end?
> > >
> > > No, it's where we replace the 'int3' with a jump to a trampoline that
> > > simulates an INT3. Speeds things up quite a bit.
> >
> > OK, so the trivial 'fix' for that is to patch the probe site like:
> >
> > preempt_disable(); INC GS:%__preempt_count
> > call trampoline; CALL 0xDEADBEEF
> > preempt_enable(); DEC GS:%__preempt_count
> > JNZ 1f
> > CALL ___preempt_schedule
> > 1f:
> >
> > At which point the preempt_disable/enable() are the read side primitives
> > and call_rcu_sched/synchronize_sched are sufficient to release it.
>
> Unless this is done in idle, at which point RCU-sched is studiously
> ignoring any preempt_disable() sections.
Well, given that kprobes is already using it, it 'must' be good ;-) I
suspect much of the idle loop is marked with __kprobe or so, or nobody
has been brave enough to try.
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists