From owner-svn-src-head@FreeBSD.ORG Wed Jun 25 15:03:33 2014 Return-Path: Delivered-To: svn-src-head@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 8C5B3EBC; Wed, 25 Jun 2014 15:03:33 +0000 (UTC) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8413821C2; Wed, 25 Jun 2014 15:03:32 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id q58so2163359wes.16 for ; Wed, 25 Jun 2014 08:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=z49IGDIPqqI3RUOMxKQateK2/pg3kCNVEQAyT3mbLcs=; b=sDz5MTC/kCXzxBMjEEtIBYrZmaJDfAof0XgYus/zFesv6dRuVIfnMSGh/1d+n3d8Jt OV9h24RuiYKoquaONlfTPzQqxeuBVP+xccqP2UdmaP4CaeOEY6PTnUJsELc/4+F3y9mM QE+ip/flVnfcVJqx0M5Nqgn/Q9iM/wbjSemGAT8rdCdBzlfLYOXVTgseA9lVFTeFiiFC j1bc3n3YvBPtu3cwZUU3CBsy2Ed8dmyotjdybwpwcl6EgwEzWCxaQNuaddxtQs+81bht oy89eMS5+7yZUEgn6OE92IwCmi0wi3ncrYYqmC09acKJSXmIwdXZ/b5428AY9FOvJTj9 Ctyg== MIME-Version: 1.0 X-Received: by 10.180.79.9 with SMTP id f9mr42190570wix.52.1403708607498; Wed, 25 Jun 2014 08:03:27 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.46.129 with HTTP; Wed, 25 Jun 2014 08:03:27 -0700 (PDT) In-Reply-To: <53AAD775.8070302@FreeBSD.org> References: <201406250951.s5P9p8YR017159@svn.freebsd.org> <53AACEAB.3090702@FreeBSD.org> <53AAD775.8070302@FreeBSD.org> Date: Wed, 25 Jun 2014 17:03:27 +0200 X-Google-Sender-Auth: lQu7pL3ahmlfHt-vyuEP67JpRnE Message-ID: Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon From: Attilio Rao To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Alan Cox , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 15:03:33 -0000 On Wed, Jun 25, 2014 at 4:06 PM, Roger Pau Monn=C3=A9 = wrote: > On 25/06/14 15:44, Attilio Rao wrote: >> On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monn=C3=A9 wrote: >>> On 25/06/14 13:58, Attilio Rao wrote: >>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monn=C3=A9 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 cou= nt, >>>>> 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. > > What I meant by "not there" is that the physical addresses associated > with the pages are no longer valid (it's a hole in the physical memory > map). To me it seems conceptually wrong to account those pages as wired. They are not. They are at all effect wired (even if with a slightly different semantic), meaning wired as also not-pageable. The fact that you won't mark them wired will just weaken the accounting, debuggability and tracing side. > Thinking from a user point of view for example, if I'm inside of a VM > that has ballooned down, I will see a huge amount of memory marked as > wired on the top utility, which seems wrong, those pages are simply not > there anymore, and as so, they shouldn't show up in stats. > > It also makes it really hard to know which memory is really wired and in > use by the system, as opposed to the wired memory used by the balloon > driver. I think this is really the problem with your approach. Now memory will not be reachable by the pagedaemon and yet you won't see it showing up anywhere. Memory leaks could go unnoticed, to some extent. I don't think that's really what you want. Attilio --=20 Peace can only be achieved by understanding - A. Einstein