mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-10-27 14:41:28 +01:00
MEDIUM: stick-tables: Remove the table lock
Remove the table lock, it was only protecting the per-table expiration date, and that task is gone.
This commit is contained in:
parent
8bc8a21b25
commit
d5562e31bd
@ -221,8 +221,6 @@ struct stktable {
|
|||||||
unsigned int refcnt; /* number of local peer over all peers sections
|
unsigned int refcnt; /* number of local peer over all peers sections
|
||||||
attached to this table */
|
attached to this table */
|
||||||
unsigned int current; /* number of sticky sessions currently in 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);
|
THREAD_ALIGN(64);
|
||||||
|
|
||||||
struct eb_root updates; /* head of sticky updates sequence tree, uses updt_lock */
|
struct eb_root updates; /* head of sticky updates sequence tree, uses updt_lock */
|
||||||
|
|||||||
@ -732,8 +732,6 @@ void stktable_requeue_exp(struct stktable *t, const struct stksess *ts)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HA_RWLOCK_WRLOCK(STK_TABLE_LOCK, &t->lock);
|
|
||||||
|
|
||||||
while (!HA_ATOMIC_CAS(&t->shards[bucket].next_exp, &old_exp, new_exp)) {
|
while (!HA_ATOMIC_CAS(&t->shards[bucket].next_exp, &old_exp, new_exp)) {
|
||||||
if (new_exp == old_exp)
|
if (new_exp == old_exp)
|
||||||
break;
|
break;
|
||||||
@ -741,8 +739,6 @@ void stktable_requeue_exp(struct stktable *t, const struct stksess *ts)
|
|||||||
new_exp = tick_first(expire, old_exp);
|
new_exp = tick_first(expire, old_exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &t->lock);
|
|
||||||
|
|
||||||
if (t->type == SMP_T_STR)
|
if (t->type == SMP_T_STR)
|
||||||
len = strlen((const char *)ts->key.key);
|
len = strlen((const char *)ts->key.key);
|
||||||
else
|
else
|
||||||
@ -1166,7 +1162,6 @@ int stktable_init(struct stktable *t, char **err_msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
t->updates = EB_ROOT_UNIQUE;
|
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);
|
t->pool = create_pool("sticktables", sizeof(struct stksess) + round_ptr_size(t->data_size) + t->key_size, MEM_F_SHARED);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user