aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/lpddr/lpddr_cmds.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <[email protected]>2009-07-08 13:24:12 +0200
committerRafael J. Wysocki <[email protected]>2009-09-14 20:26:59 +0200
commitef4aede3f10d82adef1fb044b565ba5f08f851e0 (patch)
tree58566c694aa036e75df401979bd8a85ffa718f18 /drivers/mtd/lpddr/lpddr_cmds.c
parent64a473cb74a88cb4991edf985d55a266e65292e1 (diff)
PM/Hibernate: Do not try to allocate too much memory too hard (rev. 2)
We want to avoid attempting to free too much memory too hard during hibernation, so estimate the minimum size of the image to use as the lower limit for preallocating memory. The approach here is based on the (experimental) observation that we can't free more page frames than the sum of: * global_page_state(NR_SLAB_RECLAIMABLE) * global_page_state(NR_ACTIVE_ANON) * global_page_state(NR_INACTIVE_ANON) * global_page_state(NR_ACTIVE_FILE) * global_page_state(NR_INACTIVE_FILE) minus * global_page_state(NR_FILE_MAPPED) Namely, if this number is subtracted from the number of saveable pages in the system, we get a good estimate of the minimum reasonable size of a hibernation image. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Wu Fengguang <[email protected]>
Diffstat (limited to 'drivers/mtd/lpddr/lpddr_cmds.c')
0 files changed, 0 insertions, 0 deletions