diff mbox series

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

Message ID 20250511174648.950430-1-pmenzel@molgen.mpg.de
State New
Headers show
Series [v2] PM: thaw_processes: Rewrite restarting tasks log to remove stray *done.* | expand

Commit Message

Paul Menzel May 11, 2025, 5:46 p.m. UTC
`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(-)

Comments

Paul Menzel May 12, 2025, 2:48 p.m. UTC | #1
[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);
>   }
>
Rafael J. Wysocki May 16, 2025, 8:25 p.m. UTC | #2
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!
diff mbox series

Patch

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);
 }