From: joeyli <jlee@suse.com>
To: "Chen, Yu C" <yu.c.chen@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"Tian, YeX" <yex.tian@intel.com>
Subject: Re: [RFC PATCH] PM / hibernate: make sure each resuming page is in current memory zones
Date: Thu, 23 Jul 2015 13:34:32 +0800 [thread overview]
Message-ID: <20150723053432.GI23137@linux-rxt1.site> (raw)
In-Reply-To: <36DF59CE26D8EE47B0655C516E9CE6402FC8C2@SHSMSX101.ccr.corp.intel.com>
Hi Chen Yu,
On Wed, Jul 22, 2015 at 08:58:11AM +0000, Chen, Yu C wrote:
>
>
> > -----Original Message-----
> > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net]
> > Sent: Wednesday, July 22, 2015 9:04 AM
> > To: Chen, Yu C
> > Cc: linux-pm@vger.kernel.org; Wysocki, Rafael J; joeyli; Tian, YeX
> > Subject: Re: [RFC PATCH] PM / hibernate: make sure each resuming page is
> > in current memory zones
> >
> > On Tuesday, July 21, 2015 09:28:32 AM chenyu5 wrote:
> > > On 2015年07月16日 08:30, Rafael J. Wysocki wrote:
> > > > On Monday, July 06, 2015 04:37:39 PM joeyli wrote:
> > > >> Hi Chen Yu,
> > > >>
> > > >> On Thu, Jul 02, 2015 at 04:00:42PM +0800, chenyu5 wrote:
> > > >>> 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:
> > > >>>>> 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
> > > >>>>
> > > >>
> > > >> Thanks for your explanation, then your patch makes sense to me.
> > > >>
> > > >> Please feel free to add tag:
> > > >>
> > > >> Reviewed-by: Lee, Chun-Yi <joeyli.kernel@gmail.com>
> > > >
> > > > Patch queued up for 4.3, thanks!
> > > >
> > > Hi Rafeal,
> > > Please help drop this patch for now, QA has found some problems with
> > > this patch applied, we're working on it now. Sorry for inconvenience.
> >
> > Dropping, thanks for the heads up!
> >
> Hi,Rafeal, Joey
> I've sent out another patch, it is based on Joey's
> original patch, and it treats any adjacent E820_RAM/E820_RESERVED_KERN regions as
> one. In this way, non-page-aligned setup_data address would not be added
> to nosave regions, thus workaround the hibernation failor mentiones in
> https://bugzilla.kernel.org/show_bug.cgi?id=96111
>
> V1 patch has a problem that, NOT every page in page zone has a valid mapping address , thus
> accessing these pages would cause problem. So I rewrite this path and send out another V2 version.
> Thanks for your time.
>
> Yu
> >
Thanks for your work on this patch, but the E820_RESERVED_KERN will be removed
anyhow. So I prefer waiting Yinghai Lu's patch for killing E820_RESERVED_KERN.
Regards
Joey Lee
next prev parent reply other threads:[~2015-07-23 5:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 15:54 [RFC PATCH] PM / hibernate: make sure each resuming page is in current memory zones Chen Yu
2015-07-02 6:19 ` joeyli
2015-07-02 8:00 ` chenyu5
2015-07-06 8:37 ` joeyli
2015-07-16 0:30 ` Rafael J. Wysocki
2015-07-21 1:28 ` chenyu5
2015-07-22 1:03 ` Rafael J. Wysocki
2015-07-22 8:58 ` Chen, Yu C
2015-07-23 5:34 ` joeyli [this message]
2015-07-23 5:42 ` chenyu5
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150723053432.GI23137@linux-rxt1.site \
--to=jlee@suse.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
--cc=yex.tian@intel.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).