From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755552AbbIAJzF (ORCPT ); Tue, 1 Sep 2015 05:55:05 -0400 Received: from mga14.intel.com ([192.55.52.115]:45075 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754659AbbIAJzB convert rfc822-to-8bit (ORCPT ); Tue, 1 Sep 2015 05:55:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,448,1437462000"; d="scan'208";a="636172322" From: "Chen, Yu C" To: Ingo Molnar CC: "tglx@linutronix.de" , "mingo@redhat.com" , "rjw@rjwysocki.net" , "pavel@ucw.cz" , "hpa@zytor.com" , "Brown, Len" , "yinghai@kernel.org" , "joeyli.kernel@gmail.com" , "Zhang, Rui" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 3/3] PM / hibernate: Remove the restriction when checking memory size before/after hibernation Thread-Topic: [PATCH 3/3] PM / hibernate: Remove the restriction when checking memory size before/after hibernation Thread-Index: AQHQ4IDYqdeiErC9J0y9b6NPOKKNcJ4gYD8AgAcNrKA= Date: Tue, 1 Sep 2015 09:54:31 +0000 Message-ID: <36DF59CE26D8EE47B0655C516E9CE6401CB03732@SHSMSX101.ccr.corp.intel.com> References: <1392db911417124cd85cd8c169c5bc2de4ea5de1.1440640658.git.yu.c.chen@intel.com> <20150828053751.GD26741@gmail.com> In-Reply-To: <20150828053751.GD26741@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ingo, thanks for your review/suggestion, > -----Original Message----- > From: Ingo Molnar [mailto:mingo.kernel.org@gmail.com] On Behalf Of Ingo > Molnar > Sent: Friday, August 28, 2015 1:38 PM > To: Chen, Yu C > Cc: tglx@linutronix.de; mingo@redhat.com; rjw@rjwysocki.net; > pavel@ucw.cz; hpa@zytor.com; Brown, Len; yinghai@kernel.org; > joeyli.kernel@gmail.com; Zhang, Rui; linux-pm@vger.kernel.org; linux- > kernel@vger.kernel.org > Subject: Re: [PATCH 3/3] PM / hibernate: Remove the restriction when > checking memory size before/after hibernation > > > * Chen Yu wrote: > > + /* > > + * No need to check num_physpages with get_num_physpages > > + * as we did before(please refer to git log), because > > + * is_nosave_page will ensure that each page is safe > > + * to be restored. > > + */ > > if (reason) { > > printk(KERN_ERR "PM: Image mismatch: %s\n", reason); > > return -EPERM; > > No, this removes a useful sanity check that protects against data corruption. > > If you want to relax it then you should add code that checks whether the > before/after memory image is truly a superset of each other, and warn and > deny the hibernation in any other case. (For example when RAM got > removed or moved.) > OK, I've sent out another patch based on pfn_mapped checking.thanks Best Regards, Yu > Thanks, > > Ingo