Hmm, why can't you use numa=hide to hide a specified quantity of memory
from the kernel and then use the add_memory() interface to hot-add the
offlined memory in the desired quantity? In other words, why do you need
to track the offlined nodes with a state?
The userspace interface would take a desired size of hidden memory to
hot-add and the node id would be the first_unset_node(node_online_map).
size should be parsed with memparse() so users can specify 'M' or 'G', it
would even make your parsing code simpler.
--