8000 top-level `sync::Arc` alias to support fork for targets with no atomic ptr by brody4hire · Pull Request #2285 · rustls/rustls · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

top-level sync::Arc alias to support fork for targets with no atomic ptr #2285

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

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

brody4hire
Copy link
Contributor
@brody4hire brody4hire commented Dec 18, 2024

Adds an internal sync module aliasing the Arc implementation to allow downstream forks of rustls targetting architectures without atomic pointers to replace the implementation with another implementation such as portable_atomic_util::Arc in one central location.

This update should make it more straightforward for a fork of rustls to overwrite the top-level import of alloc::sync::Arc in rustls/src/lib.rs with another implementation such as portable_atomic_util::Arc.

(A fork would also need to single test import of Arc in rustls/tests/common/mod.rs.)

To prevent accidental use of the non-aliased Arc the project .clippy.toml is upated to add std::sync::Arc to the disallowed-types. Since we only want this to apply to the main crate the CI clippy invocations targetting auxiliary crates are updated to ignore disallowed-types findings. We can improve this in the future with more targetted lint configuration from Cargo.toml settings.


Resolves #2068 (ref: #2068)


Replaces rejected PR: #2200

@brody4hire brody4hire marked this pull request as draft December 18, 2024 04:05
Copy link
codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.82%. Comparing base (eb28df3) to head (d8f6163).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2285   +/-   ##
=======================================
  Coverage   94.82%   94.82%           
=======================================
  Files         104      104           
  Lines       24100    24100           
=======================================
  Hits        22853    22853           
  Misses       1247     1247           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brody4hire brody4hire changed the title XXX overwritable atomic_sync alias CI trial - XXX DRAFT TRIAL DO NOT MERGE overwritable atomic_sync Arc alias to support targets with no atomic ptr - XXX DRAFT TRIAL DO NOT MERGE Dec 18, 2024
@brody4hire brody4hire changed the title overwritable atomic_sync Arc alias to support targets with no atomic ptr - XXX DRAFT TRIAL DO NOT MERGE overwritable atomic_sync Arc alias to support targets with no atomic ptr - DRAFT UPDATE TRIAL, DO NOT MERGE Dec 18, 2024
@brody4hire brody4hire changed the title overwritable atomic_sync Arc alias to support targets with no atomic ptr - DRAFT UPDATE TRIAL, DO NOT MERGE over-writable atomic_sync Arc alias to support targets with no atomic ptr - DRAFT UPDATE TRIAL DO NOT MERGE Dec 18, 2024
@djc
Copy link
Member
djc commented Dec 18, 2024

@brodycj every time you push to a PR in this repo, you generate notifications for everyone watching the repo. If you make a fork in your personal account, you should be able to run CI workflows there too. For your DO NOT MERGE branches, I think that would be a better option.

@brody4hire brody4hire changed the title over-writable atomic_sync Arc alias to support targets with no atomic ptr - DRAFT UPDATE TRIAL DO NOT MERGE top-level Arc import to support forking for targets with no atomic ptr Dec 19, 2024
@brody4hire brody4hire changed the title top-level Arc import to support forking for targets with no atomic ptr top-level Arc import to support fork(s) for targets with no atomic ptr Dec 19, 2024
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from ee37cbe to e0e091b Compare December 19, 2024 06:43
@brody4hire brody4hire marked this pull request as ready for review December 19, 2024 07:01
@brody4hire
Copy link
Contributor Author

/cc @bjoernQ - should be ready for review now

@brody4hire brody4hire changed the title top-level Arc import to support fork(s) for targets with no atomic ptr top-level Arc import to support fork for targets with no atomic ptr Dec 19, 2024
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from c0fdce4 to fb43f2e Compare December 19, 2024 20:55
@brody4hire brody4hire marked this pull request as draft December 19, 2024 20:57
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from fb43f2e to cd455fa Compare December 19, 2024 20:57
@brody4hire brody4hire marked this pull request as ready for review December 19, 2024 21:30
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from 7364e8e to a050bc6 Compare December 29, 2024 16:02
@brody4hire
Copy link
Contributor Author

Hey checking in on this, please let me know if I should rebase it again.

@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch 2 times, most recently from d25bb5b to efeecd5 Compare January 6, 2025 15:19
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from efeecd5 to d42a4dc Compare January 13, 2025 14:39
Copy link
rustls-benchmarking bot commented Jan 21, 2025

Benchmark results

Instruction counts

Significant differences

There are no significant instruction count differences

Other differences

