Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/10203-traversal-feedback-hot-tls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### fix(json): route the traversal-feedback counters through the hot thread-local cache

`json/traversal_feedback.rs` declared its two per-thread counters with a raw `thread_local!`, which the thread-local policy ratchet (`scripts/check_thread_locals.py`) rejects; they now use `crate::perry_thread_local!` like every other runtime declaration, so the per-parse read lands in the hot TLS cache instead of a `_tlv_get_addr` call.
5 changes: 2 additions & 3 deletions crates/perry-runtime/src/json/traversal_feedback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ const SCORE_MAX: u8 = 8;
/// the evidence keeps being refreshed.
const RESAMPLE_EVERY: u8 = 16;

// Two byte counters read once per parse: plain `thread_local!`, not the hot-TLS
// macro, and no heap pointer can live in either.
thread_local! {
// Two byte counters read once per parse. No heap pointer can live in either.
crate::perry_thread_local! {
static SCORE: Cell<u8> = const { Cell::new(0) };
static EAGER_RUN: Cell<u8> = const { Cell::new(0) };
}
Expand Down
Loading