diff options
author | akpm@linux-foundation.org <akpm@linux-foundation.org> | 2010-03-05 16:41:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:25 -0500 |
commit | d96ae5309165d9ed7c008a178238977b73595cd9 (patch) | |
tree | 78b169102b718a9489fcc41ad4829a646492d2fb /mm/memory_hotplug.c | |
parent | 9d8cebd4bcd7c3878462fdfda34bbcdeb4df7ef4 (diff) |
memory-hotplug: create /sys/firmware/memmap entry for new memory
A memmap is a directory in sysfs which includes 3 text files: start, end
and type. For example:
start: 0x100000
end: 0x7e7b1cff
type: System RAM
Interface firmware_map_add was not called explicitly. Remove it and add
function firmware_map_add_hotplug as hotplug interface of memmap.
Each memory entry has a memmap in sysfs, When we hot-add new memory, sysfs
does not export memmap entry for it. We add a call in function add_memory
to function firmware_map_add_hotplug.
Add a new function add_sysfs_fw_map_entry() to create memmap entry, it
will be called when initialize memmap and hot-add memory.
[akpm@linux-foundation.org: un-kernedoc a no longer kerneldoc comment]
Signed-off-by: Shaohui Zheng <shaohui.zheng@intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 030ce8a5bb0e..78e34e63c7b8 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/pfn.h> | 28 | #include <linux/pfn.h> |
29 | #include <linux/suspend.h> | 29 | #include <linux/suspend.h> |
30 | #include <linux/mm_inline.h> | 30 | #include <linux/mm_inline.h> |
31 | #include <linux/firmware-map.h> | ||
31 | 32 | ||
32 | #include <asm/tlbflush.h> | 33 | #include <asm/tlbflush.h> |
33 | 34 | ||
@@ -523,6 +524,9 @@ int __ref add_memory(int nid, u64 start, u64 size) | |||
523 | BUG_ON(ret); | 524 | BUG_ON(ret); |
524 | } | 525 | } |
525 | 526 | ||
527 | /* create new memmap entry */ | ||
528 | firmware_map_add_hotplug(start, start + size, "System RAM"); | ||
529 | |||
526 | goto out; | 530 | goto out; |
527 | 531 | ||
528 | error: | 532 | error: |