diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2011-01-11 02:44:01 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-01-11 10:09:50 -0500 |
commit | 925268a06dc2b1ff7bfcc37419a6827a0e739639 (patch) | |
tree | c0a5b3a6dc8ea6c4ea8e469e58223877f52c2e5b /include/linux | |
parent | 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff) |
memory hotplug: one more lock on memory hotplug
Now, memory_hotplug_(un)lock() is used for add/remove/offline pages
for avoiding races with hibernation. But this should be held in
online_pages(), too. It seems asymmetric.
There are cases where one has to avoid a race with memory hotplug
notifier and his own local code, and hotplug v.s. hotplug.
This will add a generic solution for avoiding races. In other view,
having lock here has no big impacts. online pages is tend to be
done by udev script at el against each memory section one by one.
Then, it's better to have lock here, too.
Cc: <stable@kernel.org> # 2.6.37
Reviewed-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/memory_hotplug.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 31c237a00c48..12b9eb5a36c3 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -161,6 +161,12 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | |||
161 | extern void put_page_bootmem(struct page *page); | 161 | extern void put_page_bootmem(struct page *page); |
162 | #endif | 162 | #endif |
163 | 163 | ||
164 | /* | ||
165 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug | ||
166 | * notifier will be called under this. 2) offline/online/add/remove memory | ||
167 | * will not run simultaneously. | ||
168 | */ | ||
169 | |||
164 | void lock_memory_hotplug(void); | 170 | void lock_memory_hotplug(void); |
165 | void unlock_memory_hotplug(void); | 171 | void unlock_memory_hotplug(void); |
166 | 172 | ||