diff options
author | Yasunori Goto <y-goto@jp.fujitsu.com> | 2007-10-21 19:41:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 11:13:17 -0400 |
commit | 10020ca246c55744dad815ad4f15e1f488ca55a8 (patch) | |
tree | f848f3c6180b043abc7560e366fd634c468cfa41 /Documentation | |
parent | a24e785111a32ccb7cebafd24b1b1cb474ea8e5d (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.txt | 58 |
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 @@ | |||
2 | Memory Hotplug | 2 | Memory Hotplug |
3 | ============== | 3 | ============== |
4 | 4 | ||
5 | Last Updated: Jul 28 2007 | 5 | Created: Jul 28 2007 |
6 | Add description of notifier of memory hotplug Oct 11 2007 | ||
6 | 7 | ||
7 | This document is about memory hotplug including how-to-use and current status. | 8 | This document is about memory hotplug including how-to-use and current status. |
8 | Because Memory Hotplug is still under development, contents of this text will | 9 | Because 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 |
26 | 7. Physical memory remove | 27 | 7. Physical memory remove |
27 | 8. Future Work List | 28 | 8. Memory hotplug event notifier |
29 | 9. Future Work List | ||
28 | 30 | ||
29 | Note(1): x86_64's has special implementation for memory hotplug. | 31 | Note(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 | -------------------------------- | ||
313 | 8. Memory hotplug event notifier | ||
314 | -------------------------------- | ||
315 | Memory hotplug has event notifer. There are 6 types of notification. | ||
316 | |||
317 | MEMORY_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 | |||
322 | MEMORY_CANCEL_ONLINE | ||
323 | Generated if MEMORY_GOING_ONLINE fails. | ||
324 | |||
325 | MEMORY_ONLINE | ||
326 | Generated when memory has succesfully brought online. The callback may | ||
327 | allocate pages from the new memory. | ||
328 | |||
329 | MEMORY_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 | |||
335 | MEMORY_CANCEL_OFFLINE | ||
336 | Generated if MEMORY_GOING_OFFLINE fails. Memory is available again from | ||
337 | the section that we attempted to offline. | ||
338 | |||
339 | MEMORY_OFFLINE | ||
340 | Generated after offlining memory is complete. | ||
341 | |||
342 | A callback routine can be registered by | ||
343 | hotplug_memory_notifier(callback_func, priority) | ||
344 | |||
345 | The second argument of callback function (action) is event types of above. | ||
346 | The third argument is passed by pointer of struct memory_notify. | ||
347 | |||
348 | struct memory_notify { | ||
349 | unsigned long start_pfn; | ||
350 | unsigned long nr_pages; | ||
351 | int status_cahnge_nid; | ||
352 | } | ||
353 | |||
354 | start_pfn is start_pfn of online/offline memory. | ||
355 | nr_pages is # of pages of online/offline memory. | ||
356 | status_change_nid is set node id when N_HIGH_MEMORY of nodemask is (will be) | ||
357 | set/clear. It means a new(memoryless) node gets new memory by online and a | ||
358 | node loses all memory. If this is -1, then nodemask status is not changed. | ||
359 | If status_changed_nid >= 0, callback should create/discard structures for the | ||
360 | node if necessary. | ||
361 | |||
310 | -------------- | 362 | -------------- |
311 | 8. Future Work | 363 | 9. 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. |