Please backport commit a449dfbfc089 (PM: sleep: Avoid using pr_cont() in the tasks freezing code)

From: Paul Menzel
Date: Mon Feb 27 2023 - 07:44:27 EST


Dear Linux folks,


It’d be great if you could apply the commit below [1], present in Linux since 6.2-rc1, to at least the Linux 6.1 LTS series.

commit a449dfbfc0894676ad0aa1873383265047529e3a
Author: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Date: Thu Dec 1 19:33:09 2022 +0100

PM: sleep: Avoid using pr_cont() in the tasks freezing code

Using pr_cont() in the tasks freezing code related to system-wide
suspend and hibernation is problematic, because the continuation
messages printed there are susceptible to interspersing with other
unrelated messages which results in output that is hard to
understand.

Address this issue by modifying try_to_freeze_tasks() to print
messages that don't require continuations and adjusting its
callers accordingly.

Reported-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

On a Dell Precision 3540, Linux 6.1.12 from Debian sid/unstable logs the stray warning below:

$ sudo dmesg --level=warn | grep elapsed
[ 3063.289579] (elapsed 0.047 seconds) done.

It’s due to `pr_cont` usage, and the another (DRM) log message adds the unexpected newline character, splitting the message:

[ 0.000000] Linux version 6.1.0-5-amd64 (debian-kernel@xxxxxxxxxxxxxxxx) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.12-1 (2023-02-15)
[…]
[ 0.000000] DMI: Dell Inc. Precision 3540/0M14W7, BIOS 1.23.0 12/19/2022
[…]
[ 3063.241846] Freezing user space processes ...
[ 3063.281999] [drm] VCE initialized successfully.
[ 3063.289579] (elapsed 0.047 seconds) done.

Backporting the patch would change the log messages a little though. No idea, if that is acceptable for commit for stable series.


Kind regards,

Paul


[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a449dfbfc0894676ad0aa1873383265047529e3a