[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171003195722.69954d2c@gandalf.local.home>
Date: Tue, 3 Oct 2017 19:57:22 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>, mingo@...hat.com, x86@...nel.org,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H . Peter Anvin" <hpa@...or.com>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
Alexei Starovoitov <ast@...nel.org>,
Alexei Starovoitov <ast@...com>
Subject: Re: [PATCH -tip v3 7/7] kprobes: Use synchronize_rcu_tasks() for
optprobe with CONFIG_PREEMPT
Sorry for the late reply. Coming back from Kernel Recipes, I fell way
behind in email.
On Fri, 29 Sep 2017 00:29:38 -0700
Masami Hiramatsu <mhiramat@...nel.org> wrote:
> > > + * are done. Because optprobe may modify multiple instructions,
> > > + * there is a chance that the Nth instruction is interrupted. In that
> > > + * case, running interrupt can return to the Nth byte of jump
> > > + * instruction. This can be avoided by waiting for returning of
> > > + * such interrupts, since (until here) the first byte of the optimized
> > > + * probe is already replaced with normal kprobe (sw breakpoint) and
> > > + * all threads which reach to the probed address will hit it and
> > > + * bypass the copied instructions (instead of executing the original.)
> > > + * With CONFIG_PREEMPT, such interrupts can be preepmted. To wait
> > > + * for such thread, we will use synchronize_rcu_tasks() which ensures
> > > + * all preeempted tasks are scheduled normally (not preempted).
> > > + * So we can ensure there is no threads preempted at probed address.
> >
> > What? Interrupts cannot be preempted.
>
> Steve, could you correct me if I'm wrong. I thought if the kernel is
> compiled with CONFIG_PREEMPT=y, even in the kernel, it can be preempted
> suddenly. It means timer interrupt occurs at kernel path and it yield
> to new task (=preempt.) Do I miss something?
The above sounds correct. I believe Ingo was pointing out the line that
states "With CONFIG_PREEMPT, such interrupts can be preempted", which
is not true. I think you meant that interrupts can preempt the kernel
and cause it to schedule out. The line above sounds like you meant the
interrupt was preempted, which can't happen.
-- Steve
Powered by blists - more mailing lists