Date: Fri, 20 Jun 2014 18:26:10 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Roger Pau Monn? <roger.pau@citrix.com> Cc: virtualization@FreeBSD.org, "freebsd-xen@freebsd.org" <freebsd-xen@freebsd.org>, bryanv@FreeBSD.org Subject: Re: FreeBSD and memory balloon drivers Message-ID: <20140620152610.GI3991@kib.kiev.ua> In-Reply-To: <53A4501F.4020201@citrix.com> References: <53A40079.9000804@citrix.com> <20140620132816.GH3991@kib.kiev.ua> <53A4501F.4020201@citrix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--OrKNV1jnpyJzuZNm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 20, 2014 at 05:15:43PM +0200, Roger Pau Monn? wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > On 20/06/14 15:28, Konstantin Belousov wrote: > > On Fri, Jun 20, 2014 at 11:35:53AM +0200, Roger Pau Monn? wrote: > >> Hello, > >>=20 > >> 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. > >>=20 > >> 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? > >=20 > > 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. >=20 > 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. --OrKNV1jnpyJzuZNm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTpFKRAAoJEJDCuSvBvK1Bbu4QAIt2ojo9JMTih/B2Y4S5vveD GRqLa3YUfOetBMt4xKbGKTmWcIzCcHBe1MIZ1qY8iufQErYwC5Kw0F0AxnSV2BEV TJReZbrWzlyKKIQZTTqgHf6ZUOIKI2rO1tSt5fj9fMBDSrbteqQOKdSd5saWfd1y g/xOFYjdB6iLtKhS+Q/1/CtwYmxTZKbzGf0D0LSa9dDsAEuL/i3SyNvNSUqXN6D3 uj6w78L0sTDx24zI31oEWbxWI5eII4tdTgMkDFZpa6c5/VRNAHo8dmCTDBTSy9M2 IcvgMWkOhPHNe+GG8IO1nupPcyby7vhlAymo0ubuH+QrnfWZNaTzpZgfE+bNtDkD wHwz4GRY/fheslBDkHf8KkQIASFpeE3uvgt2bktkJCTG53ER5Sr1CmLCjfic9xkF E2h6KoiK+5QsMBOy1UYO47La7apSEoPB8QrLrXf9V7Jjg3ZFLNNG0FbcGvfdD1Xp Fu8Fl+1ZIjuWrzA/UKjLaUzk5YrplWhWKbN1W9sndz7snFv+I3y2KVyi/AR2dcsq A50ctrx+qMrI4sDtjH3LpTRqI1xhAtIU3fveAKGWN19EYiJkgYCVaPmwTnz1L1c/ u5/szDWuegfaYQGjOr5yt/Zy/CBSiQwE1BiWUM4CXAZWXFxa9yRJASif+CmdILSM nMyMR7xeCqFadeLZc6Hh =+WSD -----END PGP SIGNATURE----- --OrKNV1jnpyJzuZNm--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140620152610.GI3991>