Re: [PATCH v2 1/2] hung_task: Consolidate hung task warning into an atomic log block

From: Greg KH

Date: Thu Dec 11 2025 - 03:02:18 EST


On Wed, Dec 10, 2025 at 10:30:03PM -0500, Aaron Tomlin wrote:
> Consolidate the multi-line console output in check_hung_task() into a new
> helper function, hung_task_diagnostics().
>
> This patch ensures the entire diagnostic block (task info, kernel
> version, and sysctl advice) is logged to the ring buffer via a single
> pr_err() call. This is critical in a concurrent environment to prevent
> message lines from interleaving with other CPU activity, thus
> maintaining contextual integrity of the warning message.

If this message is "critical", then it should not be going through the
syslog as that is NOT a "critical" way to communicate things to
userspace.

What is currently breaking today with the multi-line message that you
have? Why is this so much more special than the normal oops / warning /
oom and other type messages that are multi-lines today?

I'm all for moving this to a single function, but I'm not ok with
multi-line messages in one pr_err() call like this, sorry.

Especially one that contains a "here is how to disable this" message
like this one does, that surely is NOT a "critical" thing.

thanks,

greg k-h