summaryrefslogtreecommitdiffstats
path: root/kernel/power/snapshot.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-09-25 23:32:44 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:48:58 -0700
commit546e0d271941dd1ff6961e2a1f7eac75f1fc277e (patch)
tree60c74a9598f7cb4622c1b6acd25df5df67284353 /kernel/power/snapshot.c
parent8c002494b55119a3fd1dddee83b4fb75cfda47e5 (diff)
downloadtalos-obmc-linux-546e0d271941dd1ff6961e2a1f7eac75f1fc277e.tar.gz
talos-obmc-linux-546e0d271941dd1ff6961e2a1f7eac75f1fc277e.zip
[PATCH] swsusp: read speedup
Implement async reads for swsusp resuming. Crufty old PIII testbox: 15.7 MB/s -> 20.3 MB/s Sony Vaio: 14.6 MB/s -> 33.3 MB/s I didn't implement the post-resume bio_set_pages_dirty(). I don't really understand why resume needs to run set_page_dirty() against these pages. It might be a worry that this code modifies PG_Uptodate, PG_Error and PG_Locked against the image pages. Can this possibly affect the resumed-into kernel? Hopefully not, if we're atomically restoring its mem_map? Cc: Pavel Machek <pavel@ucw.cz> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Jens Axboe <axboe@suse.de> Cc: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r--kernel/power/snapshot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 75d4886e648e..591301ae8b7d 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -314,7 +314,7 @@ static unsigned int unsafe_pages;
* and we count them using unsafe_pages
*/
-static inline void *alloc_image_page(gfp_t gfp_mask, int safe_needed)
+static void *alloc_image_page(gfp_t gfp_mask, int safe_needed)
{
void *res;
@@ -828,13 +828,16 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count)
}
if (!handle->offset)
handle->buffer = buffer;
+ handle->sync_read = 1;
if (handle->prev < handle->page) {
if (!handle->prev) {
- error = load_header(handle, (struct swsusp_info *)buffer);
+ error = load_header(handle,
+ (struct swsusp_info *)buffer);
if (error)
return error;
} else if (handle->prev <= nr_meta_pages) {
- handle->pbe = unpack_orig_addresses(buffer, handle->pbe);
+ handle->pbe = unpack_orig_addresses(buffer,
+ handle->pbe);
if (!handle->pbe) {
error = prepare_image(handle);
if (error)
@@ -842,10 +845,12 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count)
handle->pbe = pagedir_nosave;
handle->last_pbe = NULL;
handle->buffer = get_buffer(handle);
+ handle->sync_read = 0;
}
} else {
handle->pbe = handle->pbe->next;
handle->buffer = get_buffer(handle);
+ handle->sync_read = 0;
}
handle->prev = handle->page;
}
OpenPOWER on IntegriCloud