diff options
| author | Yasuaki Ishimatsu <[email protected]> | 2013-02-22 16:32:56 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-02-23 17:50:12 -0800 |
| commit | 46c66c4b7ba0f9bb3e2ae3a3cfd40cd3472c8f80 (patch) | |
| tree | eb33a350aab3adae19a91a6e63918df1a3904585 /tools/perf/scripts/python | |
| parent | bbc76be67c2c0c12548937a07ea3643c32a95b8c (diff) | |
memory-hotplug: remove /sys/firmware/memmap/X sysfs
When (hot)adding memory into system, /sys/firmware/memmap/X/{end, start,
type} sysfs files are created. But there is no code to remove these
files. This patch implements the function to remove them.
We cannot free firmware_map_entry which is allocated by bootmem because
there is no way to do so when the system is up. But we can at least
remember the address of that memory and reuse the storage when the
memory is added next time.
This patch also introduces a new list map_entries_bootmem to link the
map entries allocated by bootmem when they are removed, and a lock to
protect it. And these entries will be reused when the memory is
hot-added again.
The idea is suggestted by Andrew Morton.
NOTE: It is unsafe to return an entry pointer and release the
map_entries_lock. So we should not hold the map_entries_lock
separately in firmware_map_find_entry() and
firmware_map_remove_entry(). Hold the map_entries_lock across find
and remove /sys/firmware/memmap/X operation.
And also, users of these two functions need to be careful to
hold the lock when using these two functions.
[[email protected]: Hold spinlock across find|remove /sys operation]
[[email protected]: fix the wrong comments of map_entries]
[[email protected]: reuse the storage of /sys/firmware/memmap/X/ allocated by bootmem]
[[email protected]: fix section mismatch problem]
[[email protected]: fix the doc format in drivers/firmware/memmap.c]
Signed-off-by: Wen Congyang <[email protected]>
Signed-off-by: Yasuaki Ishimatsu <[email protected]>
Signed-off-by: Tang Chen <[email protected]>
Reviewed-by: Kamezawa Hiroyuki <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Jianguo Wu <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Tang Chen <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Julian Calaby <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions