diff mbox

[ovs-dev,10/12] ovsdb: Reorder elements in ovsdb_table_schema structure.

Message ID 1475857062-55311-11-git-send-email-bhanuprakash.bodireddy@intel.com
State Changes Requested
Delegated to: Daniele Di Proietto
Headers show

Commit Message

Bodireddy, Bhanuprakash Oct. 7, 2016, 4:17 p.m. UTC
By reordering the elements in ovsdb_table_schema structure, pad bytes
can be reduced and also a cache line is saved.

Before: structure size:72, holes:2, sum padbytes:10, cachelines:2
After: structure size:64, holes:1, sum padbytes:2, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
---
 ovsdb/table.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jarno Rajahalme Oct. 7, 2016, 9:12 p.m. UTC | #1
Acked-by: Jarno Rajahalme <jarno@ovn.org>

> On Oct 7, 2016, at 9:17 AM, Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> wrote:
> 
> By reordering the elements in ovsdb_table_schema structure, pad bytes
> can be reduced and also a cache line is saved.
> 
> Before: structure size:72, holes:2, sum padbytes:10, cachelines:2
> After: structure size:64, holes:1, sum padbytes:2, cachelines:1
> 
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
> ---
> ovsdb/table.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ovsdb/table.h b/ovsdb/table.h
> index f910d18..69dd649 100644
> --- a/ovsdb/table.h
> +++ b/ovsdb/table.h
> @@ -28,9 +28,9 @@ struct uuid;
> struct ovsdb_table_schema {
>     char *name;
>     bool mutable;
> -    struct shash columns;       /* Contains "struct ovsdb_column *"s. */
> -    unsigned int max_rows;      /* Maximum number of rows. */
>     bool is_root;               /* Part of garbage collection root set? */
> +    unsigned int max_rows;      /* Maximum number of rows. */
> +    struct shash columns;       /* Contains "struct ovsdb_column *"s. */
>     struct ovsdb_column_set *indexes;
>     size_t n_indexes;
> };
> -- 
> 2.4.11
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/ovsdb/table.h b/ovsdb/table.h
index f910d18..69dd649 100644
--- a/ovsdb/table.h
+++ b/ovsdb/table.h
@@ -28,9 +28,9 @@  struct uuid;
 struct ovsdb_table_schema {
     char *name;
     bool mutable;
-    struct shash columns;       /* Contains "struct ovsdb_column *"s. */
-    unsigned int max_rows;      /* Maximum number of rows. */
     bool is_root;               /* Part of garbage collection root set? */
+    unsigned int max_rows;      /* Maximum number of rows. */
+    struct shash columns;       /* Contains "struct ovsdb_column *"s. */
     struct ovsdb_column_set *indexes;
     size_t n_indexes;
 };