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
--