aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2007-10-21 19:41:36 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 11:13:17 -0400
commit10020ca246c55744dad815ad4f15e1f488ca55a8 (patch)
treef848f3c6180b043abc7560e366fd634c468cfa41 /Documentation
parenta24e785111a32ccb7cebafd24b1b1cb474ea8e5d (diff)
memory hotplug: document the memory hotplug notifier
Add description about event notification callback routine to the document Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/memory-hotplug.txt58
1 files changed, 55 insertions, 3 deletions
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
index 5fbcc22c98e..168117bd6ee 100644
--- a/Documentation/memory-hotplug.txt
+++ b/Documentation/memory-hotplug.txt
@@ -2,7 +2,8 @@
2Memory Hotplug 2Memory Hotplug
3============== 3==============
4 4
5Last Updated: Jul 28 2007 5Created: Jul 28 2007
6Add description of notifier of memory hotplug Oct 11 2007
6 7
7This document is about memory hotplug including how-to-use and current status. 8This document is about memory hotplug including how-to-use and current status.
8Because Memory Hotplug is still under development, contents of this text will 9Because Memory Hotplug is still under development, contents of this text will
@@ -24,7 +25,8 @@ be changed often.
24 6.1 Memory offline and ZONE_MOVABLE 25 6.1 Memory offline and ZONE_MOVABLE
25 6.2. How to offline memory 26 6.2. How to offline memory
267. Physical memory remove 277. Physical memory remove
278. Future Work List 288. Memory hotplug event notifier
299. Future Work List
28 30
29Note(1): x86_64's has special implementation for memory hotplug. 31Note(1): x86_64's has special implementation for memory hotplug.
30 This text does not describe it. 32 This text does not describe it.
@@ -307,8 +309,58 @@ Need more implementation yet....
307 - Notification completion of remove works by OS to firmware. 309 - Notification completion of remove works by OS to firmware.
308 - Guard from remove if not yet. 310 - Guard from remove if not yet.
309 311
312--------------------------------
3138. Memory hotplug event notifier
314--------------------------------
315Memory hotplug has event notifer. There are 6 types of notification.
316
317MEMORY_GOING_ONLINE
318 Generated before new memory becomes available in order to be able to
319 prepare subsystems to handle memory. The page allocator is still unable
320 to allocate from the new memory.
321
322MEMORY_CANCEL_ONLINE
323 Generated if MEMORY_GOING_ONLINE fails.
324
325MEMORY_ONLINE
326 Generated when memory has succesfully brought online. The callback may
327 allocate pages from the new memory.
328
329MEMORY_GOING_OFFLINE
330 Generated to begin the process of offlining memory. Allocations are no
331 longer possible from the memory but some of the memory to be offlined
332 is still in use. The callback can be used to free memory known to a
333 subsystem from the indicated memory section.
334
335MEMORY_CANCEL_OFFLINE
336 Generated if MEMORY_GOING_OFFLINE fails. Memory is available again from
337 the section that we attempted to offline.
338
339MEMORY_OFFLINE
340 Generated after offlining memory is complete.
341
342A callback routine can be registered by
343 hotplug_memory_notifier(callback_func, priority)
344
345The second argument of callback function (action) is event types of above.
346The third argument is passed by pointer of struct memory_notify.
347
348struct memory_notify {
349 unsigned long start_pfn;
350 unsigned long nr_pages;
351 int status_cahnge_nid;
352}
353
354start_pfn is start_pfn of online/offline memory.
355nr_pages is # of pages of online/offline memory.
356status_change_nid is set node id when N_HIGH_MEMORY of nodemask is (will be)
357set/clear. It means a new(memoryless) node gets new memory by online and a
358node loses all memory. If this is -1, then nodemask status is not changed.
359If status_changed_nid >= 0, callback should create/discard structures for the
360node if necessary.
361
310-------------- 362--------------
3118. Future Work 3639. Future Work
312-------------- 364--------------
313 - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like 365 - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like
314 sysctl or new control file. 366 sysctl or new control file.