haproxy/ebtree
Willy Tarreau 2c315ee75e BUG/MEDIUM: ebtree: don't set attribute packed without unaligned access support
An alignment issue on Sparc64 with ebtrees was reported in early 2017
here https://www.mail-archive.com/haproxy@formilux.org/msg25937.html and
a similar one was finally reported in issue #512.

The problem has its roots in the fact that 64-bit keys will end up being
unaligned on such archs which do not support unaligned accesses. But on
most platforms supporting unaligned accesses, dealing with smaller nodes
results in better performance.

One of the possible problems caused by attribute packed there is that it
promotes a structure both to be unaligned and unpadded, which may come
with fun if some fields of the struct itself are accessed and such a node
is placed at an unaligned location. It's not a problem for regular unaligned
accesses but may become one for atomic operations such as the CAS on leaf_p
that's used in struct task. In practice we know that this struct is properly
aligned and is a very edge case so this patch adds comments there to remind
to be careful about it.

This patch depends on previous patch "MINOR: compiler: move CPU capabilities
definition from config.h and complete them" and could be backported to all
stable branches. It fixes issues #512 and #9.
2020-02-21 16:32:57 +01:00
..
compiler.h
eb32sctree.c BUG/MAJOR: ebtree/scope: properly tag upper nodes during insertion 2017-11-15 19:43:05 +01:00
eb32sctree.h MINOR: ebtree: save 8 bytes in struct eb32sc_node 2018-10-21 06:56:57 +02:00
eb32tree.c
eb32tree.h CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
eb64tree.c
eb64tree.h CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebimtree.c CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebimtree.h CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebistree.c CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebistree.h CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebmbtree.c CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebmbtree.h CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebpttree.c
ebpttree.h
ebsttree.c CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebsttree.h CLEANUP: fix typos in comments in ebtree 2018-11-18 22:23:15 +01:00
ebtree.c
ebtree.h BUG/MEDIUM: ebtree: don't set attribute packed without unaligned access support 2020-02-21 16:32:57 +01:00
LICENSE