RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-31 Thread 河合英宏 / KAWAI,HIDEHIRO
> From: Peter Zijlstra [mailto:pet...@infradead.org] > On Mon, Aug 31, 2015 at 08:53:11AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > I understand your question. I don't intend to permit the recursive > > > call of crash_kexec() as for 'old_cpu != this_cpu' check. That is > > > needed for the case

Re: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-31 Thread Peter Zijlstra
On Mon, Aug 31, 2015 at 08:53:11AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > I understand your question. I don't intend to permit the recursive > > call of crash_kexec() as for 'old_cpu != this_cpu' check. That is > > needed for the case of panic() --> crash_kexec(). Since panic_cpu has > >

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-31 Thread 河合英宏 / KAWAI,HIDEHIRO
Hello Peter, > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of 河合英宏 / KAWAI, > > Hi, > > > From: Peter Zijlstra [mailto:pet...@infradead.org] > > > > On Sat, Aug 22, 2015 at 02:35:24AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > > From: Peter

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-31 Thread 河合英宏 / KAWAI,HIDEHIRO
> From: Peter Zijlstra [mailto:pet...@infradead.org] > On Mon, Aug 31, 2015 at 08:53:11AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > I understand your question. I don't intend to permit the recursive > > > call of crash_kexec() as for 'old_cpu != this_cpu' check. That is > > > needed for the case

Re: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-31 Thread Peter Zijlstra
On Mon, Aug 31, 2015 at 08:53:11AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > I understand your question. I don't intend to permit the recursive > > call of crash_kexec() as for 'old_cpu != this_cpu' check. That is > > needed for the case of panic() --> crash_kexec(). Since panic_cpu has > >

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-31 Thread 河合英宏 / KAWAI,HIDEHIRO
Hello Peter, > From: linux-kernel-ow...@vger.kernel.org > [mailto:linux-kernel-ow...@vger.kernel.org] On Behalf Of 河合英宏 / KAWAI, > > Hi, > > > From: Peter Zijlstra [mailto:pet...@infradead.org] > > > > On Sat, Aug 22, 2015 at 02:35:24AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > > From: Peter

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-25 Thread 河合英宏 / KAWAI,HIDEHIRO
Hi, > From: Peter Zijlstra [mailto:pet...@infradead.org] > > On Sat, Aug 22, 2015 at 02:35:24AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > From: Peter Zijlstra [mailto:pet...@infradead.org] > > > > > > On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: > > > > void

Re: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-25 Thread Peter Zijlstra
On Sat, Aug 22, 2015 at 02:35:24AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > From: Peter Zijlstra [mailto:pet...@infradead.org] > > > > On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: > > > void crash_kexec(struct pt_regs *regs) > > > { > > > + int old_cpu, this_cpu; > > > + > > >

Re: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-25 Thread Peter Zijlstra
On Sat, Aug 22, 2015 at 02:35:24AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: From: Peter Zijlstra [mailto:pet...@infradead.org] On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: void crash_kexec(struct pt_regs *regs) { + int old_cpu, this_cpu; + + /* + *

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-25 Thread 河合英宏 / KAWAI,HIDEHIRO
Hi, From: Peter Zijlstra [mailto:pet...@infradead.org] On Sat, Aug 22, 2015 at 02:35:24AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: From: Peter Zijlstra [mailto:pet...@infradead.org] On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: void crash_kexec(struct pt_regs *regs)

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-21 Thread 河合英宏 / KAWAI,HIDEHIRO
> From: Peter Zijlstra [mailto:pet...@infradead.org] > > On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: > > void crash_kexec(struct pt_regs *regs) > > { > > + int old_cpu, this_cpu; > > + > > + /* > > +* `old_cpu == -1' means we are the first comer and crash_kexec() > >

RE: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-21 Thread 河合英宏 / KAWAI,HIDEHIRO
From: Peter Zijlstra [mailto:pet...@infradead.org] On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: void crash_kexec(struct pt_regs *regs) { + int old_cpu, this_cpu; + + /* +* `old_cpu == -1' means we are the first comer and crash_kexec() +* was

Re: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-20 Thread Peter Zijlstra
On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: > void crash_kexec(struct pt_regs *regs) > { > + int old_cpu, this_cpu; > + > + /* > + * `old_cpu == -1' means we are the first comer and crash_kexec() > + * was called without entering panic(). > + * `old_cpu

Re: [V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-20 Thread Peter Zijlstra
On Thu, Aug 06, 2015 at 02:45:43PM +0900, Hidehiro Kawai wrote: void crash_kexec(struct pt_regs *regs) { + int old_cpu, this_cpu; + + /* + * `old_cpu == -1' means we are the first comer and crash_kexec() + * was called without entering panic(). + * `old_cpu ==

[V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-05 Thread Hidehiro Kawai
Currently, panic() and crash_kexec() can be called at the same time. For example (x86 case): CPU 0: oops_end() crash_kexec() mutex_trylock() // acquired nmi_shootdown_cpus() // stop other cpus CPU 1: panic() crash_kexec() mutex_trylock() // failed to acquire

[V3 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly

2015-08-05 Thread Hidehiro Kawai
Currently, panic() and crash_kexec() can be called at the same time. For example (x86 case): CPU 0: oops_end() crash_kexec() mutex_trylock() // acquired nmi_shootdown_cpus() // stop other cpus CPU 1: panic() crash_kexec() mutex_trylock() // failed to acquire