struct memory_notify {
unsigned long start_pfn;
unsigned long nr_pages;
- int status_change_nid;
}
- start_pfn is start_pfn of online/offline memory.
- nr_pages is # of pages of online/offline memory.
-- status_change_nid is set node id when N_MEMORY of nodemask is (will be)
- set/clear. It means a new(memoryless) node gets new memory by online and a
- node loses all memory. If this is -1, then nodemask status is not changed.
-
- If status_changed_nid* >= 0, callback should create/discard structures for the
- node if necessary.
It is possible to get notified for MEM_CANCEL_ONLINE without having been notified
for MEM_GOING_ONLINE, and the same applies to MEM_CANCEL_OFFLINE and
struct memory_notify mem_arg = {
.start_pfn = pfn,
.nr_pages = nr_pages,
- .status_change_nid = NUMA_NO_NODE,
};
struct node_notify node_arg = {
.nid = NUMA_NO_NODE,
if (!node_state(nid, N_MEMORY)) {
/* Adding memory to the node for the first time */
node_arg.nid = nid;
- mem_arg.status_change_nid = nid;
ret = node_notify(NODE_ADDING_FIRST_MEMORY, &node_arg);
ret = notifier_to_errno(ret);
if (ret)
struct memory_notify mem_arg = {
.start_pfn = start_pfn,
.nr_pages = nr_pages,
- .status_change_nid = NUMA_NO_NODE,
};
struct node_notify node_arg = {
.nid = NUMA_NO_NODE,
*/
if (nr_pages >= pgdat->node_present_pages) {
node_arg.nid = node;
- mem_arg.status_change_nid = node;
ret = node_notify(NODE_REMOVING_LAST_MEMORY, &node_arg);
ret = notifier_to_errno(ret);
if (ret) {