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

Re: [PATCH 2/2] xen/gnttab: reduce size of struct active_grant_entry


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 12 Sep 2022 10:11:34 +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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=emMbKCssggZ0MZ0oNAde9DnrhL345ZbHg7vU6va+QGI=; b=kxF+SdQR6wgMgOgwf25frhuac0eOYatWnm/hxyAbh5DgPfsYZ8an7o0NrJRX2/ql/CjE2R0dAASVGzIyYj+5tXeJ9znY+YgPQM3/h5MuoCVmAuIgjuNMElb7M9LogxpK8CVdbyxDfc99fqTOg+vZptD8Gg1Yi1pnp7pqeb2T0oWi6WcshAFRqPmTpcefzRZOXBdyKEDeaB9oIz0O2IFJZQpwI3hZB5AhhnIKcqBzRYkhSWtahqDV7XoXFwVETBNpgm8twGR3VVjq/y9kToJl5fDYPku3KeZwfuZNcagHLwV5zZKbczAQEoLiwInvX3KyclWVuwFoNEtHLShyd0mJLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YM63gipaD2auCeehwYlzfC4VrE5B7SC3J7i20sPM1S8HkzGYhrBhYnE+INKgP0Ma8tI5gAhKubwjpQCEZzPo9RHZPGPnAzk67VL62MvfjY1/jtwtUqReMMaOSwqVLUOG48Jao8qSU0RN52r0OJeGz5HgqSUwg46wOAcBuHgbNLxcHzPOtmQmT7mjeqDZY+4tVTeYeQMRB0c31r+orh56gEeozCzKqEp8a32aVlSsgc3ioRjYHVmxmL/o19JLmb0dZWBCmTG+c2i5IIy4i+bZeJu82Aqhz0FQ6YSuqDDzso+ZwgbN9LqBvn9itXf6bqk31y3n6AT+fuU6hggMpvwbOw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 12 Sep 2022 08:11:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.09.2022 07:53, Juergen Gross wrote:
> The size of struct active_grant_entry for 64-bit builds is 40 or 48
> bytes today (with or without NDEBUG).

... and leaving aside DEBUG_LOCKS / DEBUG_LOCK_PROFILE.

> It can easily be reduced by 8 bytes by replacing the trans_domain
> pointer with the domid of the related domain. trans_domain is only ever
> used for transitive grants, which last known user has been the old
> Xenolinux branch of the Linux kernel.

That tree used grant transfers, but I'm unaware of (actual) uses of
transitive grants; there may have been code there to allow their
use, but iirc that would then not have had any users. Or am I
mis-remembering?

> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -381,13 +381,13 @@ struct active_grant_entry {
>  })
>  
>      domid_t       domid;  /* Domain being granted access.             */
> +    domid_t       trans_domid; /* Domain granting access.             */

I'm afraid I consider the comment misleading and not in line with
field name. For normal grants this is merely the "source" domain
(i.e. "granting" in the comment is correct, but "trans" in the
name isn't), while for transitive grants there are two domains
granting access. Therefore may I suggest to use src_domid or
orig_domid, or otherwise omit the comment (just like there was
none originally)?

Jan



 


Rackspace

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