* [PATCH V3 00/11] The panic notifiers refactor - fixes/clean-ups (V3)
@ 2022-08-19 22:17 Guilherme G. Piccoli
2022-08-19 22:17 ` [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering Guilherme G. Piccoli
0 siblings, 1 reply; 5+ messages in thread
From: Guilherme G. Piccoli @ 2022-08-19 22:17 UTC (permalink / raw)
To: akpm, bhe, pmladek, kexec
Cc: linux-kernel, linux-hyperv, netdev, x86, kernel-dev, kernel,
halves, fabiomirmar, alejandro.j.jimenez, andriy.shevchenko, arnd,
bp, corbet, d.hatayama, dave.hansen, dyoung, feng.tang, gregkh,
mikelley, hidehiro.kawai.ez, jgross, john.ogness, keescook, luto,
mhiramat, mingo, paulmck, peterz, rostedt, senozhatsky, stern,
tglx, vgoyal, vkuznets, will, xuqiang36, Guilherme G. Piccoli,
bcm-kernel-feedback-list, linux-alpha, linux-arm-kernel,
linux-edac, linux-efi, linux-parisc, linux-um
Hey everybody, this the third iteration of the panic notifiers
fixes/clean-ups;
V2 available at:
https://lore.kernel.org/lkml/20220719195325.402745-1-gpiccoli@igalia.com/
V1 (including the refactor) available at:
https://lore.kernel.org/lkml/20220427224924.592546-1-gpiccoli@igalia.com/
There wasn't much change here compared to V2 (the specifics are in the
patches), but a global change is that I've rebased against 6.0-rc1.
One patch got merged in -next, another one was re-submit in a standalone
format (requested by maintainer), so both of these are not here anymore.
As usual, tested this series building for all affected architecture/drivers
and also through some boot/runtime tests; below the test "matrix" used:
Build tests (using cross-compilers): alpha, arm, arm64, parisc, um, x86_64.
Boot/Runtime tests: x86_64 (QEMU guests and Steam Deck).
Here is the link with the .config files used:
https://people.igalia.com/gpiccoli/panic_notifiers_configs/6.0-rc1/
About the merge strategy: I've noticed there is a difference in maintainers
preferences (and my preference as well), so I see 3 strategies for merge:
(a) Maintainers pick patches that are good from the series and merge in
their trees;
(b) Some maintainer would pick the whole series and merge, at once, given
that everything is fine/ack/reviewed.
(c) I must re-send patches individually once they are reviewed/acked, as
standalone patches to the relevant maintainers, so they can merge it in
their trees.
I'm willing to do what's best for everybody - (a) is my choice when possible,
(b) seems to stall things and potentially cause conflicts, (c) seems to be
the compromise. I'll do that as per preference of the respective maintainers.
As usual, reviews / comments are always welcome, thanks in advance for them!
Cheers,
Guilherme
Guilherme G. Piccoli (11):
ARM: Disable FIQs (but not IRQs) on CPUs shutdown paths
notifier: Add panic notifiers info and purge trailing whitespaces
alpha: Clean-up the panic notifier code
um: Improve panic notifiers consistency and ordering
parisc: Replace regular spinlock with spin_trylock on panic path
tracing: Improve panic/die notifiers
notifiers: Add tracepoints to the notifiers infrastructure
EDAC/altera: Skip the panic notifier if kdump is loaded
video/hyperv_fb: Avoid taking busy spinlock on panic path
drivers/hv/vmbus, video/hyperv_fb: Untangle and refactor Hyper-V panic notifiers
panic: Fixes the panic_print NMI backtrace setting
arch/alpha/kernel/setup.c | 36 +++++-----
arch/arm/kernel/machine_kexec.c | 2 +
arch/arm/kernel/smp.c | 5 +-
arch/parisc/include/asm/pdc.h | 1 +
arch/parisc/kernel/firmware.c | 27 ++++++--
arch/um/drivers/mconsole_kern.c | 7 +-
arch/um/kernel/um_arch.c | 8 +--
drivers/edac/altera_edac.c | 16 +++--
drivers/hv/ring_buffer.c | 13 ++++
drivers/hv/vmbus_drv.c | 109 +++++++++++++++++++------------
drivers/parisc/power.c | 17 +++--
drivers/video/fbdev/hyperv_fb.c | 16 ++++-
include/linux/hyperv.h | 2 +
include/linux/notifier.h | 8 ++-
include/trace/events/notifiers.h | 69 +++++++++++++++++++
kernel/notifier.c | 6 ++
kernel/panic.c | 47 +++++++------
kernel/trace/trace.c | 55 ++++++++--------
18 files changed, 302 insertions(+), 142 deletions(-)
create mode 100644 include/trace/events/notifiers.h
--
2.37.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering
2022-08-19 22:17 [PATCH V3 00/11] The panic notifiers refactor - fixes/clean-ups (V3) Guilherme G. Piccoli
@ 2022-08-19 22:17 ` Guilherme G. Piccoli
2022-09-18 14:00 ` Guilherme G. Piccoli
0 siblings, 1 reply; 5+ messages in thread
From: Guilherme G. Piccoli @ 2022-08-19 22:17 UTC (permalink / raw)
To: akpm, bhe, pmladek, kexec
Cc: linux-kernel, linux-hyperv, netdev, x86, kernel-dev, kernel,
halves, fabiomirmar, alejandro.j.jimenez, andriy.shevchenko, arnd,
bp, corbet, d.hatayama, dave.hansen, dyoung, feng.tang, gregkh,
mikelley, hidehiro.kawai.ez, jgross, john.ogness, keescook, luto,
mhiramat, mingo, paulmck, peterz, rostedt, senozhatsky, stern,
tglx, vgoyal, vkuznets, will, xuqiang36, Guilherme G. Piccoli,
linux-um, Anton Ivanov, Johannes Berg, Richard Weinberger
Currently the panic notifiers from user mode linux don't follow
the convention for most of the other notifiers present in the
kernel (indentation, priority setting, numeric return).
More important, the priorities could be improved, since it's a
special case (userspace), hence we could run the notifiers earlier;
user mode linux shouldn't care much with other panic notifiers but
the ordering among the mconsole and arch notifier is important,
given that the arch one effectively triggers a core dump.
Fix that by running the mconsole notifier as the first panic
notifier, followed by the architecture one (that coredumps).
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
V3:
- No changes.
V2:
- Kept the notifier header to avoid implicit usage - thanks
Johannes for the suggestion!
---
arch/um/drivers/mconsole_kern.c | 7 +++----
arch/um/kernel/um_arch.c | 8 ++++----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 8ca67a692683..69af3ce8407a 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -846,13 +846,12 @@ static int notify_panic(struct notifier_block *self, unsigned long unused1,
mconsole_notify(notify_socket, MCONSOLE_PANIC, message,
strlen(message) + 1);
- return 0;
+ return NOTIFY_DONE;
}
static struct notifier_block panic_exit_notifier = {
- .notifier_call = notify_panic,
- .next = NULL,
- .priority = 1
+ .notifier_call = notify_panic,
+ .priority = INT_MAX, /* run as soon as possible */
};
static int add_notifier(void)
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index e0de60e503b9..ae272878f692 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -247,13 +247,13 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,
bust_spinlocks(0);
uml_exitcode = 1;
os_dump_core();
- return 0;
+
+ return NOTIFY_DONE;
}
static struct notifier_block panic_exit_notifier = {
- .notifier_call = panic_exit,
- .next = NULL,
- .priority = 0
+ .notifier_call = panic_exit,
+ .priority = INT_MAX - 1, /* run as 2nd notifier, won't return */
};
void uml_finishsetup(void)
--
2.37.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering
2022-08-19 22:17 ` [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering Guilherme G. Piccoli
@ 2022-09-18 14:00 ` Guilherme G. Piccoli
2022-09-18 21:19 ` Richard Weinberger
0 siblings, 1 reply; 5+ messages in thread
From: Guilherme G. Piccoli @ 2022-09-18 14:00 UTC (permalink / raw)
To: Johannes Berg, linux-um
Cc: kexec, bhe, pmladek, akpm, linux-kernel, linux-hyperv, netdev,
x86, kernel-dev, kernel, halves, fabiomirmar, alejandro.j.jimenez,
andriy.shevchenko, arnd, bp, corbet, d.hatayama, dave.hansen,
dyoung, feng.tang, gregkh, mikelley, hidehiro.kawai.ez, jgross,
john.ogness, keescook, luto, mhiramat, mingo, paulmck, peterz,
rostedt, senozhatsky, stern, tglx, vgoyal, vkuznets, will,
xuqiang36, Anton Ivanov, Richard Weinberger
On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
> Currently the panic notifiers from user mode linux don't follow
> the convention for most of the other notifiers present in the
> kernel (indentation, priority setting, numeric return).
> More important, the priorities could be improved, since it's a
> special case (userspace), hence we could run the notifiers earlier;
> user mode linux shouldn't care much with other panic notifiers but
> the ordering among the mconsole and arch notifier is important,
> given that the arch one effectively triggers a core dump.
>
> Fix that by running the mconsole notifier as the first panic
> notifier, followed by the architecture one (that coredumps).
>
> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: Richard Weinberger <richard@nod.at>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
>
> V3:
> - No changes.
> [...]
Hi Johannes, sorry for the ping. Do you think you could pick this one?
Or if you prefer, I can resend it alone (not in the series) - let me
know your preference.
Thanks,
Guilherme
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering
2022-09-18 14:00 ` Guilherme G. Piccoli
@ 2022-09-18 21:19 ` Richard Weinberger
2022-09-19 11:44 ` Guilherme G. Piccoli
0 siblings, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2022-09-18 21:19 UTC (permalink / raw)
To: Guilherme G. Piccoli
Cc: Johannes Berg, linux-um, kexec, bhe, Petr Mladek, Andrew Morton,
linux-kernel, linux-hyperv, netdev, x86, kernel-dev, kernel,
halves, fabiomirmar, alejandro j jimenez, Andy Shevchenko,
Arnd Bergmann, bp, Jonathan Corbet, d hatayama, dave hansen,
dyoung, feng tang, Greg Kroah-Hartman, mikelley,
hidehiro kawai ez, jgross, John Ogness, Kees Cook,
Andy Lutomirski, mhiramat, mingo, paulmck, Peter Zijlstra,
Steven Rostedt, senozhatsky, stern, tglx, vgoyal, vkuznets, will,
xuqiang36, anton ivanov
----- Ursprüngliche Mail -----
> Von: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
> On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
>> Currently the panic notifiers from user mode linux don't follow
>> the convention for most of the other notifiers present in the
>> kernel (indentation, priority setting, numeric return).
>> More important, the priorities could be improved, since it's a
>> special case (userspace), hence we could run the notifiers earlier;
>> user mode linux shouldn't care much with other panic notifiers but
>> the ordering among the mconsole and arch notifier is important,
>> given that the arch one effectively triggers a core dump.
>>
>> Fix that by running the mconsole notifier as the first panic
>> notifier, followed by the architecture one (that coredumps).
>>
>> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>> Cc: Johannes Berg <johannes@sipsolutions.net>
>> Cc: Richard Weinberger <richard@nod.at>
>> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
>>
>> V3:
>> - No changes.
>> [...]
>
> Hi Johannes, sorry for the ping. Do you think you could pick this one?
> Or if you prefer, I can resend it alone (not in the series) - let me
> know your preference.
This patch is on my TODO list.
Just had no chance to test it.
Thanks,
//richard
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering
2022-09-18 21:19 ` Richard Weinberger
@ 2022-09-19 11:44 ` Guilherme G. Piccoli
0 siblings, 0 replies; 5+ messages in thread
From: Guilherme G. Piccoli @ 2022-09-19 11:44 UTC (permalink / raw)
To: Richard Weinberger
Cc: Johannes Berg, linux-um, kexec, bhe, Petr Mladek, Andrew Morton,
linux-kernel, linux-hyperv, netdev, x86, kernel-dev, kernel,
halves, fabiomirmar, alejandro j jimenez, Andy Shevchenko,
Arnd Bergmann, bp, Jonathan Corbet, d hatayama, dave hansen,
dyoung, feng tang, Greg Kroah-Hartman, mikelley,
hidehiro kawai ez, jgross, John Ogness, Kees Cook,
Andy Lutomirski, mhiramat, mingo, paulmck, Peter Zijlstra,
Steven Rostedt, senozhatsky, stern, tglx, vgoyal, vkuznets, will,
xuqiang36, anton ivanov
On 18/09/2022 18:19, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
>> On 19/08/2022 19:17, Guilherme G. Piccoli wrote:
>>> Currently the panic notifiers from user mode linux don't follow
>>> the convention for most of the other notifiers present in the
>>> kernel (indentation, priority setting, numeric return).
>>> More important, the priorities could be improved, since it's a
>>> special case (userspace), hence we could run the notifiers earlier;
>>> user mode linux shouldn't care much with other panic notifiers but
>>> the ordering among the mconsole and arch notifier is important,
>>> given that the arch one effectively triggers a core dump.
>>>
>>> Fix that by running the mconsole notifier as the first panic
>>> notifier, followed by the architecture one (that coredumps).
>>>
>>> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>> Cc: Johannes Berg <johannes@sipsolutions.net>
>>> Cc: Richard Weinberger <richard@nod.at>
>>> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
>>>
>>> V3:
>>> - No changes.
>>> [...]
>>
>> Hi Johannes, sorry for the ping. Do you think you could pick this one?
>> Or if you prefer, I can resend it alone (not in the series) - let me
>> know your preference.
>
> This patch is on my TODO list.
> Just had no chance to test it.
>
> Thanks,
> //richard
Thanks a lot Richard!
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-09-19 11:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-19 22:17 [PATCH V3 00/11] The panic notifiers refactor - fixes/clean-ups (V3) Guilherme G. Piccoli
2022-08-19 22:17 ` [PATCH V3 04/11] um: Improve panic notifiers consistency and ordering Guilherme G. Piccoli
2022-09-18 14:00 ` Guilherme G. Piccoli
2022-09-18 21:19 ` Richard Weinberger
2022-09-19 11:44 ` Guilherme G. Piccoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox