[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100730123620.ab49df4f.kamezawa.hiroyu@jp.fujitsu.com>
Date: Fri, 30 Jul 2010 12:36:20 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: Hugh Dickins <hughd@...gle.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Ondrej Zary <linux@...nbow-software.org>,
Kernel development list <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Balbir Singh <balbir@...ibm.com>,
Andrea Arcangeli <aarcange@...hat.com>
Subject: Re: Memory corruption during hibernation since 2.6.31
On Fri, 30 Jul 2010 01:29:33 +0200
"Rafael J. Wysocki" <rjw@...k.pl> wrote:
> Well, the rule of thumb (if it can be called this way) is that the contents of
> the image has to be consistent with whatever is stored in permanent storage.
> So, for example, filesystems that were mounted before creating the image
> cannot be modified until the image is restored. Consequently, if there are
> any kernel threads that might cause that to happen, they need to be frozen.
>
> Now, if I understand it correctly, the failure mode is that certain page had
> been swapped out before the image was created and then it was swapped in
> while we were writing the image out and the slot occupied by it was re-used.
> In that case the image would contain wrong information on the state of the
> swap and that would result in wrong data being loaded into memory on an attempt
> to swap that page in after resume.
>
> So, generally, we have to avoid doing things that would result in swapping
> memory pages out after we have created a hibernation image. If that can be
> achieved by freezing certain kernel threads, that probably is the simplest
> approach.
>
BTW, I can't understand what happens in following situation.
1. start saving image.
2. at saving image, swap entry is used and swap_map[off] += 1.
3. At some point, swap_map[] itself is saved.
...
At restore, IIUC, hibernation don't call any swap_free().
Where does the +1 goes ?
I'm sorry if I misunderstand.
Thanks,
-Kame
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists