MINOR: stick-tables: remove the uneeded read lock in stksess_free()

During changes made in 2.7 by commits 8d3c3336f9 ("MEDIUM: stick-table:
make stksess_kill_if_expired() avoid the exclusive lock") and 996f1a5124
("MEDIUM: stick-table: do not take a lock to update t->current anymore."),
the operation was done cautiously one baby step at a time and the final
cleanup was not done, as we're keeping a read lock under an atomic dec.
Furthermore there's a pool_free() call under that lock, and we try to
avoid pool_alloc() and pool_free() under locks for their nasty side
effects (e.g. when memory gets recompacted), so let's really drop it
now.

Note that the performance gain is not really perceptible here, it's
essentially for code clarity reasons that this has to be done.
This commit is contained in:
Willy Tarreau 2024-05-23 20:31:45 +02:00
parent 8580f9db20
commit 0bda33a3ec

View File

@ -130,9 +130,7 @@ void stksess_free(struct stktable *t, struct stksess *ts)
/* make the compiler happy when shard is not used without threads */
ALREADY_CHECKED(shard);
HA_RWLOCK_RDLOCK(STK_TABLE_LOCK, &t->shards[shard].sh_lock);
__stksess_free(t, ts);
HA_RWLOCK_RDUNLOCK(STK_TABLE_LOCK, &t->shards[shard].sh_lock);
}
/*