runtime: Linux handle-stack operations are out-of-line cold TLS calls (makes callers cold)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- linux, rust
- Ambito
- compilers, performance
Direzione di ricerca
Start at hot_if_published() and runtime_handle_stack_cold, the out-of-line Linux path that wraps a LocalKey::with TLS access, and compare it with the Darwin aarch64 path that stays inline. Then check the callers call_vtable_method_value, call_vtable_method_with_private_brand and call_class_object_constructor_entry to see how the cold inference reaches them. Done means handle operations no longer compile to a call on Linux, with callgrind and A/B numbers that match or beat the trial branch; the payload does not say which of the two fix options is preferred.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On Linux, every runtime-handle stack operation goes out of line: hot_if_published() always returns None there, so each push/pop/height read calls runtime_handle_stack_cold (#[cold], a TLS access through LocalKey::with).
Two costs follow:
- one out-of-line TLS call per handle operation, which is where tsc's remaining ~+0.1% after #12631 comes from (callgrind, x86-64-v3 builds: before #12631 11.7562G, main 11.7667G);
- LLVM infers
coldfor every function that opens a handle scope, includingcall_vtable_method_value,call_vtable_method_with_private_brandandcall_class_object_constructor_entry. Their callers then inline them under the cold-callee threshold (45) instead of 250. Since #12631,call_vtable_method_with_private_brand(cost 75) is no longer inlined at its two constructor callers.
A trial (branch kept as a bundle on the build host, head 2f54047026) moved private brands onto the handle stack and kept #[cold] only on Darwin aarch64. Quick A/B (n=3): zodwork −0.14%, fastify_inject −0.30%, tscwork +0.02% vs main, .text +55–60 KB, m_newcls +2%. The underlying fix is to give Linux the same published hot path for the handle stack (or an inline TLS access) that Darwin aarch64 has, so handle operations stop being calls and stop making their callers cold.
Follow-up of #12634 (closed: the private-brand stack was not the cause).
- Lingua principale
- Rust
- Stelle
- 4.9k
- Fork
- 166
- Merge medio
- 2h 15m
- PR unite (30g)
- 917
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PerryTS/perry
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PerryTS/perry#13354 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug performance
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PerryTS/perry
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
FalkorDB/FalkorDB#3597 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mozilla-services/syncstorage-rs#2715 ·
I maintainer di solito rispondono entro 1 giorno