Date: Wed, 25 Jun 2014 19:42:59 +0200 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <royger@FreeBSD.org> To: Alan Cox <alc@rice.edu>, attilio@FreeBSD.org, Alan Cox <alc@freebsd.org> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org> Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon Message-ID: <53AB0A23.6020605@FreeBSD.org> In-Reply-To: <53AAFD12.5030308@rice.edu> References: <201406250951.s5P9p8YR017159@svn.freebsd.org> <CAJ-FndD4M8QkejyTv4R_9qoThqvFinYbHP4YSby6mQS9EKSYPA@mail.gmail.com> <53AACEAB.3090702@FreeBSD.org> <53AAFD12.5030308@rice.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 25/06/14 18:47, Alan Cox wrote: > On 06/25/2014 08:29, Roger Pau Monné wrote: >> On 25/06/14 13:58, Attilio Rao wrote: >>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné <royger@freebsd.org> wrote: >>>> Author: royger >>>> Date: Wed Jun 25 09:51:08 2014 >>>> New Revision: 267858 >>>> URL: http://svnweb.freebsd.org/changeset/base/267858 >>>> >>>> Log: >>>> xen/virtio: fix balloon drivers to not mark pages as WIRED >>>> >>>> Prevent the Xen and VirtIO balloon drivers from marking pages as >>>> wired. This prevents them from increasing the system wired page count, >>>> which can lead to mlock failing because of hitting the limit in >>>> vm.max_wired. >>> This change is conceptually wrong. >>> The pages balloon is allocating are unmanaged and they should be wired >>> by definition. Alan and I are considering enforcing this (mandatory >>> wired pages for unmanaged pages allocation) directly in the KPI. >>> This in practice just seem an artifact to deal with scarce wired >>> memory limit. I suggest that for the XEN case this limit gets bumped >>> rather relying on similar type of hacks. >> IMHO, marking them as wired seems wrong too, those pages are not wired, >> they are simply not there any more. This was discussed in: >> >> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html >> >> If there's consensus I will revert the change, but I would say that >> increasing vm.max_wired for VMs is also a gross hack. > > We wouldn't be changing it just for VMs. Our current definition of > vm_max_wired dates back to r5455, or in human years 1995. If the ZFS > ARC has taught us anything, we, or really the page daemon, can cope with > having more than 1/3 of a machine's pages wired. :-) > > I have a couple questions for you. Exactly how much memory will Xen try > to steal from a domain via ballooning? Clearly the domain can fail to > respond to the balloon request and Xen has to cope with that. Can the > domain also explicitly say, "No, I'm not giving you any pages." Xen itself won't try to steal any memory from a VM, this is AFAIK initiated by the host admin (or maybe some high-level orchestration toolstack), which requests the domain to balloon down. The domain is never forced to balloon down, is just a petition that the VM usually tries to satisfy as much as it can (or completely ignore it). As said before, I'm not sure what high-level toolstacks will do, maybe some of them will just kill the domain if it doesn't balloon down as expected, but I would be quite surprised if that's the case. For example I've tried ballooning down a FreeBSD VM from 2GB to 256MB, and only got it to ~300MB, but that's perfectly fine IMHO. Roger.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53AB0A23.6020605>