diff mbox

[5/8] gnttab: re-arrange struct active_grant_entry

Message ID 59932422020000780016FED2@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich Aug. 15, 2017, 2:41 p.m. UTC
While benign to 32-bit arches, this shrinks the size from 56 to 48
bytes on 64-bit ones (while still leaving a 16-bit hole).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper Aug. 15, 2017, 5:12 p.m. UTC | #1
On 15/08/17 15:41, Jan Beulich wrote:
> While benign to 32-bit arches, this shrinks the size from 56 to 48
> bytes on 64-bit ones (while still leaving a 16-bit hole).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

There is some follow-on is_sub_page type cleanup you could do,
especially in acquire_grant_for_copy().

~Andrew
diff mbox

Patch

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -160,15 +160,15 @@  shared_entry_header(struct grant_table *
 struct active_grant_entry {
     uint32_t      pin;    /* Reference count information.             */
     domid_t       domid;  /* Domain being granted access.             */
-    struct domain *trans_domain;
+    unsigned int  start:15; /* For sub-page grants, the start offset
+                               in the page.                           */
+    bool          is_sub_page:1; /* True if this is a sub-page grant. */
+    unsigned int  length:16; /* For sub-page grants, the length of the
+                                grant.                                */
     grant_ref_t   trans_gref;
+    struct domain *trans_domain;
     unsigned long frame;  /* Frame being granted.                     */
     unsigned long gfn;    /* Guest's idea of the frame being granted. */
-    unsigned      is_sub_page:1; /* True if this is a sub-page grant. */
-    unsigned      start:15; /* For sub-page grants, the start offset
-                               in the page.                           */
-    unsigned      length:16; /* For sub-page grants, the length of the
-                                grant.                                */
     spinlock_t    lock;      /* lock to protect access of this entry.
                                 see docs/misc/grant-tables.txt for
                                 locking protocol                      */