The current placement of fields in struct dt_device_node is not optimal and
introduces holes due to fields alignment.
Checked with "'pahole xen-syms -C dt_device_node"
ARM64 size 144B, 16B holes:
/* size: 144, cachelines: 3, members: 15 */
/* sum members: 128, holes: 3, sum holes: 16 */
/* last cacheline: 16 bytes */
ARM32 size 72B, 4B holes
/* size: 72, cachelines: 2, members: 15 */
/* sum members: 68, holes: 2, sum holes: 4 */
/* last cacheline: 8 bytes */
This patch optimizes size of struct dt_device_node by rearranging its
field, which eliminates holes and reduces structure size by 16B(ARM64) and
4B(ARM32).
After ARM64 size 128B, no holes (-16B):
/* size: 128, cachelines: 2, members: 15 */
After ARM32 size 68B, no holes (-4B)
/* size: 68, cachelines: 2, members: 15 */
/* last cacheline: 4 bytes */
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
struct dt_device_node {
const char *name;
const char *type;
- dt_phandle phandle;
char *full_name;
+ dt_phandle phandle;
domid_t used_by; /* By default it's used by dom0 */
- struct dt_property *properties;
- struct dt_device_node *parent;
- struct dt_device_node *child;
- struct dt_device_node *sibling;
- struct dt_device_node *next; /* TODO: Remove it. Only use to know the last children */
- struct dt_device_node *allnext;
-
/* IOMMU specific fields */
bool is_protected;
bool static_evtchn_created;
#endif
+ struct dt_property *properties;
+ struct dt_device_node *parent;
+ struct dt_device_node *child;
+ struct dt_device_node *sibling;
+ struct dt_device_node *next; /* TODO: Remove it. Only use to know the last children */
+ struct dt_device_node *allnext;
+
/*
* The main purpose of this list is to link the structure in the list
* of devices assigned to domain.