Commit 7c22acc
Serialize JIT entrypoints in free-threaded builds
Summary:
Add a minimal top-level guard for JIT entrypoints in free-threaded builds. The goal is to make the current FT test path reliable by serializing top-level registration, scheduling, compilation, and teardown paths that can now race without the GIL.
A more integrated alternative would be to extend `ThreadedCompileSerialize` to cover these FT entrypoints too, but that is a larger change. In particular, `preload` can re-enter other JIT paths, so folding it into the existing threaded-compile locking model needs more restructuring to avoid lock-ordering problems.
This change is FT-specific and should not change GIL builds. In non-FT builds the new guard is a no-op and should optimize away.
Reviewed By: jbower-fb, DinoV
Differential Revision: D99853055
fbshipit-source-id: 546f122605b307337f2295fc2c43527d8ee2dfd01 parent 1fa50ee commit 7c22acc
3 files changed
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
592 | 599 | | |
593 | 600 | | |
594 | 601 | | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
595 | 605 | | |
596 | 606 | | |
597 | 607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
38 | 69 | | |
39 | 70 | | |
40 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
| 1035 | + | |
1035 | 1036 | | |
1036 | 1037 | | |
1037 | 1038 | | |
| |||
1227 | 1228 | | |
1228 | 1229 | | |
1229 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
1230 | 1233 | | |
1231 | 1234 | | |
1232 | 1235 | | |
| |||
1251 | 1254 | | |
1252 | 1255 | | |
1253 | 1256 | | |
| 1257 | + | |
1254 | 1258 | | |
1255 | 1259 | | |
1256 | 1260 | | |
| |||
1328 | 1332 | | |
1329 | 1333 | | |
1330 | 1334 | | |
| 1335 | + | |
1331 | 1336 | | |
1332 | 1337 | | |
1333 | 1338 | | |
| |||
1373 | 1378 | | |
1374 | 1379 | | |
1375 | 1380 | | |
| 1381 | + | |
1376 | 1382 | | |
1377 | 1383 | | |
1378 | 1384 | | |
| |||
1451 | 1457 | | |
1452 | 1458 | | |
1453 | 1459 | | |
| 1460 | + | |
1454 | 1461 | | |
1455 | 1462 | | |
1456 | 1463 | | |
| |||
1723 | 1730 | | |
1724 | 1731 | | |
1725 | 1732 | | |
| 1733 | + | |
1726 | 1734 | | |
1727 | 1735 | | |
1728 | 1736 | | |
| |||
1747 | 1755 | | |
1748 | 1756 | | |
1749 | 1757 | | |
| 1758 | + | |
1750 | 1759 | | |
1751 | 1760 | | |
1752 | 1761 | | |
| |||
3646 | 3655 | | |
3647 | 3656 | | |
3648 | 3657 | | |
| 3658 | + | |
3649 | 3659 | | |
3650 | 3660 | | |
3651 | 3661 | | |
| |||
3717 | 3727 | | |
3718 | 3728 | | |
3719 | 3729 | | |
| 3730 | + | |
| 3731 | + | |
3720 | 3732 | | |
3721 | 3733 | | |
3722 | 3734 | | |
| |||
3760 | 3772 | | |
3761 | 3773 | | |
3762 | 3774 | | |
| 3775 | + | |
3763 | 3776 | | |
3764 | 3777 | | |
3765 | 3778 | | |
| |||
3855 | 3868 | | |
3856 | 3869 | | |
3857 | 3870 | | |
| 3871 | + | |
3858 | 3872 | | |
3859 | 3873 | | |
3860 | 3874 | | |
| |||
3874 | 3888 | | |
3875 | 3889 | | |
3876 | 3890 | | |
| 3891 | + | |
3877 | 3892 | | |
3878 | 3893 | | |
3879 | 3894 | | |
| |||
3888 | 3903 | | |
3889 | 3904 | | |
3890 | 3905 | | |
| 3906 | + | |
3891 | 3907 | | |
3892 | 3908 | | |
3893 | 3909 | | |
| |||
0 commit comments