* [PATCH] kernel/power/swap.c: print the speed of compressed image instead of uncompressed one
@ 2014-01-27 5:59 Barry Song
0 siblings, 0 replies; only message in thread
From: Barry Song @ 2014-01-27 5:59 UTC (permalink / raw)
To: len.brown, pavel, rjw
Cc: linux-pm, linux-kernel, workgroup.linux, Barry Song, Bin Shi
From: Barry Song <Baohua.Song@csr.com>
For users of hibernation, people care more about the size of the compressed
image than uncompressed one. as embedded guys will try to improve the speed
of SD, NAND and do the best to shrink memory to make the image as less as
possible.
so printing the speed of compressed image is more important and making more
senses here.
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Bin Shi <Bin.Shi@csr.com>
---
kernel/power/swap.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 7c33ed2..bcb5c51 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -587,6 +587,7 @@ static int save_image_lzo(struct swap_map_handle *handle,
unsigned char *page = NULL;
struct cmp_data *data = NULL;
struct crc_data *crc = NULL;
+ unsigned int nr_cmp_written = 0;
/*
* We'll limit the number of threads for compression to limit memory
@@ -747,6 +748,8 @@ static int save_image_lzo(struct swap_map_handle *handle,
off += PAGE_SIZE) {
memcpy(page, data[thr].cmp + off, PAGE_SIZE);
+ nr_cmp_written++;
+
ret = swap_write_page(handle, page, &bio);
if (ret)
goto out_finish;
@@ -764,7 +767,11 @@ out_finish:
ret = err2;
if (!ret)
printk(KERN_INFO "PM: Image saving done.\n");
- swsusp_show_speed(&start, &stop, nr_to_write, "Wrote");
+
+ printk(KERN_INFO "PM: Saved %lu Kbytes (uncompressed Image)\n",
+ nr_to_write * (PAGE_SIZE / 1024));
+ swsusp_show_speed(&start, &stop, nr_cmp_written, "Wrote compressed");
+
out_clean:
if (crc) {
if (crc->thr)
--
1.7.5.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-27 6:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-27 5:59 [PATCH] kernel/power/swap.c: print the speed of compressed image instead of uncompressed one Barry Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®