Re: [NEW]: Introducing shrink_all_memory from user space

From: KOSAKI Motohiro
Date: Tue Apr 17 2012 - 14:24:36 EST

(4/15/12 5:47 AM), PINTU KUMAR wrote:
Dear All,

This is regarding a small proposal for shrink_all_memory( ) function which is found in mm/vmscan.c.
For those who are not aware, this function helps in reclaiming specified amount of physical memory and returns number of freed pages.

Currently this function is under CONFIG_HIBERNATION flag, so cannot be used by others without enabling hibernation.
Moreover this function is not exported to the outside world, so no driver can use it directly without including EXPORT_SYMBOL(shrink_all_memory) and recompiling the kernel.
The purpose of using it under hibernation(kernel/power/snapshot.c) is to regain enough physical pages to create hibernation image.

This is intended. current shrink_all_memory() is not designed for generic purpose. It doesn't care numa affinity etc..
In future, we may remove this function completely because actually hibernation don't depend on it. it only help to
improvement hibernation speed-up a bit.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at