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

Re: [PATCH 1/9] gnttab: defer allocation of maptrack frames table

  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Sep 2021 16:43:54 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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; bh=Q2f1EWZnO8vB5o8YP7/43ffRbfMbHlhAQBauZVv+dfE=; b=cuwwSlHO44Pu0CtI+5JesZm4ieE08G5ICY7KgXitP/k5l5FTMynXq0COg4IqI6XDbMN4kd8s7ffvYeDTKX7pSz5OWEUO1CEhtKWc2ve2g0roeApN5I8EtQxKilseMmWQRODjZEAbt+iPg/rW0zj85kCE5Nd81vV5GUKMG22FxPm2EgWobVD6hLbBj0B6UIjdvbwBftdL7ufju4sQojIjwL0MT9HcbJKUAnQEHi3gqvMXTbcmI+IAcf3BfIeJFrViGNIJDtkAzlHs7uowZygTM4ZD5xhDDWzQt9CHqrvt4j7m5Aoei9ftcWqRESl7iWJz9jnmTsMPVhrTfM38fa1kxQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bv4Dc8/gSdBkB2dl2gTnrBywWW6QecIEz/XpXvU4XJ7Iww6qSKQmalZoKzWYh8LqOd0eL1NMCx31b0m36LW+puVxmm6ziGfk9JT2iTYCs0T7gYH4HTEZYON5aJo42BHezMmXAeuDNk3z7QIklCpUE+66EvrPE8QqqLGvN5UUt6l92n9BczciVbEqRnX/p4hKd0rLk0jaT7sf0ISyLRRra/xeNQOjkL+1ID0DKzc7jukgTdCugmTDCIBQm13Cp+PMDN3fID+oTHlayuy2AqEjGp91GlqxEvMoC+3VxDDz0cPsCIR6armlB2wCM7SMwQUZX3Bi8D45LjO5ApwE3Ba+bw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 06 Sep 2021 14:44:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.09.2021 16:05, Andrew Cooper wrote:
> On 26/08/2021 11:09, Jan Beulich wrote:
>> By default all guests are permitted to have up to 1024 maptrack frames,
>> which on 64-bit means an 8k frame table. Yet except for driver domains
>> guests normally don't make use of grant mappings. Defer allocating the
>> table until a map track handle is first requested.
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Nack.  This creates new dynamic failures outside the VM's control,
> therefore regressing Xen's usability.

As with the v2 status frames tracking array, the memory demand of
the actual table will typically be quite a bit higher than that of
the frame tracking table. Therefore guests already are at risk of
observing failures from these paths; the increase of that risk from
the change here is typically quite small.

> The maptrack array (and frames for that matter) should be allocated at
> domain creation time, like we do for most other structures in the
> hypervisor.

Structures we allocate at domain creation time are typically ones
which we know will get used (to at least some degree), or where
allocation can't be done later because paths this would be needed on
have no way to indicate respective failure. Neither of this is true
for the maptrack frame table (or the v2 status frame table, for that

This said, I could see us _switch_ to a policy like the one you
describe, or even allow either behavior depending on some kind of
setting. But then this needs to be done consistently for all forms
of resources (e.g. also the gnttab v2 frames, not just the frame

> Furthermore, seeing as this has come up on multiple community calls, I
> will remind you that it is not just Citrix as a downstream which is
> firmly of this opinion.

No-one but you has voiced such an opinion, so far.

> This entire patch should be replaced with one that...
>> ---
>> I continue to be unconvinced that it is a good idea to allow all DomU-s
>> 1024 maptrack frames by default.
> ... defaults to something smaller for plain domUs, because this improves
> the general case without leaving VMs more liable to crash at runtime.

Just to continue to waste memory? Or to force the admin to know very
precisely how many maptrack entries a guest may need to create, such
that they will neither cause large amounts of unused memory nor risk
the guest running out of handles?




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