diff options
author | Andrew Morton <akpm@osdl.org> | 2006-09-26 02:32:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:58 -0400 |
commit | 546e0d271941dd1ff6961e2a1f7eac75f1fc277e (patch) | |
tree | 60c74a9598f7cb4622c1b6acd25df5df67284353 /kernel/power/snapshot.c | |
parent | 8c002494b55119a3fd1dddee83b4fb75cfda47e5 (diff) |
[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.c | 11 |
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; | |||
314 | * and we count them using unsafe_pages | 314 | * and we count them using unsafe_pages |
315 | */ | 315 | */ |
316 | 316 | ||
317 | static inline void *alloc_image_page(gfp_t gfp_mask, int safe_needed) | 317 | static void *alloc_image_page(gfp_t gfp_mask, int safe_needed) |
318 | { | 318 | { |
319 | void *res; | 319 | void *res; |
320 | 320 | ||
@@ -828,13 +828,16 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count) | |||
828 | } | 828 | } |
829 | if (!handle->offset) | 829 | if (!handle->offset) |
830 | handle->buffer = buffer; | 830 | handle->buffer = buffer; |
831 | handle->sync_read = 1; | ||
831 | if (handle->prev < handle->page) { | 832 | if (handle->prev < handle->page) { |
832 | if (!handle->prev) { | 833 | if (!handle->prev) { |
833 | error = load_header(handle, (struct swsusp_info *)buffer); | 834 | error = load_header(handle, |
835 | (struct swsusp_info *)buffer); | ||
834 | if (error) | 836 | if (error) |
835 | return error; | 837 | return error; |
836 | } else if (handle->prev <= nr_meta_pages) { | 838 | } else if (handle->prev <= nr_meta_pages) { |
837 | handle->pbe = unpack_orig_addresses(buffer, handle->pbe); | 839 | handle->pbe = unpack_orig_addresses(buffer, |
840 | handle->pbe); | ||
838 | if (!handle->pbe) { | 841 | if (!handle->pbe) { |
839 | error = prepare_image(handle); | 842 | error = prepare_image(handle); |
840 | if (error) | 843 | if (error) |
@@ -842,10 +845,12 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count) | |||
842 | handle->pbe = pagedir_nosave; | 845 | handle->pbe = pagedir_nosave; |
843 | handle->last_pbe = NULL; | 846 | handle->last_pbe = NULL; |
844 | handle->buffer = get_buffer(handle); | 847 | handle->buffer = get_buffer(handle); |
848 | handle->sync_read = 0; | ||
845 | } | 849 | } |
846 | } else { | 850 | } else { |
847 | handle->pbe = handle->pbe->next; | 851 | handle->pbe = handle->pbe->next; |
848 | handle->buffer = get_buffer(handle); | 852 | handle->buffer = get_buffer(handle); |
853 | handle->sync_read = 0; | ||
849 | } | 854 | } |
850 | handle->prev = handle->page; | 855 | handle->prev = handle->page; |
851 | } | 856 | } |