|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] xen/gnttab: Shrink struct gnttab_copy_buf
Move the booleans into earlier padding. No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Anthony PERARD <anthony.perard@xxxxxxxxxx>
CC: Michal Orzel <michal.orzel@xxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
On 64bit, this shrinks from 64 bytes to 56 bytes.
On arm32, it's 40 bytes before and after. Given that we can't reuse the
tail-padding from struct gnttab_copy_ptr, I'm not sure there's an obvious
improvement to be had:
xen.git/xen$ pahole xen-syms-arm32-after -E -C gnttab_copy_buf
struct gnttab_copy_buf {
struct gnttab_copy_ptr {
union {
/* typedef grant_ref_t -> uint32_t */ unsigned int ref;
/* 0 4 */
/* typedef xen_pfn_t -> uint64_t */ long long unsigned
int gmfn; /* 0 8 */
} u;
/* 0 8 */
/* typedef domid_t -> uint16_t */ short unsigned int domid;
/* 8 2 */
/* typedef uint16_t */ short unsigned int offset;
/* 10 2 */
}ptr; /* 0 16 */
/* XXX last struct has 4 bytes of padding */
/* typedef uint16_t */ short unsigned int len;
/* 16 2 */
_Bool read_only;
/* 18 1 */
_Bool have_grant;
/* 19 1 */
_Bool have_type;
/* 20 1 */
/* XXX 3 bytes hole, try to pack */
struct domain * domain;
/* 24 4 */
/* typedef mfn_t */ struct {
long unsigned int mfn;
/* 28 4 */
} mfn; /* 28 4 */
struct page_info * page;
/* 32 4 */
void * virt;
/* 36 4 */
/* size: 40, cachelines: 1, members: 9 */
/* sum members: 37, holes: 1, sum holes: 3 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 40 bytes */
};
---
xen/common/grant_table.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5e79c012b695..d2c3c73be900 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2927,13 +2927,14 @@ struct gnttab_copy_buf {
uint16_t len;
/* Mapped etc. */
+ bool read_only;
+ bool have_grant;
+ bool have_type;
+
struct domain *domain;
mfn_t mfn;
struct page_info *page;
void *virt;
- bool read_only;
- bool have_grant;
- bool have_type;
};
static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
base-commit: 2043d22b7e926f508cc23391b4c75325fa7211e9
--
2.39.5
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |