On Fri, 2006-03-17 at 14:59 +0800, Pavel Machek wrote: > On Pá 17-03-06 09:12:15, Shaohua Li wrote: > > On Thu, 2006-03-16 at 07:08 +0800, Pavel Machek wrote: > > > On Thu 16-03-06 11:53:27, Shaohua Li wrote: > > > > I thought there was a discussion before, but I still saw many > pages > > > like > > > > BIOS reserved are saved/restored in swsusp. Pages reserved by > BIOS, > > > not > > > > used by OS and kernel text should be skipped in swsusp to me. > Below > > > > patch works in my test. Any thought? > > > > > > This will need quite a lot of testing. > > > > > > Does it actually fix anything? > > No, it doesn't. Just want to speed up swsusp. > > > > > I'm afraid that some of the BIOSs state is actually shared > knowledge > > > with kernel, and that we should better save it, so that kernel's > and > > > BIOS's view are consistent after resume. > > Fair enough. ACPI BIOS does communicate with OS by reserved memory. > But > > in the mean time, blindly save/restore such mem might be dangerous. > If > > all ACPI devices have their suspend/resume method, reserved memory > > should not be saved. > > Ok, I guess it is okay to go in if it stays in -mm for long enough to > get a lot of testing. I'll do more tests and back to you. BTW, I wonder if BIOS already saved reserved memory (those doing communication with OS) in the 'platform' method of S4. > > Anyway, skipping kernel text should be safe, isn't it? > > It probably is. But you need to save modules. I just consider the region from kernel start(1M) to the end of rodata. In my test, the region is about 4M memory. Just adding several lines to save 4M memory is worthy. > And we do use some > self-modifying code these days, no? (Called runtime patching or > something like that.) Alternative instructions? The resume OS will do the same modification anyway. > Ouch and IIRC top-level pagedir or something > like that lives in kernel "text" -- it is in assembly and wrongly > placed. i386 does the right thing and put the pagedir in data segment. x86_64 not, I think we could clean it up. Thanks, Shaohua