[PATCH v2] PM: thaw_processes: Rewrite restarting tasks log to remove stray *done.*

Paul Menzel posted 1 patch 7 months, 1 week ago
kernel/power/process.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH v2] PM: thaw_processes: Rewrite restarting tasks log to remove stray *done.*
Posted by Paul Menzel 7 months, 1 week ago
`pr_cont()` unfortunately does not work here, as other parts of the
Linux kernel log between the two log lines:

    [18445.295056] r8152-cfgselector 4-1.1.3: USB disconnect, device number 5
    [18445.295112] OOM killer enabled.
    [18445.295115] Restarting tasks ...
    [18445.295185] usb 3-1: USB disconnect, device number 2
    [18445.295193] usb 3-1.1: USB disconnect, device number 3
    [18445.296262] usb 3-1.5: USB disconnect, device number 4
    [18445.297017] done.
    [18445.297029] random: crng reseeded on system resumption

`pr_cont()` also uses the default log level, normally warning, if the
corresponding log line is interrupted.

Therefore, replace the `pr_cont()`, and explicitly log it as a separate
line with log level info:

    Restarting tasks: Starting
    […]
    Restarting tasks: Done

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
 kernel/power/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index 66ac067d9ae6..1938fafa9172 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -189,7 +189,7 @@ void thaw_processes(void)
 
 	oom_killer_enable();
 
-	pr_info("Restarting tasks ... ");
+	pr_info("Restarting tasks: Starting\n");
 
 	__usermodehelper_set_disable_depth(UMH_FREEZING);
 	thaw_workqueues();
@@ -208,7 +208,7 @@ void thaw_processes(void)
 	usermodehelper_enable();
 
 	schedule();
-	pr_cont("done.\n");
+	pr_info("Restarting tasks: Done\n");
 	trace_suspend_resume(TPS("thaw_processes"), 0, false);
 }
 
-- 
2.49.0

Re: [PATCH v2] PM: thaw_processes: Rewrite restarting tasks log to remove stray *done.*
Posted by Paul Menzel 7 months, 1 week ago
[add change-log]

Am 11.05.25 um 19:46 schrieb Paul Menzel:
> `pr_cont()` unfortunately does not work here, as other parts of the
> Linux kernel log between the two log lines:
> 
>      [18445.295056] r8152-cfgselector 4-1.1.3: USB disconnect, device number 5
>      [18445.295112] OOM killer enabled.
>      [18445.295115] Restarting tasks ...
>      [18445.295185] usb 3-1: USB disconnect, device number 2
>      [18445.295193] usb 3-1.1: USB disconnect, device number 3
>      [18445.296262] usb 3-1.5: USB disconnect, device number 4
>      [18445.297017] done.
>      [18445.297029] random: crng reseeded on system resumption
> 
> `pr_cont()` also uses the default log level, normally warning, if the
> corresponding log line is interrupted.
> 
> Therefore, replace the `pr_cont()`, and explicitly log it as a separate
> line with log level info:
> 
>      Restarting tasks: Starting
>      […]
>      Restarting tasks: Done
> 
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---

v2: Use log message texts suggested by Rafael.

>   kernel/power/process.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index 66ac067d9ae6..1938fafa9172 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -189,7 +189,7 @@ void thaw_processes(void)
>   
>   	oom_killer_enable();
>   
> -	pr_info("Restarting tasks ... ");
> +	pr_info("Restarting tasks: Starting\n");
>   
>   	__usermodehelper_set_disable_depth(UMH_FREEZING);
>   	thaw_workqueues();
> @@ -208,7 +208,7 @@ void thaw_processes(void)
>   	usermodehelper_enable();
>   
>   	schedule();
> -	pr_cont("done.\n");
> +	pr_info("Restarting tasks: Done\n");
>   	trace_suspend_resume(TPS("thaw_processes"), 0, false);
>   }
>   
Re: [PATCH v2] PM: thaw_processes: Rewrite restarting tasks log to remove stray *done.*
Posted by Rafael J. Wysocki 7 months ago
On Mon, May 12, 2025 at 4:48 PM Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>
> [add change-log]
>
> Am 11.05.25 um 19:46 schrieb Paul Menzel:
> > `pr_cont()` unfortunately does not work here, as other parts of the
> > Linux kernel log between the two log lines:
> >
> >      [18445.295056] r8152-cfgselector 4-1.1.3: USB disconnect, device number 5
> >      [18445.295112] OOM killer enabled.
> >      [18445.295115] Restarting tasks ...
> >      [18445.295185] usb 3-1: USB disconnect, device number 2
> >      [18445.295193] usb 3-1.1: USB disconnect, device number 3
> >      [18445.296262] usb 3-1.5: USB disconnect, device number 4
> >      [18445.297017] done.
> >      [18445.297029] random: crng reseeded on system resumption
> >
> > `pr_cont()` also uses the default log level, normally warning, if the
> > corresponding log line is interrupted.
> >
> > Therefore, replace the `pr_cont()`, and explicitly log it as a separate
> > line with log level info:
> >
> >      Restarting tasks: Starting
> >      […]
> >      Restarting tasks: Done
> >
> > Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> > ---
>
> v2: Use log message texts suggested by Rafael.
>
> >   kernel/power/process.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/power/process.c b/kernel/power/process.c
> > index 66ac067d9ae6..1938fafa9172 100644
> > --- a/kernel/power/process.c
> > +++ b/kernel/power/process.c
> > @@ -189,7 +189,7 @@ void thaw_processes(void)
> >
> >       oom_killer_enable();
> >
> > -     pr_info("Restarting tasks ... ");
> > +     pr_info("Restarting tasks: Starting\n");
> >
> >       __usermodehelper_set_disable_depth(UMH_FREEZING);
> >       thaw_workqueues();
> > @@ -208,7 +208,7 @@ void thaw_processes(void)
> >       usermodehelper_enable();
> >
> >       schedule();
> > -     pr_cont("done.\n");
> > +     pr_info("Restarting tasks: Done\n");
> >       trace_suspend_resume(TPS("thaw_processes"), 0, false);
> >   }
> >

An analogous change, which I have forgotten about, has been made
already in this cycle, but I prefer the way the messages look after
your changes, so I've rebased your patch on top of the other one and
applied it for 6.16.

Thanks!