-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify and clean up TSan annotations #12746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I didn't coauthored this one but it looks good anyway!
Thank you for your reviews. I put back the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved on @fabbing and @dustanddreams' behalf.
Needs a Change entry. |
(It looks like this needs a rebase again?) |
181cc83
to
15d7498
Compare
Sorry, rebased now. |
I deleted the branch by mistake again… |
87b0e19
to
bab2cbe
Compare
bab2cbe
to
5e07293
Compare
In the triaging meeting of 13 Dec, 2023 it was mentioned that this PR would be nice to have in 5.2, I believe. (It does make life easier to reproduce data race reports.) |
I don't remember anything from this PR but I approved above and would be happy to merge a version if the conflicts are fixed. It looks like whenever I look at it, it needs a rebase (maybe you should do the trick of inserting your Changes entry in a somewhat sorted position, instead of at the end?). Let's merge in 5.2 as well, indeed. |
Instead of un-instrumenting an entire function, let's un-instrument a single load.
I can no longer trigger any data race reports on the functions involved.
5e07293
to
7c68489
Compare
That’s a nice trick! Rebased again. |
@Octachron these refactoring changes were reviewed, agreed-upon and approved a month ago, can you confirm that including them in 5.2, the first TSan release, is the correct move? |
(I'm adding the milestone here not to force inclusion, but so that we do not forget to discuss this again.) |
Cleaning up the TSAN annotations before the first release is indeed a good idea. Let's cherry-pick those simplifications to 5.2 . |
Simplify and clean up TSan annotations (cherry picked from commit de25c38)
Done in fb7aa7e, thanks! |
While working on removing the last known data races in the runtime, I had to update a number of TSan-related annotations in the code. The two primary reasons are that #12681 made some of them redundant, and that the distinction between
CAMLno_tsan
andCAMLreally_no_tsan
is confusing and—as I discovered—not really useful in practice.This PR is a collection of arguably independent commits, but on the other hand all of them are very small.
This PR is best reviewed commit by commit:
CAMLreally_no_tsan
as a complement toCAMLno_tsan
. The idea was thatCAMLno_tsan
should be used to de-instrument functions that we don’t want instrumented with--enable-tsan
, whileCAMLreally_no_tsan
de-instruments them in all cases, including when, e.g.,-fsanitize=thread
is passed through theCFLAGS
. However, experience shows that it is vastly more convenient to chase data races in the runtime using--enable-tsan
than by modifying CFLAGS. As a consequence,CAMLreally_no_tsan
is not really relevant anymore. I replace the pairCAMLno_tsan
/CAMLreally_no_tsan
withCAMLno_tsan
/CAMLno_tsan_for_perf
. Functions markedCAMLno_tsan
are never instrumented, whereas functions markedCAMLno_tsan_for_perf
are not instrumented to save performance, except whenTSAN_INSTRUMENT_ALL
is defined. DefiningTSAN_INSTRUMENT_ALL
ensure maximum coverage when looking for data races in the runtime.As a consequence, I update the Inria TSan CI to define
TSAN_INSTRUMENT_ALL
.volatile
writes were removed by the merge of Fix TSan false positives due to volatile write handling #12681, and we no longer need to silence the corresponding reports.do_some_marking
function withCAMLno_tsan
, I un-instrumented only the instruction that could cause a false positive.__tsan_default_suppressions
. All of them races are already known (ThreadSanitizer issues #11040). I added twoCAMLno_tsan
annotations to silence those reports until we fixed those races, so that they don’t clog the CI logs.