From owner-freebsd-xen@FreeBSD.ORG Fri Jun 20 15:26:20 2014 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69FBDF8A; Fri, 20 Jun 2014 15:26:20 +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 EF5242C76; Fri, 20 Jun 2014 15:26:19 +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 s5KFQAMZ054571; Fri, 20 Jun 2014 18:26:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5KFQAMZ054571 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s5KFQABo054570; Fri, 20 Jun 2014 18:26:10 +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 18:26:10 +0300 From: Konstantin Belousov To: Roger Pau Monn? Subject: Re: FreeBSD and memory balloon drivers Message-ID: <20140620152610.GI3991@kib.kiev.ua> References: <53A40079.9000804@citrix.com> <20140620132816.GH3991@kib.kiev.ua> <53A4501F.4020201@citrix.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OrKNV1jnpyJzuZNm" Content-Disposition: inline In-Reply-To: <53A4501F.4020201@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 15:26:20 -0000 --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--