From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932200Ab0LCAIE (ORCPT ); Thu, 2 Dec 2010 19:08:04 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:50114 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756216Ab0LCAIC (ORCPT ); Thu, 2 Dec 2010 19:08:02 -0500 From: "Rafael J. Wysocki" To: Andrew Morton Subject: Re: [PATCH] PM / Hibernate: Fix memory corruption related to swap Date: Fri, 3 Dec 2010 01:06:48 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc4+; KDE/4.4.4; x86_64; ; ) Cc: Hugh Dickins , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Kernel development list , Ondrej Zary , "Linux-pm mailing list" References: <201012030040.37273.rjw@sisk.pl> <20101202155453.92e8ca57.akpm@linux-foundation.org> In-Reply-To: <20101202155453.92e8ca57.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012030106.49226.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, December 03, 2010, Andrew Morton wrote: > On Fri, 3 Dec 2010 00:40:36 +0100 > "Rafael J. Wysocki" wrote: > > > From: Rafael J. Wysocki > > > > There is a problem that swap pages allocated before the creation of > > a hibernation image can be released and used for storing the contents > > of different memory pages while the image is being saved. Since the > > kernel stored in the image doesn't know of that, it causes memory > > corruption to occur after resume from hibernation, especially on > > systems with relatively small RAM that need to swap often. > > > > This issue can be addressed by keeping the GFP_IOFS bits clear > > in gfp_allowed_mask during the entire hibernation, including the > > saving of the image, until the system is finally turned off or > > the hibernation is aborted. Unfortunately, for this purpose > > it's necessary to rework the way in which the hibernate and > > suspend code manipulates gfp_allowed_mask. > > > > This change is based on an earlier patch from Hugh Dickins. > > > > Signed-off-by: Rafael J. Wysocki > > Reported-by: Ondrej Zary > > Acked-by: Hugh Dickins > > --- > > > > Hi, > > > > This patch is a fix for a regression and nasty memory corruption, so I'd like > > to push it to Linus for 2.6.37 if there are no objections. > > > > It looks OK to me for 2.6.37 but for 2.6.38 please let's make > everything here a 100% no-op for CONFIG_PM_SLEEP=n builds. > Specifically the slight overhead in __alloc_pages_nodemask. OK, I'll take care of it. > Because given the global nature of saved_gfp_mask and the unlocked way > in which it is accessed, this facility won't be at all useful for > anything other than suspend. Right.