Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1044630imm; Thu, 6 Sep 2018 14:27:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbEVmz8L6hHf22Qczw8ZSbCuauRy1Y42nQesYbG089k/BIHSuFW7X1SmWrzfYRYh9jhTUqU X-Received: by 2002:a17:902:59ce:: with SMTP id d14-v6mr4795554plj.42.1536269228491; Thu, 06 Sep 2018 14:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536269228; cv=none; d=google.com; s=arc-20160816; b=MiDgIbGGAWuJbVZ0V7SiwDqV6ALVqnKRVBWH5DqzZV2NvKGNA5v6dRJZqlrJlLsStG dgPBilMb5IhwwxPSlLu6Rdp2ixGWoaITax+ImZ9IdynQG1yDRfRgv/Lb7+ESIePBxq5w Hikw7pz8qEI7xRDwtPmC/qyEkLgngOmPx5OxRYneoyOZREWsfSKhjwDOikUkrlumsRbb hXv/DOFctlgV1luMj9p+m1EDK8j6WSZyd+5y6O+YGusvhkcvhUts9hPhFklbe5A6GgJZ XP038irR8jAhjCxWixk2p/+B+adF47p1XSLsI8e6e5sO8p+h8CSlR2kDTROOHpSV/c8t V1zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DtqIiWdt4Wso9Rj6StRRr9L7ZYHciwFsrrxZJLUKl6Y=; b=WxwlJVptsqZGF1xZJawb3x0rvnSkgJ+mbSzqisgCNJ6U3zmoM5/2LexTcvvhG5VsWJ B9bExW3t0BYJwYqpcJqtj74BOAOcsoLtZPvls3pkyquSM46IkpYP2w3RxhQ2sOvkAS0v Jh28EcsYuTSR7ig5YIt8XwcvK79fzy4LWxNp+4yBTG7XjHjWL1pxlnLedhVTxu6plxm6 Rpkv+JJ0RBFJPRYWEvqv1YoahyCJ7HXb0WhECkS1ulY4xIi0DjAa+H18qyUO9t3BOouz HbZFSvSIov3TnS9UrdLEJFXHQ7N+4LEER0RaiRhfRIsvYsPFEhywh4KyNAAQDZMF9395 njnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=PuSsu5Ol; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64-v6si6514117pgc.516.2018.09.06.14.26.53; Thu, 06 Sep 2018 14:27:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=PuSsu5Ol; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729894AbeIGBIl (ORCPT + 99 others); Thu, 6 Sep 2018 21:08:41 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35325 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbeIGBIl (ORCPT ); Thu, 6 Sep 2018 21:08:41 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id A1DB821751; Thu, 6 Sep 2018 16:31:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 06 Sep 2018 16:31:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=DtqIiWdt4Wso9Rj6StRRr9L7ZYHci wFsrrxZJLUKl6Y=; b=PuSsu5OlRdRtdfeez6JgQBrs/y3krezGAwia9L+uKr/CL rEDDn2cJgr+fBLdzSM4iZkRI8YlxcJjJUFrP3Oqze1P7VGkkA+zmgXsxUw5ZXuxW cmjwOieLl8xt2TTb+XTDq8b4QvYftEqvz+AsFanu9rmyBiiRsjEkhtzvTRkX7RTI ek8j06g8ff/aQCT1ZW5dzrdO/bDhJb2ocGxU90kuIuS99dOyqaSpItzwe2Rb8OQ9 Kqe/d210lO/L5ObuelWz99Uqr1zkTL05NvNARRCNCM6mMS40DPppcfsVjixmnzvr KfK+eoD2vPXArzE63FyflvEA0Yc/K7NBOHa+qVSiQ== X-ME-Proxy: X-ME-Sender: Received: from mail-itl (ip5b40bfaa.dynamic.kabel-deutschland.de [91.64.191.170]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D9FEE4015; Thu, 6 Sep 2018 16:31:31 -0400 (EDT) Date: Thu, 6 Sep 2018 22:31:28 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Boris Ostrovsky Cc: xen-devel@lists.xenproject.org, Juergen Gross , open list Subject: Re: [PATCH] xen/balloon: add runtime control for scrubbing ballooned out pages Message-ID: <20180906203128.GJ1353@mail-itl> References: <20180906153355.25363-1-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+Z7/5fzWRHDJ0o7Q" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --+Z7/5fzWRHDJ0o7Q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 06, 2018 at 04:14:50PM -0400, Boris Ostrovsky wrote: > On 09/06/2018 11:33 AM, Marek Marczykowski-G=C3=B3recki wrote: > > Scrubbing pages on initial balloon down can take some time, especially > > in nested virtualization case (nested EPT is slow). When HVM/PVH guest = is > > started with memory=3D significantly lower than maxmem=3D, all the extra > > pages will be scrubbed before returning to Xen. But since most of them > > weren't used at all at that point, Xen needs to populate them first > > (from populate-on-demand pool). In nested virt case (Xen inside KVM) > > this slows down the guest boot by 15-30s with just 1.5GB needed to be > > returned to Xen. > > > > Add runtime parameter to enable/disable it, to allow initially disabling > > scrubbing, then enable it back during boot (for example in initramfs). > > Such usage relies on assumption that a) most pages ballooned out during > > initial boot weren't used at all, and b) even if they were, very few > > secrets are in the guest at that time (before any serious userspace > > kicks in). > > > > Default behaviour is unchanged. > > > > Signed-off-by: Marek Marczykowski-G=C3=B3recki > > > > --- > > Is module_param() a good thing for this? Other xen-balloon parameters a= re > > in /sys/devices/system/xen_memory, so maybe it would make sense to put > > this one there too? But then, cmdline parameter would need to be added > > separately and comment about core_param() suggests it shouldn't be used > > if not absolutely necessary (is it?). >=20 >=20 > You can also use cmdline_find_option() in the balloon driver. >=20 > I would prefer that all tunables for the balloon driver live in the same > place. (Note that in that case > Documentation/ABI/stable/sysfs-devices-system-xen_memory will need to be > updated). Ok, will move that. This will also mean that it will affect only balloon driver, not other users of mem-reservation.c (grant allocator). But given the reason for this tunable, I think that's fine. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --+Z7/5fzWRHDJ0o7Q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAluRjqAACgkQ24/THMrX 1ywXoQf9GslZ5mNMyTDoXZE1lz+20hZnloXps/YwcnK2/Ay5c3SGIrEmnd6vPDah c4VUpATzbvRIDWgtkVlAohA1dunJXxEiG0kQfjPAkoPFbwtuY/O1/JW9m9vjnf4B e9TBJ+IuN713Sh+6+AaBIfsNliiBnH6TCBL56v7EA3vi4t49oVPZ5Dp0xYjj7Tug PmIL73QI99yol51gpGw0FZZTULlH7WqP2INzVsLhAQlhVyC7fN4wdskfBWnn9rao aQpw6vIRu5TExGJn4hD8XjxIrfkkIGebvKVWATFHDHE/e1Z2lV0a++AitAg1l4zs 6vSnfcAZO8cVRQqD4SIPhDWGKtJJ1A== =IoZO -----END PGP SIGNATURE----- --+Z7/5fzWRHDJ0o7Q--