[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] x86/mem_sharing: option to skip populating special pages during fork


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 25 Mar 2022 11:25:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oPQHxJ1hAuYMlNmWJ/4PGDmSYVMmnuPuzQbRLzFyIW0=; b=EfNcpBprbG5zyxLwLe3ueZ2g1qQ7H5u9mRzGFGwVhhTL4iljZJgsHHCj66rPhHerDKPA8MYOXzdAfThSNWTEUoFtRRi7JedHYeCxITZ3E3QfAjyfy4rps3RuONq7EQ12xOpJzfGuB05tYKA4FzIib2LXvEBh8DcCGzfq9dP6IoK90AYMZ4mE5w+ynOwzCJh4xhrWkhXunnDnmnVUZfklAyRIMgYrNmeCeUAYQPkX8BMcDEwvgwNurS4UbabeaK+SXuPMC+Ndc2Plk49/UCIecjnt5PonjkENFXOjmBEMmwhIWR8ADf7UPc9XmwDFkV/whBainE/QVRPhY5TbZ8B6cA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NoVY5tzbNLvZ9ug3/nGH0HGeDlyb2k1YlIltrrgm3Vy8rwiK8EbN3LwieK+QJKJlaCfMCtF8+95vYlSecfL5nKDfcy9ysVYZdNxkRelEIyk/SkHQ5wdygABLkKwVh9eMXuOWJPq/wWFOpwvKX8DMqQ9KaBsBbunGVxLqlVYmeQFFH+oGUJRAZbuPQN3xFhmEi+wKssKbm84cjvZoHgV6GvN0ARxqgvQOwWGAT8J7d1/+7D+zoHw/AvLPWQnf4shP8ihPOARRA0VqF92pNoKXIPOaW9A57/RcYOu5iiqYRK7Tt9UFzM0m7KCT7btm1CTFoB7M9C2l6YaeS5AIFXo8gQ==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 25 Mar 2022 10:25:47 +0000
  • Ironport-data: A9a23:nVDW2KtxcIsiCFoKdEml8p/R3efnVLReMUV32f8akzHdYApBsoF/q tZmKWiPM//fZGahLY1/OYyw8xtT6pfcxtYxS1M5qHw1EX4Q+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQyw4bVvqYy2YLjW1jX5 IuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi92IIjpp/9FbSMCOC9ZY45U47DCECig5Jn7I03uKxMAwt1rBUAye4YZ5vx2ESdF8 vlwxDIlN07ZwbjsmfTiF7cq1p9LwMrDZevzvll6yj7UF7A+SI3rSKTW/95Imjw3g6iiGN6AN pdDOGY/MXwsZTVTAFcbFZszlt2Mj3OmaTRqjEDEiLoetj27IAtZj+G2bYu9lsaxbdpRtlaVo CTB5WuRKhMHMN2SzxKV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0Tf8b2u1qRzi103J1ysv0WbrzRuijX7qsaXCNUUHIvsEobgcXgrS6kImst05+r lMxXilu51eCg6FtDjh5vDTPisa2XackD4Hq6o+nnZfWYwRZPt6tooE5n5YF58GAWbT9J0nKu 9zF8vRjcwmPW9yV0qp/1WH/ebcHkjaRny9Mws/U42uonVrdUlCvgUlLJd1pAZDyHo/I6M0k9 gsfJ4Y0Y2mdfVmHp6VNN1xMfdfNVa9My4kEFjiV2gPR5t3ck4klfbMkcAIDaeRCdg18Kc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Mar 24, 2022 at 12:27:02PM -0400, Tamas K Lengyel wrote:
> On Thu, Mar 24, 2022 at 11:51 AM Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> >
> > On Thu, Mar 24, 2022 at 11:15:08AM -0400, Tamas K Lengyel wrote:
> > > On Thu, Mar 24, 2022 at 10:50 AM Roger Pau Monné <roger.pau@xxxxxxxxxx> 
> > > wrote:
> > > >
> > > > On Tue, Mar 22, 2022 at 01:41:37PM -0400, Tamas K Lengyel wrote:
> > > > > +    {
> > > > > +        cd->arch.hvm.mem_sharing.block_interrupts = block_interrupts;
> > > > > +        cd->arch.hvm.mem_sharing.skip_special_pages = 
> > > > > skip_special_pages;
> > > > > +        /* skip mapping the vAPIC page on unpause if skipping 
> > > > > special pages */
> > > > > +        cd->creation_finished = skip_special_pages;
> > > >
> > > > I think this is dangerous. While it might be true at the moment that
> > > > the arch_domain_creation_finished only maps the vAPIC page, there's no
> > > > guarantee it couldn't do other stuff in the future that could be
> > > > required for the VM to be started.
> > >
> > > I understand this domain_creation_finished route could be expanded in
> > > the future to include other stuff, but IMHO we can evaluate what to do
> > > about that when and if it becomes necessary. This is all experimental
> > > to begin with.
> >
> > Maybe you could check the skip_special_pages field from
> > domain_creation_finished in order to decide whether the vAPIC page
> > needs to be mapped?
> 
> Could certainly do that but it means adding experimental code in an
> #ifdef to the vAPIC mapping logic. Technically nothing wrong with that
> but I would prefer keeping all this code in a single-place if
> possible.

I see, while I agree it's best to keep the code contained when
possible, I think in this case it's better to modify the hook,
specially because further changes to domain_creation_finished will
easily spot that this path is special cases for VM forks.

While the code is experimental it doesn't mean it shouldn't be
properly integrated with the rest of the code base.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.