From 1b071d7958cb933cf99fbbe565fd33dbdd626a4d Mon Sep 17 00:00:00 2001 From: KOSAKI Motohiro Date: Mon, 15 Feb 2044 10:34:37 +0900 Subject: [PATCH] debug messages Signed-off-by: KOSAKI Motohiro --- kernel/power/snapshot.c | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 5e7edfb..c864806 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -1263,7 +1263,7 @@ int hibernate_preallocate_memory(void) struct timeval start, stop; int error; - printk(KERN_INFO "PM: Preallocating image memory... "); + printk(KERN_INFO "PM: Preallocating image memory... \n"); do_gettimeofday(&start); error = memory_bm_create(&orig_bm, GFP_IMAGE, PG_ANY); @@ -1309,6 +1309,7 @@ int hibernate_preallocate_memory(void) * in memory, allocate page frames for the image and we're done. */ if (size >= saveable) { + printk(KERN_INFO "PM: size >= saveable. skip \n"); pages = preallocate_image_highmem(save_highmem); pages += preallocate_image_memory(saveable - pages); goto out; @@ -1335,16 +1336,30 @@ int hibernate_preallocate_memory(void) * highmem and non-highmem zones separately. */ pages_highmem = preallocate_image_highmem(highmem / 2); + printk(KERN_INFO "PM: preallocate_image_highmem %lu %lu\n", + highmem, pages_highmem); + alloc = (count - max_size) - pages_highmem; pages = preallocate_image_memory(alloc); - if (pages < alloc) + printk(KERN_INFO "PM: preallocate_image_memory %lu %lu\n", + alloc, pages); + + if (pages < alloc) { + printk(KERN_INFO "PM: pages(%lu) < alloc(%lu). error. \n", + pages, alloc); goto err_out; + } size = max_size - size; alloc = size; size = preallocate_highmem_fraction(size, highmem, count); + printk(KERN_INFO "PM: preallocate_highmem_fraction %lu %lu %lu -> %lu\n", + size, highmem, count, size); + pages_highmem += size; alloc -= size; pages += preallocate_image_memory(alloc); + printk(KERN_INFO "PM: preallocate_image_memory %lu %lu\n", + alloc, pages); pages += pages_highmem; /* @@ -1352,18 +1367,20 @@ int hibernate_preallocate_memory(void) * pages in memory, but we have allocated more. Release the excessive * ones now. */ + printk(KERN_INFO "PM: free_unnecessary_pages() \n"); free_unnecessary_pages(); out: do_gettimeofday(&stop); - printk(KERN_CONT "done (allocated %lu pages)\n", pages); + printk(KERN_INFO "done (allocated %lu pages)\n", pages); swsusp_show_speed(&start, &stop, pages, "Allocated"); return 0; err_out: - printk(KERN_CONT "\n"); + printk(KERN_INFO "PM: err_out \n"); swsusp_free(); + printk(KERN_INFO "PM: swsusp_free() end \n"); return -ENOMEM; } -- 1.6.5.2