mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-27 00:31:22 +02:00
BUG/MINOR: fd/threads: properly dereference fdcache as volatile
In fd_rm_from_fd_list(), we have loops waiting for another change to complete, in case we don't have support for a double CAS. But these ones fail to place a compiler barrier or to dereference the fdcache as a volatile, resulting in an endless loop on the first collision, which is visible when run on MIPS32. No backport needed.
This commit is contained in:
parent
4cc67a2782
commit
abeaff2d54
4
src/fd.c
4
src/fd.c
@ -281,7 +281,7 @@ lock_self:
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
lock_self_next:
|
lock_self_next:
|
||||||
next = fdtab[fd].cache.next;
|
next = pl_deref_int(&fdtab[fd].cache.next);
|
||||||
if (next == -2)
|
if (next == -2)
|
||||||
goto lock_self_next;
|
goto lock_self_next;
|
||||||
if (next <= -3)
|
if (next <= -3)
|
||||||
@ -289,7 +289,7 @@ lock_self_next:
|
|||||||
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.next, &next, -2)))
|
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.next, &next, -2)))
|
||||||
goto lock_self_next;
|
goto lock_self_next;
|
||||||
lock_self_prev:
|
lock_self_prev:
|
||||||
prev = fdtab[fd].cache.prev;
|
prev = pl_deref_int(&fdtab[fd].cache.prev);
|
||||||
if (prev == -2)
|
if (prev == -2)
|
||||||
goto lock_self_prev;
|
goto lock_self_prev;
|
||||||
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.prev, &prev, -2)))
|
if (unlikely(!HA_ATOMIC_CAS(&fdtab[fd].cache.prev, &prev, -2)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user