Re: [PATCH]: Compress hibernation image with LZO (in-kernel)

From: Nigel Cunningham
Date: Tue Aug 03 2010 - 21:50:49 EST


Hi.

Sorry for the delay in replying.

On 03/08/10 11:59, Bojan Smojver wrote:
From all this, I only got "In swsusp_free()" printed on resume. So, it
seems that save_image() does indeed free those vmalloc()-ed buffers and
they are not saved in the image.

I even put this in hibernate.c:
---------------------
/* Restore control flow magically appears here */
restore_processor_state();
if (!in_suspend)
platform_leave(platform_mode);

printk(KERN_ERR "Resumed, checking swsusp_lzo_buffers.\n");
if (swsusp_lzo_buffers) {
printk (KERN_ERR "Setting vmalloc() buffers.\n");
memset(swsusp_lzo_buffers, 0, 80 * PAGE_SIZE);
}
---------------------

This printed just "Resumed, checking swsusp_lzo_buffers.", meaning it
was already set to NULL.

Any further comments on this? Nigel, what do you reckon?

I don't see what all the fuss was about. save_image is called after the snapshot is made (hibernate called hibernation_snapshot to create the image, then swsusp_write which in turn calls save_image), so there's no possibility of the memory allocated by it being included in the image or of a memory leak ocuring as a result.

Regards,

Nigel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/