Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.
From: Naveen N. Rao <hidden>
Date: 2017-11-23 10:02:11
Mahesh Jagannath Salgaonkar wrote:
On 11/23/2017 12:37 AM, Naveen N. Rao wrote:quoted
Mahesh J Salgaonkar wrote:quoted
From: Mahesh Salgaonkar <redacted> Rebooting into a new kernel with kexec fails in trace_tlbie() which is called from native_hpte_clear(). This happens if the running kernel has CONFIG_LOCKDEP enabled. With lockdep enabled, the tracepoints always execute few RCU checks regardless of whether tracing is on or off. We are already in the last phase of kexec sequence in real mode with HILE_BE set. At this point the RCU check ends up in RCU_LOCKDEP_WARN an=
d
quoted
quoted
causes kexec to fail. Fix this by not calling trace_tlbie() from native_hpte_clear(). Signed-off-by: Mahesh Salgaonkar <redacted> Reported-by: Aneesh Kumar K.V <redacted> Suggested-by: Michael Ellerman <mpe@ellerman.id.au> --- =C2=A0arch/powerpc/mm/hash_native_64.c |=C2=A0=C2=A0 15 ++++++++++++--- =C2=A01 file changed, 12 insertions(+), 3 deletions(-)
[snip]
quoted
quoted
@@ -100,7 +101,15 @@ static inline void __tlbie(unsigned long vpn,=20int psize, int apsize, int ssize) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 : "memory");
quoted
quoted
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; =C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 trace_tlbie(0, 0, va, 0, 0, 0, 0);=20 Does it help if you use the _rcuidle variant instead, to turn off all rcu checks for tracing __tlbie()? =C2=A0=C2=A0=C2=A0=C2=A0trace_tlbie_rcuidle(0, 0, va, 0, 0, 0, 0);=20 It helps if tracepoint is not enabled. But with tracepoint enabled kexec still fails. I think we should not have tracepoint in kexec path at all. If someone enables it, kexec will definitely fail regardless of CONFIG_LOCKDEP.
Ok, thanks for confirming that other tracepoints don't interfere with=20 kexec. As Balbir points out, moving to TRACE_EVENT_CONDITION() with a=20 global in_kexec variable may be the other option, but is probably=20 overkill for a single tracepoint. Acked-by: Naveen N. Rao <redacted> Thanks, Naveen =