[PATCH v2 0/4] util/interval-tree: Avoid race conditions without optimization

Richard Henderson posted 4 patches 9 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230722214422.118743-1-richard.henderson@linaro.org
util/interval-tree.c | 79 +++++++++++++++++++++++++++-----------------
1 file changed, 48 insertions(+), 31 deletions(-)
[PATCH v2 0/4] util/interval-tree: Avoid race conditions without optimization
Posted by Richard Henderson 9 months, 2 weeks ago
Read the left and right trees once, so that the gating
tests are meaningful.  This was only a problem at -O0,
where the compiler didn't CSE the two reads.

Changes for v2:
  * Use qatomic_read for left/right while searching (pmm)
  * Use qatomic_set_mb when inserting a new node, so that
    we're sure that the new node is consistent.
  * Abundance of caution: Use qatomic_read/set for manipulating parent.


r~


Richard Henderson (4):
  util/interval-tree: Use qatomic_read for left/right while searching
  util/interval-tree: Use qatomic_set_mb in rb_link_node
  util/interval-tree: Introduce pc_parent
  util/interval-tree: Use qatomic_read/set for rb_parent_color

 util/interval-tree.c | 79 +++++++++++++++++++++++++++-----------------
 1 file changed, 48 insertions(+), 31 deletions(-)

-- 
2.34.1