On 13.04.2018 15:44, Michal Hocko wrote: > [If you choose to not CC the same set of people on all patches - which > is sometimes a legit thing to do - then please cc them to the cover > letter at least.] > > On Fri 13-04-18 15:16:24, David Hildenbrand wrote: >> I am right now working on a paravirtualized memory device ("virtio-mem"). >> These devices control a memory region and the amount of memory available >> via it. Memory will not be indicated via ACPI and friends, the device >> driver is responsible for it. > > How does this compare to other ballooning solutions? And why your driver > cannot simply use the existing sections and maintain subsections on top? > (further down in this mail is a small paragraph about that) All existing balloon implementations work on all memory available in the system. Some of them are able to add memory later on (XEN, Hyper-V), others are not (virtio-balloon). Having this model allows to plug/unplug memory NUMA aware on a fine granularity (e.g. 4MB), while making the implementation in the hypervisor a level of magnitudes easier. We could have multiple paravirtualized memory devices, e.g. one for each NUMA node. E.g. when rebooting we don't have to resize any initial system memory (a820, ACPI ...), but only care about the memory region of this one device. By adding memory by the device driver, we can actually remove the memory blocks again, freeing up the struct pages. Also, I tend to not call the solution a balloon driver, rather "paravirtualized memory". It is something like a balloon, but we are not going to start fragmenting on a page level. There is more to it, but this should cover the basics. "And why your driver cannot simply use the existing sections and maintain subsections on top?" Can you elaborate how that is going to work? What I do as of now, is to remember for each memory block (basically a section because I want to make it as small as possible) which chunks ("subsections") are online/offline. This works just fine. Is this what you are referring to? However when it comes to marking a section finally offline or telling kdump to not touch offline pages, I need the PG_offline. (I had a prototype where I marked the sections manually offline once I knew everything in it was offline, but that looked rather hackish) Thanks for having a look! -- Thanks, David / dhildenb