Commit 97795be
committed
tsan: optimize test-only barrier
The updated lots_of_threads.c test with 300 threads
started running for too long on machines with low
hardware parallelism (e.g. taskset -c 0-1).
On lots of CPUs it finishes in ~2 secs. But with
taskset -c 0-1 it runs for hundreds of seconds
effectively spinning in the barrier in the sleep loop.
We now have the handy futex API in sanitizer_common.
Use it instead of the passive spin loop.
It makes the test run only faster with taskset -c 0-1,
it runs for ~1.5 secs, while with full parallelism
it still runs for ~2 secs (but consumes less CPU time).
Depends on D107131.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D1071321 parent dbe36e4 commit 97795be
File tree
2 files changed
+24
-18
lines changed- compiler-rt
- lib/tsan/rtl
- test/tsan
2 files changed
+24
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2916 | 2916 | | |
2917 | 2917 | | |
2918 | 2918 | | |
2919 | | - | |
2920 | | - | |
| 2919 | + | |
| 2920 | + | |
2921 | 2921 | | |
2922 | | - | |
2923 | | - | |
2924 | | - | |
2925 | | - | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
2926 | 2926 | | |
2927 | 2927 | | |
2928 | 2928 | | |
2929 | 2929 | | |
2930 | | - | |
| 2930 | + | |
2931 | 2931 | | |
2932 | 2932 | | |
2933 | | - | |
2934 | | - | |
2935 | | - | |
2936 | | - | |
2937 | | - | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
2938 | 2945 | | |
2939 | | - | |
2940 | | - | |
2941 | | - | |
2942 | | - | |
2943 | | - | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
2944 | 2950 | | |
2945 | 2951 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments