]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stick-tables: Remove the table lock
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 9 Oct 2025 16:28:08 +0000 (18:28 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 20 Oct 2025 13:04:47 +0000 (15:04 +0200)
Remove the table lock, it was only protecting the per-table expiration
date, and that task is gone.

include/haproxy/stick_table-t.h
src/stick_table.c

index b8a9f5ab704d8bdceef283647faa1f5afd8f8f65..618ca0cd659a81feaf2c60e7619df0169c44f3ec 100644 (file)
@@ -221,8 +221,6 @@ struct stktable {
        unsigned int refcnt;     /* number of local peer over all peers sections
                                    attached to this table */
        unsigned int current;     /* number of sticky sessions currently in table */
-       __decl_thread(HA_RWLOCK_T lock); /* lock related to the table */
-
        THREAD_ALIGN(64);
 
        struct eb_root updates;   /* head of sticky updates sequence tree, uses updt_lock */
index dc788e5d38b3fdffdb836548c6b6bc45b017418a..e59e8b8fd9a00b5b735bb4b11519c6babff98981 100644 (file)
@@ -732,8 +732,6 @@ void stktable_requeue_exp(struct stktable *t, const struct stksess *ts)
                return;
        }
 
-       HA_RWLOCK_WRLOCK(STK_TABLE_LOCK, &t->lock);
-
        while (!HA_ATOMIC_CAS(&t->shards[bucket].next_exp, &old_exp, new_exp)) {
                if (new_exp == old_exp)
                        break;
@@ -741,8 +739,6 @@ void stktable_requeue_exp(struct stktable *t, const struct stksess *ts)
                new_exp = tick_first(expire, old_exp);
        }
 
-       HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &t->lock);
-
        if (t->type == SMP_T_STR)
                len = strlen((const char *)ts->key.key);
        else
@@ -1166,7 +1162,6 @@ int stktable_init(struct stktable *t, char **err_msg)
                }
 
                t->updates = EB_ROOT_UNIQUE;
-               HA_RWLOCK_INIT(&t->lock);
 
                t->pool = create_pool("sticktables", sizeof(struct stksess) + round_ptr_size(t->data_size) + t->key_size, MEM_F_SHARED);