linux/kernel/power
Rafael J. Wysocki 8357376d3d [PATCH] swsusp: Improve handling of highmem
Currently swsusp saves the contents of highmem pages by copying them to the
normal zone which is quite inefficient (eg.  it requires two normal pages
to be used for saving one highmem page).  This may be improved by using
highmem for saving the contents of saveable highmem pages.

Namely, during the suspend phase of the suspend-resume cycle we try to
allocate as many free highmem pages as there are saveable highmem pages.
If there are not enough highmem image pages to store the contents of all of
the saveable highmem pages, some of them will be stored in the "normal"
memory.  Next, we allocate as many free "normal" pages as needed to store
the (remaining) image data.  We use a memory bitmap to mark the allocated
free pages (ie.  highmem as well as "normal" image pages).

Now, we use another memory bitmap to mark all of the saveable pages
(highmem as well as "normal") and the contents of the saveable pages are
copied into the image pages.  Then, the second bitmap is used to save the
pfns corresponding to the saveable pages and the first one is used to save
their data.

During the resume phase the pfns of the pages that were saveable during the
suspend are loaded from the image and used to mark the "unsafe" page
frames.  Next, we try to allocate as many free highmem page frames as to
load all of the image data that had been in the highmem before the suspend
and we allocate so many free "normal" page frames that the total number of
allocated free pages (highmem and "normal") is equal to the size of the
image.  While doing this we have to make sure that there will be some extra
free "normal" and "safe" page frames for two lists of PBEs constructed
later.

Now, the image data are loaded, if possible, into their "original" page
frames.  The image data that cannot be written into their "original" page
frames are loaded into "safe" page frames and their "original" kernel
virtual addresses, as well as the addresses of the "safe" pages containing
their copies, are stored in one of two lists of PBEs.

One list of PBEs is for the copies of "normal" suspend pages (ie.  "normal"
pages that were saveable during the suspend) and it is used in the same way
as previously (ie.  by the architecture-dependent parts of swsusp).  The
other list of PBEs is for the copies of highmem suspend pages.  The pages
in this list are restored (in a reversible way) right before the
arch-dependent code is called.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:27 -08:00
..
console.c [PATCH] Fix build failure in recent pm_prepare_* changes. 2006-02-07 16:12:33 -08:00
disk.c [PATCH] swsusp: add resume_offset command line parameter 2006-12-07 08:39:27 -08:00
Kconfig Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6 2006-09-26 11:49:46 -07:00
main.c [PATCH] PM: Add pm_trace switch 2006-09-26 08:49:04 -07:00
Makefile [PATCH] Disable CPU hotplug during suspend 2006-09-26 08:48:59 -07:00
pm.c [PATCH] remove kernel/power/pm.c:pm_unregister_all() 2006-07-12 16:09:08 -07:00
power.h [PATCH] swsusp: Improve handling of highmem 2006-12-07 08:39:27 -08:00
poweroff.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
process.c [PATCH] Make suspend possible with a traced process at a breakpoint 2006-08-06 08:57:45 -07:00
snapshot.c [PATCH] swsusp: Improve handling of highmem 2006-12-07 08:39:27 -08:00
swap.c [PATCH] swsusp: Improve handling of highmem 2006-12-07 08:39:27 -08:00
swsusp.c [PATCH] swsusp: Improve handling of highmem 2006-12-07 08:39:27 -08:00
user.c [PATCH] swsusp: Improve handling of highmem 2006-12-07 08:39:27 -08:00