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

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



On 15.09.22 13:50, Jan Beulich wrote:
On 13.09.2022 11:32, Juergen Gross wrote:
The size of struct active_grant_entry for 64-bit builds is 40 or 48
bytes today (with or without NDEBUG).

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 doesn't have any known users.

This reduction will result in less memory usage and (for production
builds) in faster code, as indexing into the active_grant_entry array
will be much easier with an entry having a power-of-2 size.

The performance loss when using transitive grants shouldn't really
matter, given the probability that those aren't in use at all.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
V2:
- rename trans_domid to src_domid (Jan Beulich)
---
  xen/common/grant_table.c | 13 +++++++------
  1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index fba329dcc2..59342df3b7 100644
--- 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       src_domid; /* Domain granting access.               */

I'm afraid I still view the comment as ambiguous, for there being two
domains involved in granting access for transitive grants. Preferably
with e.g "Original" added (which of course could be done by the
committer, provided this isn't lost by the time 4.18 opens),
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks.

I'll just send an updated V3 (probably tomorrow).


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®.