swsusp: use non-contiguous memory
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 44 lines
The following set of patches is designed to fix a problem in the current implementation of swsusp in mainline kernels. Namely, swsusp uses an array of page backup entries (aka pagedir) to store pointers to memory pages that must be saved during suspend and restored during resume.
Unfortunately, the pagedir has to be located in a contiguous chunk of memory and it sometimes turns out that an 8-order or even 9-order allocation is needed for this purpose. It sometimes is impossible to get such an allocation and swsusp may fail during either suspend or resume due to the lack of memory, although theoretically there is enough free memory for it to succeed.
Moreover, swsusp is more likely to fail for this reason during resume, which means that it may fail during resume after a successful suspend (this actually has happened for some people, including me :-)) and this, potentially, may lead to the loss of data.
The problem is fixed by replacing the pagedir with a linklist so that high-order memory allocations are avoided (the patches make swsusp use only 0-order allocations). Unfortunately this means that it's necessary to change assembly routines used to restore the image after it's been loaded from swap so that they walk the list instead of walking the array.
The patches are organized in the following way:
[1] suspend part
This patch makes swsusp allocate only individual pages during suspend. It does not require any changes to assembly routines and is architecture-independent.
It has been present in the -mm kernels for some time.
It contains some additional clean-ups and fixes from Pavel Machek and Adrian Bunk.[2] main resume part (core, i386, x86-64)
This patch makes swsusp allocate only individual pages during resume. It contains the necessary changes to the assembly routines etc. for i386 and x86-64.
It depends on the suspend part.[3] resume part - ppc support
This patch contains the necessary changes to the assembly routines etc. for ppc.
It depends on the main resume part.
It's a Hu Gang's patch.
Quoted 3 lines
The patches are against 2.6.11.
Well, I hope I did it right. ;-) Please consider for applying.
Wow, very nice summary. ACK on all 3 patches...
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!