On Fri, Jun 20, 2014 at 11:35:53AM +0200, Roger Pau Monn? wrote: > Hello, > > I've been looking into the Xen balloon driver, because I've experienced > problems when ballooning memory down which AFAICT are also present in > the VirtIO balloon driver. The problem I've experienced is that when > ballooning memory down, we basically allocate a bunch of memory as > WIRED, to make sure nobody tries to swap it do disk, since it will crash > the kernel because the memory is not populated. Due to this massive > amount of memory allocated as WIRED, user-space programs that try to use > mlock will fail because we hit the limit in vm.max_wired. > > I'm not sure what's the best way to deal with this limitation, should > vm.max_wired be changed from the balloon drivers when ballooning > down/up? Is there anyway to remove the pages ballooned down from the > memory accounting of wired pages?
You could change the type of pages the ballon driver is allocating. Instead of wired pages, you may request unmanaged, by passing NULL object to vm_page_alloc(). This would also save on the trie nodes for managing the radix trie for the object. There are still plinks or listq to keep track of the allocated pages.
Description: PGP signature