From: Willy Tarreau Date: Mon, 7 Aug 2023 19:32:36 +0000 (+0200) Subject: CLEANUP: stick-table: slightly reorder the stktable struct X-Git-Tag: v2.9-dev3~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e52c35de4bda277292f25fb987b1500b90f0a68;p=thirdparty%2Fhaproxy.git CLEANUP: stick-table: slightly reorder the stktable struct By moving the config-time stuff after the updt_lock, we can plug some holes without interfering with it. This allows us to get back to the 768-bytes struct. The performance was not affected at all. --- diff --git a/include/haproxy/stick_table-t.h b/include/haproxy/stick_table-t.h index d022de009e..c89c3ec8e7 100644 --- a/include/haproxy/stick_table-t.h +++ b/include/haproxy/stick_table-t.h @@ -187,11 +187,6 @@ struct stktable { void *p; } data_arg[STKTABLE_DATA_TYPES]; /* optional argument of each data type */ struct proxy *proxy; /* The proxy this stick-table is attached to, if any.*/ - struct proxy *proxies_list; /* The list of proxies which reference this stick-table. */ - struct { - const char *file; /* The file where the stick-table is declared. */ - int line; /* The line in this the stick-table is declared. */ - } conf; THREAD_ALIGN(64); @@ -210,8 +205,15 @@ struct stktable { unsigned int commitupdate;/* used to identify the latest local updates pending for sync, uses updt_lock */ THREAD_ALIGN(64); - + /* this lock is heavily used and must be on its own cache line */ __decl_thread(HA_RWLOCK_T updt_lock); /* lock protecting the updates part */ + + /* rarely used config stuff below (should not interfere with updt_lock) */ + struct proxy *proxies_list; /* The list of proxies which reference this stick-table. */ + struct { + const char *file; /* The file where the stick-table is declared. */ + int line; /* The line in this the stick-table is declared. */ + } conf; }; extern struct stktable_data_type stktable_data_types[STKTABLE_DATA_TYPES];