Re: [PATCH V3] panic: Move panic_print before kmsg dumpers

2022-01-19 Thread Guilherme G. Piccoli
Hi Petr, thanks again for the thorough review! I will implement all your suggestions and submit a V4, all makes sense to me =) Cheers, Guilherme ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec

[PATCH v2] proc/vmcore: fix possible deadlock on concurrent mmap and read

2022-01-19 Thread David Hildenbrand
Lockdep noticed that there is chance for a deadlock if we have concurrent mmap, concurrent read, and the addition/removal of a callback. As nicely explained by Boqun: " Lockdep warned about the above sequences because rw_semaphore is a fair read-write lock, and the following can cause a

Re: [PATCH V3] panic: Move panic_print before kmsg dumpers

2022-01-19 Thread Petr Mladek
On Fri 2022-01-14 15:30:46, Guilherme G. Piccoli wrote: > The panic_print setting allows users to collect more information in a > panic event, like memory stats, tasks, CPUs backtraces, etc. > This is a pretty interesting debug mechanism, but currently the print > event happens *after*

Re: [PATCH V3] panic: Move panic_print before kmsg dumpers

2022-01-19 Thread Guilherme G. Piccoli
Thanks again Petr, for the deep analysis! Much appreciated. Some comments inline below: On 19/01/2022 12:48, Petr Mladek wrote: >[...] > From my POV, the function of panic notifiers is not well defined. They > do various things, for example: > [...] > > The do more that just providing

Re: [PATCH V3] panic: Move panic_print before kmsg dumpers

2022-01-19 Thread Petr Mladek
On Wed 2022-01-19 15:13:18, Baoquan He wrote: > On 01/14/22 at 03:30pm, Guilherme G. Piccoli wrote: > > The panic_print setting allows users to collect more information in a > > panic event, like memory stats, tasks, CPUs backtraces, etc. > > This is a pretty interesting debug mechanism, but

Re: [PATCH v1] proc/vmcore: fix false positive lockdep warning

2022-01-19 Thread David Hildenbrand
On 19.01.22 16:15, David Hildenbrand wrote: > On 19.01.22 16:08, Boqun Feng wrote: >> Hi, >> >> On Wed, Jan 19, 2022 at 12:37:02PM +0100, David Hildenbrand wrote: >>> Lockdep complains that we do during mmap of the vmcore: >>> down_write(mmap_lock); >>> down_read(vmcore_cb_rwsem); >>> And

Re: [PATCH v1] proc/vmcore: fix false positive lockdep warning

2022-01-19 Thread David Hildenbrand
On 19.01.22 16:08, Boqun Feng wrote: > Hi, > > On Wed, Jan 19, 2022 at 12:37:02PM +0100, David Hildenbrand wrote: >> Lockdep complains that we do during mmap of the vmcore: >> down_write(mmap_lock); >> down_read(vmcore_cb_rwsem); >> And during read of the vmcore: >>

Re: [PATCH v1] proc/vmcore: fix false positive lockdep warning

2022-01-19 Thread Boqun Feng
Hi, On Wed, Jan 19, 2022 at 12:37:02PM +0100, David Hildenbrand wrote: > Lockdep complains that we do during mmap of the vmcore: > down_write(mmap_lock); > down_read(vmcore_cb_rwsem); > And during read of the vmcore: > down_read(vmcore_cb_rwsem); > down_read(mmap_lock); >

Re: [PATCH V3] panic: Move panic_print before kmsg dumpers

2022-01-19 Thread Guilherme G. Piccoli
On 19/01/2022 04:13, Baoquan He wrote: > [...] > Thanks for the effort. > > > I have some concerns about this patch, and it's still not clear to me > why the thing done in this patch

Re: [PATCH v2 0/5] kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef

