diff mbox

[1/6] power: hibernate: Use separate messages for "Syncing filesystems"

Message ID 1664a8ea72b34db4bef860004166875ab70898ee.1433442778.git.joe@perches.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Joe Perches June 4, 2015, 6:36 p.m. UTC
Add the ability to see how long it takes to sync the filesystems
via the printk time mechanism.

Start to standardize the printk "PM: doing something...done"
messages on two separate lines.

Signed-off-by: Joe Perches <joe@perches.com>
---
 kernel/power/hibernate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Joe Perches June 8, 2015, 11:23 p.m. UTC | #1
On Tue, 2015-06-09 at 01:35 +0200, Rafael J. Wysocki wrote:
> On Thursday, June 04, 2015 11:36:44 AM Joe Perches wrote:
> > Add the ability to see how long it takes to sync the filesystems
> > via the printk time mechanism.
> > 
> > Start to standardize the printk "PM: doing something...done"
> > messages on two separate lines.
> 
> Well, it would be good to say what problem this is attempting to fix.
> 
> And while I understand the underlying concern, there is a merit in keeping
> each of these messages in one line (if everything goes well), so I'm wondering
> what about printing each of them in one go after the operation with a tail
> depending on the result?  Like
> 
> printk(KERN_INFO "PM: Syncing filesystems ... done\n");
> 
> on success or
> 
> printk(KERN_INFO "PM: Syncing filesystems ... failed\n");
> 
> on failure?

Maybe.

I believe there are multi-second delays possible when
syncing the filesystems on things like usb memory sticks.

I think the dmesg line count here isn't particularly important
and there's some small value in consistently presenting timing
information via dmesg timestamps when using 2 lines.

There's also some small value in patch 6/6 and the consistent
prefixing of "PM: " on all these messages.


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki June 8, 2015, 11:35 p.m. UTC | #2
On Thursday, June 04, 2015 11:36:44 AM Joe Perches wrote:
> Add the ability to see how long it takes to sync the filesystems
> via the printk time mechanism.
> 
> Start to standardize the printk "PM: doing something...done"
> messages on two separate lines.

Well, it would be good to say what problem this is attempting to fix.

And while I understand the underlying concern, there is a merit in keeping
each of these messages in one line (if everything goes well), so I'm wondering
what about printing each of them in one go after the operation with a tail
depending on the result?  Like

printk(KERN_INFO "PM: Syncing filesystems ... done\n");

on success or

printk(KERN_INFO "PM: Syncing filesystems ... failed\n");

on failure?


> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  kernel/power/hibernate.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 2329daa..2466d78 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -663,9 +663,9 @@ int hibernate(void)
>  	if (error)
>  		goto Exit;
>  
> -	printk(KERN_INFO "PM: Syncing filesystems ... ");
> +	printk(KERN_INFO "PM: Syncing filesystems ...\n");
>  	sys_sync();
> -	printk("done.\n");
> +	printk(KERN_INFO "PM: Syncing filesystems: done\n");
>  
>  	error = freeze_processes();
>  	if (error)
>
Pavel Machek June 9, 2015, 9:20 a.m. UTC | #3
On Mon 2015-06-08 16:23:24, Joe Perches wrote:
> On Tue, 2015-06-09 at 01:35 +0200, Rafael J. Wysocki wrote:
> > On Thursday, June 04, 2015 11:36:44 AM Joe Perches wrote:
> > > Add the ability to see how long it takes to sync the filesystems
> > > via the printk time mechanism.
> > > 
> > > Start to standardize the printk "PM: doing something...done"
> > > messages on two separate lines.
> > 
> > Well, it would be good to say what problem this is attempting to fix.
> > 
> > And while I understand the underlying concern, there is a merit in keeping
> > each of these messages in one line (if everything goes well), so I'm wondering
> > what about printing each of them in one go after the operation with a tail
> > depending on the result?  Like
> > 
> > printk(KERN_INFO "PM: Syncing filesystems ... done\n");
> > 
> > on success or
> > 
> > printk(KERN_INFO "PM: Syncing filesystems ... failed\n");
> > 
> > on failure?
> 
> Maybe.
> 
> I believe there are multi-second delays possible when
> syncing the filesystems on things like usb memory sticks.
> 
> I think the dmesg line count here isn't particularly important
> and there's some small value in consistently presenting timing
> information via dmesg timestamps when using 2 lines.

Hibernation is little special here, because that's what user actually
sees, and because message interleaving is extremely unlikely there.

Unless you have a real problem with this, just let it be.
									Pavel
diff mbox

Patch

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 2329daa..2466d78 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -663,9 +663,9 @@  int hibernate(void)
 	if (error)
 		goto Exit;
 
-	printk(KERN_INFO "PM: Syncing filesystems ... ");
+	printk(KERN_INFO "PM: Syncing filesystems ...\n");
 	sys_sync();
-	printk("done.\n");
+	printk(KERN_INFO "PM: Syncing filesystems: done\n");
 
 	error = freeze_processes();
 	if (error)