mm: add support for putting memory in a low-power state

The file /sys/devices/system/memory/low_power now exists.

Writing a physical address into this file will put this
section of memory into a low power state (retaining contents)
if the architecture and platform supports it.

Change-Id: I70592d37f1091a1b533f2374546ba67b50ea7d30
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 1f4d1c8e295aaf66b23309caa0d03b09b7009b99)

Conflicts:

	drivers/base/memory.c
	include/linux/memory_hotplug.h
This commit is contained in:
Larry Bassel 2010-01-22 10:54:18 -08:00 committed by Stephen Boyd
parent 699e626db7
commit 8a57f81411
2 changed files with 13 additions and 0 deletions

View file

@ -260,3 +260,6 @@ extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map,
#endif /* __LINUX_MEMORY_HOTPLUG_H */
extern int physical_remove_memory(u64 start, u64 size);
extern int arch_physical_remove_memory(u64 start, u64 size);
extern int physical_low_power_memory(u64 start, u64 size);
extern int arch_physical_low_power_memory(u64 start, u64 size);

View file

@ -1199,6 +1199,16 @@ int __ref physical_remove_memory(u64 start, u64 size)
}
EXPORT_SYMBOL_GPL(physical_remove_memory);
int __ref physical_low_power_memory(u64 start, u64 size)
{
int ret;
/* call arch's memory low power routine */
ret = arch_physical_low_power_memory(start, size);
return ret;
}
EXPORT_SYMBOL_GPL(physical_low_power_memory);
#ifdef CONFIG_MEMORY_HOTREMOVE
/*
* A free page on the buddy free lists (not the per-cpu lists) has PageBuddy