[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



On 12.09.22 10:11, Jan Beulich wrote:
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.

Only leaving aside DEBUG_LOCK_PROFILE. DEBUG_LOCKS doesn't matter regarding
struct active_grant_entry size.


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?

Oh, maybe I mixed those two cases up.

--- 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)?

I'd prefer the rename to src_domid (orig_domid sounds for me like an old
value of domid).


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

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