From: "Ondřej Surý via lttng-dev" <lttng-dev@lists.lttng.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Olivier Dion <odion@efficios.com>,
tsan-users <tsan-users@google.com>,
lttng-dev@lists.lttng.org,
"Paul E. McKenney" <paulmck@kernel.org>,
Tony Finch <fanf@isc.org>
Subject: Re: [lttng-dev] [PATCH 00/11] Add support for TSAN to liburcu
Date: Fri, 26 May 2023 07:33:20 +0200 [thread overview]
Message-ID: <EFA4F8F7-0767-4FEF-8EA5-DDEA05F3296C@sury.org> (raw)
In-Reply-To: <CACT4Y+a22N7gvcePvBazN_=AyeigVaeH-nFX-ZqZbq49mftMPg@mail.gmail.com>
A little bit related question/problem - some of our system test jobs got significantly slower (3x-5x) with **clang-16** TSAN after we integrated liburcu to BIND 9. The GCC (13.1.1) TSAN doesn’t exhibit this behavior.
The liburcu integration in BIND 9 is very light at the moment - we use liburcu for qptrie and there’s some usage of wfcqueue for queuing jobs(callbacks) between threads.
We were not able to put a finger on it yet, but saying this aloud might help diagnose this.
Ondrej
--
Ondřej Surý <ondrej@sury.org> (He/Him)
> On 24. 5. 2023, at 10:15, Dmitry Vyukov via lttng-dev <lttng-dev@lists.lttng.org> wrote:
>
> On Tue, 23 May 2023 at 18:05, Olivier Dion <odion@efficios.com> wrote:
>>
>> Hi Dmitry,
>>
>> We do have a new issue and we think it might be a limitation from TSAN.
>>
>> Find attached a test program that we believe is correct. You can
>> compile it with `gcc -fsanitize=thread test.c -pthread'.
>>
>>
>> TSAN flags a race condition between the atomic store relaxed at line 36
>> and the free at line 81.
>>
>> We can solve the issue by replacing the atomic store relaxed with a
>> atomic store release. However, the preceding atomic exchange with
>> sequential consistency already acts as an implicit release (in term of
>> memory barrier) for the following store, making the release semantic
>> redundant.
>>
>> We've found an alternative to fix this by ignoring the thread during the
>> relaxed store (line 39). However, what we would like is to annotate the
>> memory stored (line 45).
>>
>> My theory (I don't know the internal of TSAN much) is that TSAN thinks
>> for some reason that the atomic store relaxed happen at the same epoch
>> as the free, resulting in a false positive. If so, m
>
>
> I don't this this is true in the C/C++ memory model:
> "the preceding atomic exchange with sequential consistency already
> acts as an implicit release (in term of memory barrier) for the
> following store".
>
> std::atomic_thread_fence does affect all preceding/subsequent
> operations, but an atomic memory operation only affects ordering on
> that variable, it doesn't also serve as a standalone memory fence.
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
next prev parent reply other threads:[~2023-05-26 5:33 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 20:17 Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 01/11] configure: Add --disable-atomic-builtins option Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 02/11] urcu/uatomic: Use atomic builtins if configured Olivier Dion via lttng-dev
2023-06-21 23:19 ` Paul E. McKenney via lttng-dev
2023-06-22 15:55 ` Mathieu Desnoyers via lttng-dev
2023-06-22 18:32 ` Paul E. McKenney via lttng-dev
2023-06-22 19:53 ` Olivier Dion via lttng-dev
2023-06-22 19:56 ` Mathieu Desnoyers via lttng-dev
2023-06-22 20:10 ` Olivier Dion via lttng-dev
2023-06-22 20:11 ` Paul E. McKenney via lttng-dev
2023-06-22 19:54 ` Mathieu Desnoyers via lttng-dev
2023-06-29 17:22 ` Olivier Dion via lttng-dev
2023-06-29 17:27 ` Olivier Dion via lttng-dev
2023-06-29 18:33 ` Mathieu Desnoyers via lttng-dev
2023-06-29 18:29 ` Mathieu Desnoyers via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 03/11] urcu/compiler: " Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 04/11] urcu/arch/generic: " Olivier Dion via lttng-dev
2023-06-21 23:22 ` Paul E. McKenney via lttng-dev
2023-06-22 0:53 ` Olivier Dion via lttng-dev
2023-06-22 1:48 ` Mathieu Desnoyers via lttng-dev
2023-06-22 3:44 ` Paul E. McKenney via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 05/11] urcu/system: " Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 06/11] urcu/uatomic: Add CMM memory model Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 07/11] urcu-wait: Fix wait state load/store Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 08/11] tests: Use uatomic for accessing global states Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 09/11] benchmark: " Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 10/11] tests/unit/test_build: Quiet unused return value Olivier Dion via lttng-dev
2023-05-15 20:17 ` [lttng-dev] [PATCH 11/11] urcu/annotate: Add CMM annotation Olivier Dion via lttng-dev
2023-05-16 15:57 ` Olivier Dion via lttng-dev
2023-05-16 8:18 ` [lttng-dev] [PATCH 00/11] Add support for TSAN to liburcu Dmitry Vyukov via lttng-dev
2023-05-16 15:47 ` Olivier Dion via lttng-dev
2023-05-17 10:21 ` Dmitry Vyukov via lttng-dev
2023-05-17 10:57 ` Dmitry Vyukov via lttng-dev
2023-05-17 14:44 ` Olivier Dion via lttng-dev
2023-05-23 16:05 ` Olivier Dion via lttng-dev
2023-05-24 8:14 ` Dmitry Vyukov via lttng-dev
2023-05-26 5:33 ` Ondřej Surý via lttng-dev [this message]
2023-05-26 6:08 ` Dmitry Vyukov via lttng-dev
2023-05-26 6:10 ` Dmitry Vyukov via lttng-dev
2023-05-26 10:06 ` Ondřej Surý via lttng-dev
2023-05-26 10:08 ` Dmitry Vyukov via lttng-dev
2023-05-26 14:20 ` Olivier Dion via lttng-dev
2023-05-26 15:15 ` Olivier Dion via lttng-dev
2023-05-17 14:44 ` Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 00/12] " Olivier Dion via lttng-dev
2023-06-07 19:04 ` Ondřej Surý via lttng-dev
2023-06-07 19:20 ` Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 01/12] configure: Add --disable-atomic-builtins option Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 02/12] urcu/compiler: Use atomic builtins if configured Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 03/12] urcu/arch/generic: " Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 04/12] urcu/system: " Olivier Dion via lttng-dev
2023-06-21 23:23 ` Paul E. McKenney via lttng-dev
2023-07-04 14:43 ` Olivier Dion via lttng-dev
2023-07-05 18:48 ` Paul E. McKenney via lttng-dev
2023-07-05 19:03 ` Olivier Dion via lttng-dev
2023-07-05 19:28 ` Paul E. McKenney via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 05/12] urcu/uatomic: Add CMM memory model Olivier Dion via lttng-dev
2023-06-21 23:28 ` Paul E. McKenney via lttng-dev
2023-06-29 16:49 ` Olivier Dion via lttng-dev
2023-06-29 18:40 ` Paul E. McKenney via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 06/12] urcu-wait: Fix wait state load/store Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 07/12] tests: Use uatomic for accessing global states Olivier Dion via lttng-dev
2023-06-21 23:37 ` Paul E. McKenney via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 08/12] benchmark: " Olivier Dion via lttng-dev
2023-06-21 23:38 ` Paul E. McKenney via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 09/12] tests/unit/test_build: Quiet unused return value Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 10/12] urcu/annotate: Add CMM annotation Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 11/12] Add cmm_emit_legacy_smp_mb() Olivier Dion via lttng-dev
2023-06-07 18:53 ` [lttng-dev] [PATCH v2 12/12] tests: Add tests for checking race conditions Olivier Dion via lttng-dev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EFA4F8F7-0767-4FEF-8EA5-DDEA05F3296C@sury.org \
--to=lttng-dev@lists.lttng.org \
--cc=dvyukov@google.com \
--cc=fanf@isc.org \
--cc=odion@efficios.com \
--cc=ondrej@sury.org \
--cc=paulmck@kernel.org \
--cc=tsan-users@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox