From: Willy Tarreau Date: Sat, 27 May 2023 18:32:05 +0000 (+0000) Subject: MINOR: stick-table: move the task_queue() call outside of the lock X-Git-Tag: v2.9-dev3~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=322e4ab9d2ba41dcdd5bc03ca2a2f6805b5d71bd;p=thirdparty%2Fhaproxy.git MINOR: stick-table: move the task_queue() call outside of the lock 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. --- diff --git a/src/stick_table.c b/src/stick_table.c index a2aa9c4515..ba6e3c4308 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -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