Yasunori Goto

Linux: Documenting Memory Hotplug

Submitted by Jeremy
on July 28, 2007 - 12:56pm

Yasunori Goto posted some documentation for memory hotplugging which can be used to increase or decrease the amount of memory available to a live kernel. The documentation explains that this functionality is useful for virtualization and capacity on demand solutions, as well as for physically adding and removing RAM from NUMA-nodes. The document itself, "is about memory hotplug including how-to-use and current status. Because Memory Hotplug is still under development, contents of this text will be changed often."

It goes on to explain that there are two phases of memory hotplug, the physical memory hotplug phase, and the logical memory hotplug phase. "The first phase is to communicate [the] hardware/firmware and make/erase environment for hotplugged memory. When memory is hotplugged, the kernel recognizes new memory, makes new memory management tables, and makes sysfs files for new memory's operation." The second phase "is to change memory state into available/unavailable for users. [The] amount of memory from [the] user's view is changed by this phase." Hotplugging memory requires it to be brought online or offline using the sysfs files created during the physical memory hotplug phase, though the process can be automated with udev scripts. Setting memory as offline is not guaranteed to work as it's not always possible to free memory, such as if it contains nonmigratable pages. The documentation also notes that support for physically removing memory from a node is not yet completed.