Re: [PATCH v3] softlockup: serialized softlockup's log

From: Doug Anderson
Date: Mon Nov 27 2023 - 16:48:19 EST


Hi,

On Thu, Nov 23, 2023 at 12:41 AM <lizhe.67@xxxxxxxxxxxxx> wrote:
>
> From: Li Zhe <lizhe.67@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxx>
> ---
> Changelogs:
>
> v1->v2:
> - define the lock outside the scope of function
> - add precondition 'softlockup_all_cpu_backtrace=0' in commit message
>
> v2->v3:
> - define the lock inside the scope of function
>
> kernel/watchdog.c | 3 +++
> 1 file changed, 3 insertions(+)

Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>