Messages in this thread | | | Date | Tue, 1 Jun 2021 16:25:59 +0200 | From | Petr Mladek <> | Subject | Re: [PATCH next v1 2/2] nmi_backtrace: use the printk cpu lock for show_regs() |
| |
On Mon 2021-05-31 18:20:51, John Ogness wrote: > dump_stack() uses the printk cpu lock to synchronize the stacktrace, > but this can also be used for dumping the banner and regs. > > Since the cpu lock allows recursive locking, it is not an issue to > call dump_stack() with the printk cpu lock held.
This does not explain why it is serialized only in nmi_cpu_backtrace().
It would be better to serialize all show_regs() calls. But it would require updating all the arch-specific implementations.
I know that this patch is a pre-requisite for another patchset removing printk_safe(). Where printk_safe() is serializing the backtraces from all CPUs at the moment.
IMHO, it is perfectly fine synchronize only nmi_cpu_backtrace() for now. It is the most important use-case where show_regs() calls could get messed easily. But I suggest to do it in the patchset removing printk_safe(). Also we need to explain in the commit message the relation to printk_safe().
Best Regards, Petr
| |