[..] > > Do we need a separate notifier chain for totalram_pages() updates? > > Good question. I actually might have the requirement to notify some arch > code (s390x) from virtio-mem when fake adding/removing memory, and > already wondered how to best wire that up. > > Maybe we can squeeze that into the existing notifier chain, but needs a > bit of thought. Do you mean by adding new actions (e.g. MEM_FAKE_ONLINE, MEM_FAKE_OFFLINE), or by reusing the existing actions (MEM_ONLINE, MEM_OFFLINE, etc). New actions mean minimal impact to existing notifiers, but it may make more sense to reuse MEM_ONLINE and MEM_OFFLINE to have generic actions that mean "memory increased" and "memory decreased". I suppose we can add new actions and then separately (and probably incrementally) audit existing notifiers to check if they want to handle the new actions as well. Another consideration is that apparently some ballooning drivers also register notifiers, so we need to make sure there is no possibility of deadlock/recursion.