Message ID | 1504893565-110166-5-git-send-email-bhanuprakash.bodireddy@intel.com |
---|---|
State | Accepted |
Headers | show |
Series | Rearrange structure members for memory efficiency. | expand |
diff --git a/lib/ct-dpif.h b/lib/ct-dpif.h index d5f9661..ba4cb39 100644 --- a/lib/ct-dpif.h +++ b/lib/ct-dpif.h @@ -156,6 +156,8 @@ struct ct_dpif_entry { uint16_t zone; /* Modifiable members. */ + bool have_labels; + ovs_u128 labels; struct ct_dpif_counters counters_orig; struct ct_dpif_counters counters_reply; @@ -163,9 +165,8 @@ struct ct_dpif_entry { struct ct_dpif_timestamp timestamp; struct ct_dpif_protoinfo protoinfo; - ovs_u128 labels; - bool have_labels; uint32_t status; + /* Timeout for this entry in seconds */ uint32_t timeout; uint32_t mark;
By reordering elements in ct_dpif_entry structure, sum holes and pad bytes can be reduced. Before: structure size: 232, sum holes: 5, pad bytes: 4, cachelines:4 After : structure size: 224, sum holes: 1, pad bytes: 0, cachelines:4 Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> --- lib/ct-dpif.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)