Re: [RFC][PATCH -mm] hibernation: freeze swap at hibernation (Was Re: Memory corruption during hibernation since 2.6.31

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

On Mon, 2 Aug 2010 21:29:45 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:


Sorry, I can't understand what you write. Why "we get additional swapping?"
before starting hibernation, shrink_memory() is called and hibernation codes
should have enough memory to work.

This patch does

	1. set swap_for_hibernation = true 
                   => After this, kswapd/direct reclaim will make no swap.
		   => But hibernation can make use of swap.
	2. this variable, swap_for_hibernation is saved to disk as it is.

At resume
	3. swap_for_hibernation is loaded and it's value is "true"
	4. hibernation_thaw_swap() is called and set swap_for_hibernation=false.
	


hmm? Are you talking about regression itself ?

   Before 2.6.31
    - At scan_swap_map(), free swap_map[] was used.
   After 2.6.31
    - At scan_swap_map(), if "swapcache-only" swap entry is found,
      it's reused by try_to_free_swapcache(). Because this happens
      during saving image of system memory, the snapshot will have inconsitency
      between swap_map <=> swap cache (I think mem_map is saved firstly)
      Then, memory corruption happens.
   After this patch.
    - scan_swap_map() is never called while saving snapshot to the disk.


yes. Maybe some clever code can be added but start from simple one.
The result will not be very different because "write" time is long.
Thanks,
-Kame

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Memory corruption during hibernation since 2.6.31, Ondrej Zary, (Wed Jul 28, 2:20 pm)
Re: Memory corruption during hibernation since 2.6.31, Rafael J. Wysocki, (Wed Jul 28, 2:34 pm)
Re: Memory corruption during hibernation since 2.6.31, Ondrej Zary, (Wed Jul 28, 2:38 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Wed Jul 28, 6:06 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Wed Jul 28, 7:51 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Wed Jul 28, 9:23 pm)
Re: Memory corruption during hibernation since 2.6.31, KOSAKI Motohiro, (Wed Jul 28, 10:23 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Wed Jul 28, 10:24 pm)
Re: Memory corruption during hibernation since 2.6.31, KOSAKI Motohiro, (Wed Jul 28, 10:30 pm)
Re: Memory corruption during hibernation since 2.6.31, Ondrej Zary, (Thu Jul 29, 10:33 am)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Thu Jul 29, 11:44 am)
Re: Memory corruption during hibernation since 2.6.31, Andrea Arcangeli, (Thu Jul 29, 11:55 am)
Re: Memory corruption during hibernation since 2.6.31, Rafael J. Wysocki, (Thu Jul 29, 4:29 pm)
Re: Memory corruption during hibernation since 2.6.31, Rafael J. Wysocki, (Thu Jul 29, 4:40 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Thu Jul 29, 5:01 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Thu Jul 29, 8:36 pm)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Thu Jul 29, 8:54 pm)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Thu Jul 29, 9:02 pm)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Thu Jul 29, 9:10 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Thu Jul 29, 9:14 pm)
Re: Memory corruption during hibernation since 2.6.31, Balbir Singh, (Thu Jul 29, 9:18 pm)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Thu Jul 29, 9:32 pm)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Thu Jul 29, 9:46 pm)
Re: Memory corruption during hibernation since 2.6.31, Balbir Singh, (Thu Jul 29, 11:37 pm)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Fri Jul 30, 3:43 am)
Re: Memory corruption during hibernation since 2.6.31, Hugh Dickins, (Fri Jul 30, 11:16 am)
[RFC][PATCH -mm] hibernation: freeze swap at hibernation ( ..., KAMEZAWA Hiroyuki, (Sun Aug 1, 11:02 pm)
Re: [RFC][PATCH -mm] hibernation: freeze swap at hibernati ..., KAMEZAWA Hiroyuki, (Mon Aug 2, 5:19 pm)
Re: Memory corruption during hibernation since 2.6.31, Andrea Gelmini, (Tue Aug 3, 3:50 am)
Re: Memory corruption during hibernation since 2.6.31, KAMEZAWA Hiroyuki, (Tue Aug 3, 4:36 pm)
[PATCH -mm] hibernation: freeze swap at hibernation v2, KAMEZAWA Hiroyuki, (Tue Aug 3, 9:57 pm)
Re: [PATCH -mm] hibernation: freeze swap at hibernation v2, KAMEZAWA Hiroyuki, (Wed Aug 4, 5:32 pm)
Re: Memory corruption during hibernation since 2.6.31, Andrea Gelmini, (Thu Aug 5, 4:41 am)
Re: Memory corruption during hibernation since 2.6.31, Pavel Machek, (Mon Aug 9, 12:26 am)