]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stick-table: move the task_queue() call outside of the lock
authorWilly Tarreau <w@1wt.eu>
Sat, 27 May 2023 18:32:05 +0000 (18:32 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Aug 2023 17:03:35 +0000 (19:03 +0200)
The write lock in stktable_requeue_exp() is quite expensive and should
be shortened as much as possible. There's no need for it when calling
task_queue() so let's move it out.

On a 80-thread machine with a peers section, the request rate increased
from 368k to 397k rps.

src/stick_table.c

index a2aa9c4515c31d3769481146225d8230c5ab23f2..ba6e3c430883fd1ef25cb9059ac5a492b3fa15d2 100644 (file)
@@ -565,9 +565,9 @@ void stktable_requeue_exp(struct stktable *t, const struct stksess *ts)
                new_exp = tick_first(expire, old_exp);
        }
 
-       task_queue(t->exp_task);
-
        HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &t->lock);
+
+       task_queue(t->exp_task);
 }
 
 /* Returns a valid or initialized stksess for the specified stktable_key in the