-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Unconditionally call really_init
on GNU/Linux
#124447
Conversation
This makes miri not diverge in behavior, it fixes running Rust linux-gnu binaries on musl with gcompat, it fixes dlopen edge-cases that cranelift somehow hits, etc.
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.
Making the gnu case the same as the musl case makes sense to me. It is just setting two atomics so I don't think it saves much to skip init from main
@bors r+ rollup |
…nu, r=ChrisDenton Unconditionally call `really_init` on GNU/Linux This makes miri not diverge in behavior, it fixes running Rust linux-gnu binaries on musl with gcompat, it fixes dlopen edge-cases that cranelift somehow hits, etc. Fixes rust-lang#124126 thou hast gazed into this abyss with me: r? `@ChrisDenton`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#123942 (`x vendor`) - rust-lang#124165 (add test for incremental ICE: slice-pattern-const.rs rust-lang#83085) - rust-lang#124210 (Abort a process when FD ownership is violated) - rust-lang#124242 (bootstrap: Describe build_steps modules) - rust-lang#124406 (Remove unused `[patch]` for clippy_lints) - rust-lang#124429 (bootstrap: Document `struct Builder` and its fields) - rust-lang#124447 (Unconditionally call `really_init` on GNU/Linux) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#123248 (1.78 release notes) - rust-lang#123942 (`x vendor`) - rust-lang#124165 (add test for incremental ICE: slice-pattern-const.rs rust-lang#83085) - rust-lang#124242 (bootstrap: Describe build_steps modules) - rust-lang#124406 (Remove unused `[patch]` for clippy_lints) - rust-lang#124429 (bootstrap: Document `struct Builder` and its fields) - rust-lang#124447 (Unconditionally call `really_init` on GNU/Linux) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124447 - workingjubilee:set-argv-twice-on-gnu, r=ChrisDenton Unconditionally call `really_init` on GNU/Linux This makes miri not diverge in behavior, it fixes running Rust linux-gnu binaries on musl with gcompat, it fixes dlopen edge-cases that cranelift somehow hits, etc. Fixes rust-lang#124126 thou hast gazed into this abyss with me: r? ``@ChrisDenton``
Could we check, first, whether we've already had these initialized, and only call this in the unusual case where they're not initialized? That would avoid the extra work in the common case, and do the work in the unusual case. |
@joshtriplett how, exactly, is updating an atomic a single extra time in a program's entire lifetime "extra work"? |
Doing a branch and only then updating is quite plausibly more work because it impacts the branch prediction tables. |
I'm happy to look at any PR changing this but, as jubilee says, I'm really not clear how we could possibly do less work then a couple of relaxed stores? I mean other than doing nothing, which I'm assuming is still undesirable. |
I can add a comment explaining that the reason the scare-quotes are there is because the "duplicate work" is so enormously trivial that on almost all systems it is actually more costly to write the if, as anything that doesn't have a branch predictor also makes its atomic locking implementation dead-simple. |
@workingjubilee I read the couple of GitHub issues too quickly, didn't dig into the body of |
This makes miri not diverge in behavior, it fixes running Rust linux-gnu binaries on musl with gcompat, it fixes dlopen edge-cases that cranelift somehow hits, etc.
Fixes #124126
thou hast gazed into this abyss with me:
r? @ChrisDenton