Skip to content

Commit

Permalink
timeval: Reorder elements in clock structure.
Browse files Browse the repository at this point in the history
By reordering the elements in clock structure, pad bytes
can be reduced and also a cache line is saved.

Before: structure size:136, holes:3, sum padbytes:18, cachelines:3
After: structure size:120, holes:1, sum padbytes:2, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <[email protected]>
Co-authored-by: Antonio Fischetti <[email protected]>
Signed-off-by: Antonio Fischetti <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
Acked-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
2 people authored and ddiproietto committed Oct 18, 2016
1 parent 0a0b5a7 commit db2e457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/timeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ struct clock {
clockid_t id; /* CLOCK_MONOTONIC or CLOCK_REALTIME. */

/* Features for use by unit tests. Protected by 'mutex'. */
struct ovs_mutex mutex;
atomic_bool slow_path; /* True if warped or stopped. */
struct timespec warp OVS_GUARDED; /* Offset added for unit tests. */
bool stopped OVS_GUARDED; /* Disable real-time updates if true. */
struct ovs_mutex mutex;
struct timespec warp OVS_GUARDED; /* Offset added for unit tests. */
struct timespec cache OVS_GUARDED; /* Last time read from kernel. */
struct large_warp large_warp OVS_GUARDED; /* Connection information waiting
for warp response. */
Expand Down

0 comments on commit db2e457

Please sign in to comment.