Date: Wed, 25 Jun 2014 15:44:35 +0200 From: Attilio Rao <attilio@freebsd.org> To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <royger@freebsd.org> Cc: Alan Cox <alc@freebsd.org>, "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: <CAJ-FndD2oESE4uvyZTrftwiQhQzHwT2k%2Byzu0X1g_E3Atdv6Fg@mail.gmail.com> In-Reply-To: <53AACEAB.3090702@FreeBSD.org> References: <201406250951.s5P9p8YR017159@svn.freebsd.org> <CAJ-FndD4M8QkejyTv4R_9qoThqvFinYbHP4YSby6mQS9EKSYPA@mail.gmail.com> <53AACEAB.3090702@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monn=C3=A9 <royger@freebsd.org> = wrote: > On 25/06/14 13:58, Attilio Rao wrote: >> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monn=C3=A9 <royger@freebsd.o= rg> 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: I'm not entirely sure what do you mean with "not there anymore", so I'm just guessing and I assume that you mean "pages are not collected in any vm object and then they are not referenced in any pagequeue". By extension this also matches what "unmanaged page" means. If the page is unmanaged it means that the pagedaemon won't see it, so they won't be swapped out anyway. Wiring them it will enforce more sanity checking on the page. The max_wired concern may be real, however, please see below. > http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/00264= 3.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. Why? If VM needs more wired memory I assume that we can tune up the default value of max_wired? I think that however your case makes an interesting point: if we want to make unmanaged pages as inherently wired, we likely need a little bit higher max_wired value. When I completed a patch for this, pho@ couldn't reproduce any similar issue even with stress-testing (and also, the places to allocate unmanaged pages and not requesting VM_ALLOC_WIRED were very little, almost 0, with the exception of vm_page_alloc_contig() calls) but I think it is a valid proposition. However I would still like to have more control on kernel-specific wired memory for processes. I'm for example thinking to ARC vs. buffer cache, where I expect the wired memory consumption to be much bigger for the former case. Attilio --=20 Peace can only be achieved by understanding - A. Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndD2oESE4uvyZTrftwiQhQzHwT2k%2Byzu0X1g_E3Atdv6Fg>