]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: list: add missing store barriers when updating elements and head
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 10:14:22 +0000 (11:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 14:59:31 +0000 (15:59 +0100)
commit690d2ad4d207da5c8821b84ab467090bd515eedf
tree7238eafd0aecae71dda723bef8f4912de9c7eccf
parent285192564d2a7d6eff077d91758b603ba7f2b10a
BUG/MEDIUM: list: add missing store barriers when updating elements and head

Commit a8434ec14 ("MINOR: lists: Implement locked variations.")
introduced locked lists which use the elements pointers as locks
for concurrent operations. Under heavy stress the lists occasionally
fail. The cause is a missing barrier at some points when updating
the list element and the head : nothing prevents the compiler (or
CPU) from updating the list head first before updating the element,
making another thread jump to a wrong location. This patch simply
adds the missing barriers before these two opeations.

This will have to be backported if the commit above is backported.
include/common/mini-clist.h