On Fri, Jun 20, 2014 at 05:15:43PM +0200, Roger Pau Monn? wrote:
> Hash: SHA1
> On 20/06/14 15:28, Konstantin Belousov wrote:
> > 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.
> Thanks for the info, I have the following patch which fixes the usage
> of WIRED for both the Xen and the VirtIO balloon drivers, could
> someone please test the VirtIO side?
I briefly looked at the xen balloon.  You do not need balloon_append().
Use struct vm_page plinks field to link the pages.

Attachment: pgpeCYPXBGamx.pgp
Description: PGP signature

Reply via email to