Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Dmitry Vyukov via lttng-dev <lttng-dev@lists.lttng.org>
To: Olivier Dion <odion@efficios.com>
Cc: lttng-dev@lists.lttng.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [lttng-dev] [PATCH 00/11] Add support for TSAN to liburcu
Date: Wed, 17 May 2023 12:57:36 +0200	[thread overview]
Message-ID: <CACT4Y+Z8c30QQ3KFTaMq1Zgm-5fFCXEpNN3Kc9KWC+xzRkTzRQ@mail.gmail.com> (raw)
In-Reply-To: <CACT4Y+YFNRKTgA=s8+ntiwEsRVq9WAR2pBF3toyiGe08mUQ4Gg@mail.gmail.com>

I've skimmed through the changes. They look sane. You know what you
are doing. So unless you have any other open issues, I don't have much
to add.

On Wed, 17 May 2023 at 12:21, Dmitry Vyukov <dvyukov@google.com> wrote:
> > Hi Dmitry,
> >
> > > Where can I see the actual changes? Preferably side-by-side diffs with
> > > full context. Are they (or can they be) uploaded somewhere on
> > > github/gerrit?
> >
> > Here's the link to the first patch of the set on our Gerrit
> > <https://review.lttng.org/c/userspace-rcu/+/9737>.
> >
> > > Are there any remaining open questions?
> >
> > On the Gerrit no.  But I would add this for the known issues:
> >
> > We have a regression test for forking.  We get the following when
> > running it:
> >
> > ==23432==ThreadSanitizer: starting new threads after multi-threaded fork is not supported. Dying (set die_after_fork=0 to override)
>
> > With TSAN_OPTIONS=die_after_fork=0, here are the results for GCC and
> > Clang.
> >
> > * gcc 11.3.0
> >   ==25266==ThreadSanitizer: dup thread with used id 0x7fd40dafe600
> >
> >   Looks like this was fixed with recent merged of TSAN in gcc 13.
> >
> > * clang 14.0.6
>
> Hi Olivier,
>
> Forking under tsan is a bit tricky. But I see we now take a number of
> internal mutexes around  fork (but I think still not all of them), so
> maybe it's not that bad. If  TSAN_OPTIONS=die_after_fork=0 works
> reasonably reliably for you, then export it for testing.
>
> Older compilers are missing a number of bug fixes.
> So if you can restrict testing to newer compilers only, that's the way to go.
>
>
> > Tests pass but are very slow.  This seems to be because we're calling
> > exit(3) in the childs.  Changing it to _exit(2) solves the issue.  The
> > only thing I can think of is that exit(3) is not async-signal-safe like
> > _exit(2), yet we do other none-async safe calls like malloc(3) and
> > free(3) in the childs.
>
> By default tsan sleeps for 1 second at exit, since exit sequence is a
> common source of races. Perhaps it's just these sleeps. Try
> TSAN_OPTIONS=atexit_sleep_ms=0 (or maybe =50).
>
>
> > Here are some perf records of that:
> >
> > With exit(3)
> > ```
> >   12.35%  test_urcu_fork.  [unknown]                [k] 0xffffffff89ebd22b
> >    8.69%  test_urcu_fork.  [unknown]                [k] 0xffffffff89ebd8fa
> >    7.50%  test_urcu_fork.  [unknown]                [k] 0xffffffff8a001360
> >    6.11%  test_urcu_fork.  test_urcu_fork.tap       [.] __sanitizer::internal_memset
> >    5.85%  test_urcu_fork.  test_urcu_fork.tap       [.] __tsan::ForkChildAfter
> >    1.96%  test_urcu_fork.  [unknown]                [k] 0xffffffff892f8efd
> >    1.88%  test_urcu_fork.  [unknown]                [k] 0xffffffff89ec8e2c
> >    1.29%  test_urcu_fork.  [unknown]                [k] 0xffffffff890a99d1
> >    0.79%  test_urcu_fork.  [unknown]                [k] 0xffffffff8918c566
> >    0.75%  test_urcu_fork.  test_urcu_fork.tap       [.] __sanitizer::ThreadRegistry::OnFork
> >    0.71%  test_urcu_fork.  [unknown]                [k] 0xffffffff89349574
> >    0.64%  test_urcu_fork.  [unknown]                [k] 0xffffffff89ee424f
> >    0.57%  test_urcu_fork.  test_urcu_fork.tap       [.] __tsan::MetaMap::AllocBlock
> >    0.55%  test_urcu_fork.  [unknown]                [k] 0xffffffff89367249
> >    0.53%  test_urcu_fork.  test_urcu_fork.tap       [.] __tsan_read8
> >    0.51%  test_urcu_fork.  [unknown]                [k] 0xffffffff89ec8e05
> > ```
> >
> > With _exit(2)
> > ```
> >   12.26%  test_urcu_fork.  [unknown]             [k] 0xffffffff89ebd8fa
> >    9.51%  test_urcu_fork.  [unknown]             [k] 0xffffffff89ebd22b
> >    6.78%  test_urcu_fork.  test_urcu_fork.tap    [.] __sanitizer::internal_memset
> >    6.49%  test_urcu_fork.  [unknown]             [k] 0xffffffff8a001360
> >    4.92%  test_urcu_fork.  test_urcu_fork.tap    [.] __tsan::ForkChildAfter
> >    2.92%  test_urcu_fork.  [unknown]             [k] 0xffffffff892f8efd
> >    2.19%  test_urcu_fork.  [unknown]             [k] 0xffffffff89ec8e2c
> >    1.88%  test_urcu_fork.  [unknown]             [k] 0xffffffff890a99d1
> >    0.83%  test_urcu_fork.  test_urcu_fork.tap    [.] __tsan::MetaMap::AllocBlock
> >    0.72%  test_urcu_fork.  [unknown]             [k] 0xffffffff892f8f1c
> >    0.67%  test_urcu_fork.  [unknown]             [k] 0xffffffff8918c566
> >    0.65%  test_urcu_fork.  [unknown]             [k] 0xffffffff89ec16dd
> >    0.62%  test_urcu_fork.  test_urcu_fork.tap    [.] __sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator32<__sanitizer::AP32>, __sanitizer::LargeMmapAllocatorPtrArrayStatic>::Allocate
> >    0.61%  test_urcu_fork.  test_urcu_fork.tap    [.] __tsan_write4
> >    0.60%  test_urcu_fork.  [unknown]             [k] 0xffffffff89367249
> >    0.59%  test_urcu_fork.  [unknown]             [k] 0xffffffff89ee424f
> >    0.50%  test_urcu_fork.  test_urcu_fork.tap    [.] __sanitizer::ThreadRegistry::OnFork
> >    0.50%  test_urcu_fork.  test_urcu_fork.tap    [.] __tsan_write8
> >    0.47%  test_urcu_fork.  test_urcu_fork.tap    [.] __tsan::ForkBefore
> >    0.45%  test_urcu_fork.  test_urcu_fork.tap    [.] __tsan_func_entry
> > ```
> >
> > > Is there CI coverage with -fsanitize=thread?
> >
> > Since the urcu-signal flavor deadlocks with TSAN (see reproducer in
> > commit log), the CI simply timeouts.  I do however have a job with TSAN
> > as an matrix axis here <https://ci.lttng.org/job/dev_odion_liburcu/>.
>
> Sounds good.
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

  reply	other threads:[~2023-05-17 10:58 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 [this message]
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
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=CACT4Y+Z8c30QQ3KFTaMq1Zgm-5fFCXEpNN3Kc9KWC+xzRkTzRQ@mail.gmail.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=dvyukov@google.com \
    --cc=odion@efficios.com \
    --cc=paulmck@kernel.org \
    /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