mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-06 02:01:01 +01:00
WIP/MEDIUM: stktables: Use a try-lock on the updates list when removing a stksess
This commit is contained in:
parent
b7a0c2ff98
commit
2a271c4a1b
@ -140,7 +140,9 @@ int __stksess_kill(struct stktable *t, struct stksess *ts)
|
|||||||
|
|
||||||
/* ... and that we didn't leave the update list for the tree */
|
/* ... and that we didn't leave the update list for the tree */
|
||||||
if (MT_LIST_INLIST(&ts->upd)) {
|
if (MT_LIST_INLIST(&ts->upd)) {
|
||||||
link = mt_list_lock_full(&ts->upd);
|
link = mt_list_try_lock_full(&ts->upd);
|
||||||
|
if (link.next == NULL)
|
||||||
|
goto out;
|
||||||
if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
|
if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
|
||||||
mt_list_unlock_full(&ts->upd, link);
|
mt_list_unlock_full(&ts->upd, link);
|
||||||
goto out;
|
goto out;
|
||||||
@ -387,7 +389,9 @@ int stktable_trash_oldest(struct stktable *t)
|
|||||||
MT_LIST_DELETE(&ts->pend_updts);
|
MT_LIST_DELETE(&ts->pend_updts);
|
||||||
|
|
||||||
if (MT_LIST_INLIST(&ts->upd)) {
|
if (MT_LIST_INLIST(&ts->upd)) {
|
||||||
link = mt_list_lock_full(&ts->upd);
|
link = mt_list_try_lock_full(&ts->upd);
|
||||||
|
if (link.next == NULL)
|
||||||
|
goto requeue;
|
||||||
if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
|
if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
|
||||||
mt_list_unlock_full(&ts->upd, link);
|
mt_list_unlock_full(&ts->upd, link);
|
||||||
goto requeue;
|
goto requeue;
|
||||||
@ -1046,7 +1050,9 @@ struct task *process_tables_expire(struct task *task, void *context, unsigned in
|
|||||||
*/
|
*/
|
||||||
MT_LIST_DELETE(&ts->pend_updts);
|
MT_LIST_DELETE(&ts->pend_updts);
|
||||||
if (MT_LIST_INLIST(&ts->upd)) {
|
if (MT_LIST_INLIST(&ts->upd)) {
|
||||||
link = mt_list_lock_full(&ts->upd);
|
link = mt_list_try_lock_full(&ts->upd);
|
||||||
|
if (link.next == NULL)
|
||||||
|
goto requeue;
|
||||||
if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
|
if (HA_ATOMIC_LOAD(&ts->ref_cnt)) {
|
||||||
mt_list_unlock_full(&ts->upd, link);
|
mt_list_unlock_full(&ts->upd, link);
|
||||||
goto requeue;
|
goto requeue;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user