Thread (10 messages) 10 messages, 3 authors, 2015-07-23

Re: [RFC PATCH] PM / hibernate: make sure each resuming page is in current memory zones

From: chenyu5 <yu.c.chen@intel.com>
Date: 2015-07-02 07:56:53

Hi, Joey
thanks for your reply,

On 2015年07月02日 14:19, joeyli wrote:
Hi Chen Yu,

On Tue, Jun 30, 2015 at 11:54:28PM +0800, Chen Yu wrote:
quoted
Commit 84c91b7ae07c ("PM / hibernate: avoid unsafe pages in e820 reserved
regions") was reverted, because this patch makes resume from hibernation
on Lenovo x230 unreliable. But reverting may bring back the kernel
exception firstly reported in former patch. In general, there are three
problems in current code when resuming from hibernation:

1.Resuming page may also be in second kernel's e820 reserved region.
BIOS-e820: [mem 0x0000000069d4f000-0x0000000069e12fff] reserved
this causes kernel exception described in Commit 84c91b7ae07c
("PM / hibernate: avoid unsafe pages in e820 reserved regions")

2.If Commit 84c91b7ae07c ("PM / hibernate: avoid unsafe pages in e820
reserved regions") is applied to fix problem 1, and if E820_RESERVED_KERN
regions causes some regions at e820 table not page aligned,
e820_mark_nosave_regions will misjudgment the non-page aligned space to
be "hole" space and add to nosave regions, this causes resuming failed.
Refer to https://bugzilla.kernel.org/show_bug.cgi?id=96111 for detail.
Sorry for I am not fully understand why checking pfn_valid could avoid
the above 2. issue?
[Yu] According to e820_mark_nosave_regions, two kinds of e820
regions will be regarded as nosave:
a.e820.map holes between each e820entry
b.e820entry with (!E820_RAM && !E820_RESERVED_KERN)
dmesg in
https://bugzilla.kernel.org/show_bug.cgi?id=96111
shows that:

BIOS-e820: [mem 0x000000005baff000-0x00000000d684ffff] usable
reserve setup_data: [mem 0x000000009d3e0018-0x000000009d3f0057] usable
PM: Registered nosave memory: [mem 0x9d3e0000-0x9d3e0fff]

e820 map was changed by situation a, but it should not be added to
nosave list, right?

and according to saveable_page, only pages in the zone will be saved:
if (page_zone(page_ != zone)
	return NULL;

The function of is_valid_orig_page in this patch treats setup_data as
valid page, so I think this workaround issue 2.

Per my understood should waiting Yinghai Lu's patches for killing
E820_RESERVED_KERN to avoid the aligned problem.
[Yu] yes, it is a graceful solution, but I don't see that in 4.1? And
we encountered problem 3 in our testing enviroment, so I wrote a patch
to deal with it first.

Thanks a lot!
Joey Lee
Best Regards,
Yu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help