2022-01-19 Thread Jisheng Zhang
On Wed, Jan 19, 2022 at 05:33:22PM +0800, Baoquan He wrote: > On 01/19/22 at 09:52am, Alexandre Ghiti wrote: > > Hi Baoquan, > > > > On Wed, Jan 19, 2022 at 9:11 AM Baoquan He wrote: > > > > > > On 01/18/22 at 10:13pm, Jisheng Zhang wrote: > > > > On Sun, Jan 16, 2022 at 09:38:47PM +0800,

[PATCH v1] proc/vmcore: fix false positive lockdep warning

2022-01-19 Thread David Hildenbrand
Lockdep complains that we do during mmap of the vmcore: down_write(mmap_lock); down_read(vmcore_cb_rwsem); And during read of the vmcore: down_read(vmcore_cb_rwsem); down_read(mmap_lock); We cannot possibly deadlock when only taking vmcore_cb_rwsem in read mode,

Re: [PATCH v3 6/6] crash hp: Add x86 crash hotplug support

2022-01-19 Thread Baoquan He
On 01/10/22 at 02:57pm, Eric DeVolder wrote: > For x86_64, when CPU or memory is hot un/plugged, the crash > elfcorehdr, which describes the CPUs and memory in the system, > must also be updated. > > To update the elfcorehdr for x86_64, a new elfcorehdr must be > generated from the available CPUs

Re: [PATCH v2 0/5] kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef

2022-01-19 Thread Baoquan He
On 01/19/22 at 09:52am, Alexandre Ghiti wrote: > Hi Baoquan, > > On Wed, Jan 19, 2022 at 9:11 AM Baoquan He wrote: > > > > On 01/18/22 at 10:13pm, Jisheng Zhang wrote: > > > On Sun, Jan 16, 2022 at 09:38:47PM +0800, Baoquan He wrote: > > > > Hi Jisheng, > > > > > > Hi Baoquan, > > > > > > > > >

Re: [PATCH v2 0/5] kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef

2022-01-19 Thread Alexandre Ghiti
Hi Baoquan, On Wed, Jan 19, 2022 at 9:11 AM Baoquan He wrote: > > On 01/18/22 at 10:13pm, Jisheng Zhang wrote: > > On Sun, Jan 16, 2022 at 09:38:47PM +0800, Baoquan He wrote: > > > Hi Jisheng, > > > > Hi Baoquan, > > > > > > > > On 12/07/21 at 12:05am, Jisheng Zhang wrote: > > > > Replace the

Re: [PATCH v3 3/6] crash hp: definitions and prototype changes

2022-01-19 Thread Baoquan He
On 01/10/22 at 02:57pm, Eric DeVolder wrote: > This change adds members to struct kimage to facilitate crash > hotplug support. > > This change also defines crash hotplug events and associated > prototypes. > > Signed-off-by: Eric DeVolder > --- > include/linux/kexec.h | 21

Re: [RFC v2 3/6] crash hp: definitions and prototype changes

2022-01-19 Thread Baoquan He
On 01/19/22 at 04:23pm, Baoquan He wrote: > On 12/07/21 at 02:52pm, Eric DeVolder wrote: > > This change adds members to struct kimage to facilitate crash > > hotplug support. > > > > This change also defines crash hotplug events and associated > > prototypes. > > > > Signed-off-by: Eric

Re: [RFC v2 3/6] crash hp: definitions and prototype changes

2022-01-19 Thread Baoquan He
On 12/07/21 at 02:52pm, Eric DeVolder wrote: > This change adds members to struct kimage to facilitate crash > hotplug support. > > This change also defines crash hotplug events and associated > prototypes. > > Signed-off-by: Eric DeVolder > --- > include/linux/kexec.h | 21

Re: [PATCH v2 0/5] kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef

2022-01-19 Thread Baoquan He
On 01/18/22 at 10:13pm, Jisheng Zhang wrote: > On Sun, Jan 16, 2022 at 09:38:47PM +0800, Baoquan He wrote: > > Hi Jisheng, > > Hi Baoquan, > > > > > On 12/07/21 at 12:05am, Jisheng Zhang wrote: > > > Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" > > > by a check for