Skip to content
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

fix pthread-based tls on apple targets #137897

Merged
merged 1 commit into from
Apr 5, 2025
Merged

Conversation

xTachyon
Copy link
Contributor

@xTachyon xTachyon commented Mar 2, 2025

Tries to fix #127773.

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2025

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Mar 3, 2025

r? libs

@rustbot rustbot assigned Amanieu and unassigned jieyouxu Mar 3, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Not a libs reviewer, only looked at the test changes

@jieyouxu
Copy link
Member

Re-rolling a libs reviewer since you may be busy, but feel free to take review back.
r? libs

@rustbot rustbot assigned Noratrieb and unassigned Amanieu Mar 17, 2025
@jieyouxu jieyouxu self-assigned this Mar 17, 2025
@thomcc
Copy link
Member

thomcc commented Mar 17, 2025

This seems fine to me but ironically on apple targets, pthread keys are faster than static TLS (try a simple benchmark some time), so the PR title is wrong.

r=me once you're happy with it.

@xTachyon xTachyon changed the title fix slow tls on apple targets fix pthread-based tls on apple targets Mar 18, 2025
@rust-log-analyzer

This comment has been minimized.

@xTachyon
Copy link
Contributor Author

This seems fine to me but ironically on apple targets, pthread keys are faster than static TLS (try a simple benchmark some time), so the PR title is wrong.

r=me once you're happy with it.

So I tried a simple benchmark, and I can't say that pthread keys are faster. The "fancy" target has "has-thread-local": false.

This is on nightly-2024-05-20-aarch64-apple-darwin, which might be a problem, with lto = "fat".

Maybe my test is wrong?

@xTachyon xTachyon requested a review from jieyouxu March 18, 2025 19:08
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

The test looks fine to me. Since there might be some more apple perf discussions, I'll hand this review back.

@jieyouxu
Copy link
Member

r? @thomcc

@rustbot rustbot assigned thomcc and unassigned jieyouxu Mar 19, 2025
@xTachyon
Copy link
Contributor Author

xTachyon commented Apr 3, 2025

r? @Noratrieb

@rustbot rustbot assigned Noratrieb and unassigned thomcc Apr 3, 2025
@Noratrieb
Copy link
Member

@bors r=thomcc,jieyouxu

@bors
Copy link
Collaborator

bors commented Apr 4, 2025

📌 Commit e41cce0 has been approved by thomcc,jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 4, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 5, 2025
Rollup of 11 pull requests

Successful merges:

 - rust-lang#136457 (Expose algebraic floating point intrinsics)
 - rust-lang#137880 (Autodiff batching)
 - rust-lang#137897 (fix pthread-based tls on apple targets)
 - rust-lang#138024 (Allow optimizing out `panic_bounds_check` in Unicode checks.)
 - rust-lang#138546 (Add integer to string formatting tests)
 - rust-lang#138826 (StableMIR: Add `associated_items`.)
 - rust-lang#138950 (replace extra_filename with strict version hash in metrics file names)
 - rust-lang#139274 (Rustdoc: typecheck settings.js)
 - rust-lang#139285 (use lower case to match other error messages)
 - rust-lang#139341 (Apply `Recovery::Forbidden` when reparsing pasted macro fragments.)
 - rust-lang#139389 (make `Arguments::as_statically_known_str` doc(hidden))

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 92bb726 into rust-lang:master Apr 5, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 5, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 5, 2025
Rollup merge of rust-lang#137897 - xTachyon:tls-fix, r=thomcc,jieyouxu

fix pthread-based tls on apple targets

Tries to fix rust-lang#127773.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unresolved imports when building std without thread local
8 participants