Click to expand 8000
Scenario Baseline Candidate Diff Threshold
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_server 10747919 10694850 -53069 (-0.49%) 0.72%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_server 10453452 10480044 26592 (0.25%) 1.35%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_server 10689601 10702260 12659 (0.12%) 0.50%
handshake_no_resume_ring_1.3_ecdsap256_aes_client 3621108 3623289 2181 (0.06%) 0.24%
handshake_no_resume_ring_1.3_ecdsap256_chacha_client 3624534 3622698 -1836 (-0.05%) 0.26%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 3082197 3080694 -1503 (-0.05%) 0.24%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 3077232 3078441 1209 (0.04%) 0.21%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 8286469 8285153 -1316 (-0.02%) 1.32%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 1174455 1174629 174 (0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 8271067 8270654 -413 (-0.00%) 0.62%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 2163181 2163085 -96 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_client 27787278 27786998 -280 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_client 28174376 28174109 -267 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_client 28177085 28177336 251 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_client 28210724 28210966 242 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_chacha_server 1613606 1613619 13 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_client 27780091 27780282 191 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_client 27842029 27842190 161 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_server 28890181 28890019 -162 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_server 28892303 28892170 -133 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_client 28203922 28203800 -122 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_client 28207240 28207144 -96 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_client 27782502 27782592 90 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_server 1612233 1612228 -5 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_server 30422871 30422793 -78 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_client 27846471 27846542 71 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_server 7566704 7566722 18 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_client 27839539 27839601 62 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_client 1925831 1925827 -4 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_client 1932573 1932577 4 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_server 30420318 30420258 -60 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_server 28892330 28892276 -54 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_server 30380167 30380223 56 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_server 30423189 30423133 -56 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_server 28968357 28968305 -52 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_client 35182570 35182618 48 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_server 28970489 28970516 27 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_client 28180993 28181018 25 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_server 28970609 28970634 25 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_server 30380614 30380634 20 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_client 35180648 35180663 15 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_server 7564559 7564562 3 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_client 58338945 58338934 -11 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 58240724 58240734 10 (0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_client 58225385 58225376 -9 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_client 58331798 58331789 -9 (-0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_server 46389590 46389596 6 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_server 80535652 80535643 -9 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_server 80540441 80540449 8 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 80648884 80648876 -8 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_server 80661859 80661851 -8 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 92704732 92704723 -9 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_client 92674858 92674852 -6 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 92706968 92706963 -5 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 80641259 80641263 4 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_server 46477531 46477529 -2 (-0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_server 30377591 30377590 -1 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_client 92710962 92710959 -3 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_client 92673022 92673024 2 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server46456934 46456935 1 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 46464567 46464566 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_server 46470691 46470692 1 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_server 46487102 46487101 -1 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 58243602 58243603 1 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_client 58342701 58342700 -1 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_server 80554934 80554935 1 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_server 42070498 42070498 0 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 2160038 2160038 0 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 1176834 1176834 0 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_client 4206439 4206439 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_client 40179989 40179989 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_client 40497499 40497499 0 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_server 46467802 46467802 0 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_client 1717778 1717778 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_client 58181209 58181209 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_client 58245682 58245682 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_client 40571689 40571689 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_client 40182932 40182932 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_server 11425039 11425039 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_server 41610759 41610759 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_client 40574950 40574950 0 (0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_client 4229019 4229019 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_client 40578950 40578950 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_client 40281303 40281303 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_server 41972348 41972348 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_server 42068138 42068138 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_server 41969798 41969798 0 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_server 5019734 5019734 0 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_client 2563547 2563547 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_client 2661789 2661789 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_server 41610711 41610711 0 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_client 3864355 3864355 0 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_server 3872463 3872463 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_server 11430994 11430994 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_client 40504760 40504760 0 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_server 11292436 11292436 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_server 41492451 41492451 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_server 41608658 41608658 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_server 41972158 41972158 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_server 41490398 41490398 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_server 42070688 42070688 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_client 40277252 40277252 0 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_client 40500760 40500760 0 (0.00%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_server 4698000 4698000 0 (0.00%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_client 4489533 4489533 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_server 41492499 41492499 0 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_client 2655922 2655922 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_client 40274309 40274309 0 (0.00%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_client 40186983 40186983 0 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_server 46423827 46423827 0 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_client 92663958 92663958 0 (0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_server 4233520 4233520 0 (0.00%) 0.20%

Wall-time

Significant differences

There are no significant wall-time differences

Other differences

Click to expand 8000
Scenario Baseline Candidate Diff Threshold
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes 4.32 ms 4.30 ms -0.02 ms (-0.49%) 1.48%
handshake_session_id_aws_lc_rs_1.3_rsa_aes 4.98 ms 4.96 ms -0.02 ms (-0.47%) 1.18%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes 4.52 ms 4.50 ms -0.02 ms (-0.46%) 1.22%
handshake_tickets_aws_lc_rs_1.3_rsa_aes 5.17 ms 5.15 ms -0.02 ms (-0.43%) 1.12%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha 4.95 ms 4.94 ms -0.02 ms (-0.38%) 1.26%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha 5.16 ms 5.14 ms -0.02 ms (-0.35%) 1.09%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes 5.02 ms 5.00 ms -0.02 ms (-0.35%) 1.41%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes 5.21 ms 5.20 ms -0.02 ms (-0.32%) 1.22%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes 1.10 ms 1.10 ms -0.00 ms (-0.29%) 2.32%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha 4.30 ms 4.29 ms -0.01 ms (-0.25%) 2.30%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha 4.49 ms 4.48 ms -0.01 ms (-0.25%) 1.69%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha 4.98 ms 4.97 ms -0.01 ms (-0.23%) 1.65%
transfer_no_resume_ring_1.3_rsa_aes 6.82 ms 6.83 ms 0.01 ms (0.21%) 5.10%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha 5.18 ms 5.17 ms -0.01 ms (-0.20%) 1.44%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes 4.46 ms 4.47 ms 0.01 ms (0.19%) 7.79%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes 1.16 ms 1.16 ms 0.00 ms (0.19%) 1.56%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes 5.12 ms 5.12 ms 0.01 ms (0.16%) 7.51%
handshake_no_resume_ring_1.3_ecdsap256_aes 504.31 µs 503.53 µs -0.78 µs (-0.15%) 4.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes 5.17 ms 5.17 ms 0.01 ms (0.15%) 6.74%
handshake_no_resume_ring_1.3_rsa_aes 996.17 µs 994.98 µs -1.19 µs (-0.12%) 1.72%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes 5.05 ms 5.06 ms 0.01 ms (0.11%) 7.03%
handshake_no_resume_ring_1.2_rsa_aes 990.33 µs 991.45 µs 1.12 µs (0.11%) 1.85%
transfer_no_resume_ring_1.3_ecdsap384_aes 9.43 ms 9.44 ms 0.01 ms (0.11%) 3.45%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes 458.10 µs 457.60 µs -0.50 µs (-0.11%) 5.03%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 13.64 ms 13.66 ms 0.01 ms (0.10%) 2.24%
transfer_no_resume_ring_1.3_rsa_chacha 13.47 ms 13.48 ms 0.01 ms (0.10%) 2.75%
transfer_no_resume_ring_1.3_ecdsap256_aes 6.33 ms 6.34 ms 0.01 ms (0.09%) 4.81%
handshake_tickets_ring_1.2_rsa_aes 1.60 ms 1.61 ms 0.00 ms (0.08%) 1.80%
handshake_tickets_aws_lc_rs_1.2_rsa_aes 1.77 ms 1.77 ms 0.00 ms (0.08%) 1.64%
handshake_session_id_ring_1.3_ecdsap384_chacha 9.42 ms 9.41 ms -0.01 ms (-0.08%) 1.00%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 12.94 ms 12.95 ms 0.01 ms (0.08%) 2.67%
handshake_tickets_ring_1.3_rsa_aes 6.95 ms 6.95 ms -0.01 ms (-0.08%) 1.36%
handshake_session_id_ring_1.3_ecdsap256_aes 6.39 ms 6.38 ms -0.00 ms (-0.07%) 1.48%
handshake_session_id_aws_lc_rs_1.2_rsa_aes 1.61 ms 1.61 ms 0.00 ms (0.06%) 1.48%
transfer_no_resume_ring_1.2_rsa_aes 6.75 ms 6.75 ms 0.00 ms (0.06%) 4.71%
transfer_no_resume_ring_1.3_ecdsap256_chacha 12.98 ms 12.98 ms 0.01 ms (0.06%) 2.52%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha 1.11 ms 1.11 ms -0.00 ms (-0.05%) 2.46%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 1.15 ms 1.15 ms 0.00 ms (0.05%) 2.00%
handshake_tickets_ring_1.3_rsa_chacha 6.89 ms 6.89 ms -0.00 ms (-0.05%) 1.08%
handshake_no_resume_ring_1.3_rsa_chacha 994.53 µs 994.11 µs -0.42 µs (-0.04%) 2.05%
handshake_session_id_ring_1.3_rsa_aes 6.88 ms 6.88 ms -0.00 ms (-0.04%) 1.00%
handshake_tickets_ring_1.3_ecdsap256_aes 6.46 ms 6.46 ms -0.00 ms (-0.04%) 1.48%
handshake_tickets_ring_1.3_ecdsap384_aes 9.55 ms 9.55 ms -0.00 ms (-0.04%) 1.00%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha 13.60 ms 13.60 ms 0.00 ms (0.03%) 2.75%
transfer_no_resume_ring_1.3_ecdsap384_chacha 16.08 ms 16.09 ms 0.01 ms (0.03%) 2.28%
handshake_session_id_ring_1.2_rsa_aes 1.52 ms 1.52 ms 0.00 ms (0.03%) 1.33%
handshake_no_resume_ring_1.3_ecdsap384_chacha 3.60 ms 3.60 ms 0.00 ms (0.02%) 1.00%
handshake_session_id_ring_1.3_rsa_chacha 6.82 ms 6.82 ms 0.00 ms (0.02%) 1.14%
handshake_session_id_ring_1.3_ecdsap384_aes 9.48 ms 9.47 ms -0.00 ms (-0.02%) 1.00%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes 1.07 ms 1.07 ms -0.00 ms (-0.02%) 1.17%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 455.89 µs 455.83 µs -0.06 µs (-0.01%) 5.11%
handshake_session_id_ring_1.3_ecdsap256_chacha 6.33 ms 6.33 ms -0.00 ms (-0.01%) 1.29%
handshake_tickets_ring_1.3_ecdsap256_chacha 6.40 ms 6.40 ms 0.00 ms (0.01%) 1.17%
handshake_no_resume_ring_1.3_ecdsap256_chacha 500.83 µs 500.81 µs -0.02 µs (-0.00%) 4.34%
handshake_no_resume_ring_1.3_ecdsap384_aes 3.60 ms 3.60 ms 0.00 ms (0.00%) 1.00%
handshake_tickets_ring_1.3_ecdsap384_chacha 9.49 ms 9.49 ms -0.00 ms (-0.00%) 1.00%

Additional information

Historical results

Checkout details:

Copy link
Member
@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels closer to the right set of tradeoffs than #2200 but I'm hoping we can dial in some of the aspects called out by ctz & djc in their reviews before merging.

Thanks!

Copy link
Contributor Author
@brody4hire brody4hire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these updates should be ready, would like to wait for PR #2310 to keep that update separate as I stated below.

Copy link
Contributor Author
@brody4hire brody4hire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just found a few more nits & added a side question. I should be able to resolve the nits in the next few hours or so.

@cpu
Copy link
Member
cpu commented Jan 23, 2025

I'm confused by the state of this PR. It seemed like we whittled it down to 1 commit and a general approach that was OK to myself and Ctz, but now the commit history is a bit of a mess and it's in draft status.

What happened? Can you get this back to just the scope of the PR title and the minimum number of commits to implement exclusively what's needed for supporting a fork replacing the Arc impl?

@brody4hire brody4hire changed the title top-level Arc import to support fork for targets with no atomic ptr top-level sync::Arc alias to support forking for targets with no atomic ptr Jan 23, 2025
@brody4hire
Copy link
Contributor Author
brody4hire commented Jan 23, 2025

I will rebase this in a few minutes, my apologies. This kind of draft mess is what happens when I do too much mindless multi-tasking.


P.S. @cpu please DO feel free to edit & update the title of both this PR and landed merge commit. Your rewording that I used in lib.rs was really helpful before.

@brody4hire brody4hire changed the title top-level sync::Arc alias to support forking for targets with no atomic ptr top-level sync::Arc alias to support a fork for targets with no atomic ptr Jan 23, 2025
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from 38a81c6 to a067a3f Compare January 23, 2025 18:13
@brody4hire brody4hire marked this pull request as ready for review January 23, 2025 18:14
@brody4hire
Copy link
Contributor Author

I have slightly updated the title, and I think this should be ready now. @rustls maintainers please DO feel free to update the title of this PR & the title of the commit message or any other possible nits you may see when merging, and give yourself co-authored-by credit in the commit message.

I have rebased this now that CI update needed from #2310 is merged, and I made a few updates only to cleanup some comments in the CI changes (and remove a commented-out option that was removed in other PR #2310). Unfortunately some workarounds were needed in the CI due to the configuration I made in .clippy.toml since I was not able to figure out a better solution. I would be happy if anyone can find a better solution either today or at some point in the future for this.

My intention has been to keep the proposed updates exclusively within the state of the PR title, and I have made a bit of effort to split some other updates out to separate PRs to keep these updates as focused & atomic as possible. Yes quite a bit of work over the past few months but I am really happy if we can improve support for the extra-tiny embedded devices as proposed here. I would also like to thank the @rustls maintainers for your efforts on reviewing my work and for supporting all of the @rustls requirements in general over the years.

Copy link
Member
@cpu 10000 cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I updated the PR description.

@brody4hire
Copy link
Contributor Author
brody4hire commented Jan 23, 2025

@cpu I just updated the description again: I fixed the module name, added a note in parens: "(A fork would also need to update import of Arc in rustls/tests/common/mod.rs.)" & put "replaces #2200" in parens. Please feel free to edit again if needed.

I DO think that the updated description is what we should put in the commit message and would be happy to rebase again with this updated description if needed (your decision).

I do also think that the info concerning where a fork would need to update the import in rustls/tests should also be in the commit message. I think it would be ideal if we could document this info somewhere such as adding a new DEVELOPING.md file and would be happy to add this if you think it is needed. But I would rather not hold up the final merge too much longer.

@cpu
Copy link
Member
cpu commented Jan 23, 2025

just updated the description again: I fixed the module name, added a note in parens: "(A fork would also need to update import of Arc in rustls/tests/common/mod.rs.)" & put "replaces #2200" in parens. Please feel free to edit again if needed.

Those edits seem fine. Thanks.

I DO think that the updated description is what we should put in the commit message and would be happy to rebase again with this updated description if needed (your decision).

Agreed, update the commit message to match please.

I do also think that the info concerning where a fork would need to update the import in rustls/tests should also be in the commit message.

Sure, sounds reasonable.

I think it would be ideal if we could document this info somewhere such as adding a new DEVELOPING.md file and would be happy to add this if you think it is needed. But I would rather not hold up the final merge too much longer.

We have a CONTRIBUTING.md but I don't think this is a broadly applicable enough concern to be worth adding. I expect one or two downstream projects would need to know about this, not the average Rustls contributor.

@brody4hire brody4hire changed the title top-level sync::Arc alias to support a fork for targets with no atomic ptr top-level sync::Arc alias to support fork for targets with no atomic ptr Jan 23, 2025
Copy link
Contributor Author
@brody4hire brody4hire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to fix these minor nits in the CI comments when I push an update to update the commit message. Apologies for so much noise in this PR 😅😅

@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from a067a3f to f8de6aa Compare January 23, 2025 20:00
…c ptr

Adds an internal `sync` module aliasing the `Arc` implementation to allow
downstream forks of rustls targetting architectures without atomic pointers
to replace the implementation with another implementation such as
`portable_atomic_util::Arc` in one central location.

This update should make it more straightforward for a fork of rustls to
overwrite the top-level import of `alloc::sync::Arc` in `rustls/src/lib.rs`
with another implementation such as `portable_atomic_util::Arc`.

(A fork would also need to update single test import of `Arc` in
`rustls/tests/common/mod.rs`.)

To prevent accidental use of the non-aliased `Arc` the project `.clippy.toml`
is upated to add `std::sync::Arc` to the `disallowed-types`. Since we only
want this to apply to the main crate the CI clippy invocations targetting
auxiliary crates are updated to ignore `disallowed-types` 
CEB7
findings. We can
improve this in the future with more targetted lint configuration from
`Cargo.toml` settings.

---

Resolves rustls#2068 (ref: rustls#2068)

---

Co-authored-by: Daniel McCarney <daniel@binaryparadox.net>
@brody4hire brody4hire force-pushed the overwritable-atomic-sync-alias-ci-trial branch from f8de6aa to d8f6163 Compare January 23, 2025 20:09
@brody4hire
Copy link
Contributor Author
brody4hire commented Jan 23, 2025

I have updated the title slightly yet again, made a couple more minor updates to the description & pushed an updated commit with the updated description (reformatted to fit decent git line width 75-77 characters). I did touch a couple CI comments again in the following force-push diff:

I have also added --- separators to both the PR description & commit to separate the Resolves message, etc. I did keep the resolves message but NOT the reference to the "replaces" rejected PR in the commit message, also keeping of course the co-authored-by line in the commit message.

I think this should be good now. @cpu & other @rustls maintainers please feel free to fix-up anything else you may see if ready to merge & of course keep yourself in the co-authored-by credit. Thanks again for all of your review efforts.


P.S. I have closed my comment as resolved in regarding the new lint warning I added with ugly workaround needed in CI. I am deferring the improvement on my ugly workaround for whoever (anyone) may be able to improve this someday in the future.

Copy link
Member
@ctz ctz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I checked CI broke when I added a use of alloc::sync::Arc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-std support for targets w/o atomics?
4 participants
0