From owner-freebsd-xen@FreeBSD.ORG Fri Jun 20 13:28:33 2014 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED9D49CD; Fri, 20 Jun 2014 13:28:33 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77303216D; Fri, 20 Jun 2014 13:28:33 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5KDSG66027116; Fri, 20 Jun 2014 16:28:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5KDSG66027116 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s5KDSGDQ027115; Fri, 20 Jun 2014 16:28:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 20 Jun 2014 16:28:16 +0300 From: Konstantin Belousov To: Roger Pau Monn? Subject: Re: FreeBSD and memory balloon drivers Message-ID: <20140620132816.GH3991@kib.kiev.ua> References: <53A40079.9000804@citrix.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i+R2Fnv74iOC5F2I" Content-Disposition: inline In-Reply-To: <53A40079.9000804@citrix.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: virtualization@FreeBSD.org, "freebsd-xen@freebsd.org" , bryanv@FreeBSD.org X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 13:28:34 -0000 --i+R2Fnv74iOC5F2I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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? 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. --i+R2Fnv74iOC5F2I Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTpDbvAAoJEJDCuSvBvK1BgikP+gPdzLt8XtsevQkU8vfpCtJj ZnRdVneYSdHC6JBe+wUI0eT4/gQ9bIUD8eHYeVrVSW4JG0Br4SrpU0fTigfHi14j udk2+tcTmUFw7Ksx2l8L8qKGatWacZXZwF9adZfazvulwmMKmzou2bOcO9V9bBMb 8XgamaNFDldAl2KYyFP2k93ozuSTjgww1WhjooFcbhdlVgDDYzK+SNpk17BgDD+b 9FXjkiIKBNtH+xTznmL5zYAmrr4pCAy0MaOElawnR7oRlm0h9/9E49efm6jAcXrn ntnkfzlScTSRBtk/ZxIMpkK87LUfY80VkGnSentkSAUBqqEr217Ifnqf/Kbn8Y0v Zh0HGP2nF1J1TwqhEbsgQMGEBHjwzjx/vX39NX5pJfnCQ9Okb6mJMkzCR/8iIysI mNgYa0EOzg5wo022GiO18iWinAhklYFhIc+rc65Ot9qOSq5Y2lhp1xks1HTEnuC6 ircTeK5do0II/boxvv5j3pefjnUEc39iwSuKuKx4enFDErN3tQjJ/G2NqdqfYPH7 rhl4UMX1X0vIxLraOT1ZNIlJupj1gSfuAxgcEMdl54Upx9nE8IeSfy0F8UN8Kj5n js6brUwv06sHX9FUN5Ixo10ifZRqktzV9YcEEzaVYrTsM9+IFC3UgEt8QQ3CQubW sphwPTjgF7JM8TWS+fWf =dJ1f -----END PGP SIGNATURE----- --i+R2Fnv74iOC5F2I--