Messages in this thread | | | Date | Mon, 27 Nov 2023 18:32:23 +0100 | From | Petr Mladek <> | Subject | Re: [PATCH v3] softlockup: serialized softlockup's log |
| |
On Thu 2023-11-23 16:40:22, lizhe.67@bytedance.com wrote: > From: Li Zhe <lizhe.67@bytedance.com> > > If multiple CPUs trigger softlockup at the same time with > 'softlockup_all_cpu_backtrace=0', the softlockup's logs will appear > staggeredly in dmesg, which will affect the viewing of the logs for > developer. Since the code path for outputting softlockup logs is not > a kernel hotspot and the performance requirements for the code are > not strict, locks are used to serialize the softlockup log output to > improve the readability of the logs. > > Signed-off-by: Li Zhe <lizhe.67@bytedance.com>
I do not feel fully comfortable with adding a lock into a code path which reports system lockups. There might already be a deadlock on the system and yet another lock would not make things easier.
On the other hand, the added spinlock looks pretty safe:
+ It synchronizes only watchdog_timer_fn() calls against each other. watchdog_timer_fn() could not be nested.
+ The locked code seems to be synchronized only by RCU and does not wait for other CPUs to finish something.
I haven't found any real deadlock scenario. Feel free to use:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards, Petr
| |