Repository navigation
cpu: mark an exception vector as a compile-worthy arrival - #269
Merged
Merged
Conversation
jitv2 requests a compile where execution lands on a page's word 0 or after a taken transfer. Exception delivery writes PC straight to the vector, and of the vectors only the 32-bit TLB refill sits on word 0: the XTLB refill (0x080) and the general vector (0x180) were never requested, so TLB faults, syscalls and interrupt entry (and every refill under a kernel running with UX set) ran in the interpreter. A trigger at an entry that is already runnable costs nothing. cpubench, interleaved with main: Indy (R4400) 32 MB miss read +14% (its page faults enter through the general vector), everything else and the IP28 unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cpu: mark an exception vector as a compile-worthy arrival
jitv2 requests a compile where execution lands on a page's word 0 or after a taken branch or jump. Exception delivery writes PC straight to the vector, and of the vectors only the 32-bit TLB refill sits on word 0. The XTLB refill (0x080) and the general vector (0x180) were never requested, so their handlers always ran in the interpreter: every TLB invalid/modified fault, syscall and interrupt entry on every machine, and every TLB refill on a kernel that runs with UX set.
The change
deliver_exception_atsetsjit_triggerafter it has set PC to the vector (jitv2 builds only). A trigger at an entry that is already compiled costs nothing; dispatch just runs it.Measured
cpubench(integer, branches, L1/L2/miss reads, memset, indirect calls, syscalls, FP), interleaved withmainover two rounds on each machine, on a quiet-ish host:mainOn the Indy the page faults of a fresh 32 MB sweep enter through the general vector, which is now compiled: about +14%. The IP28's IRIX runs its n32 programs with 32-bit refills (word 0), so nothing changes there. Where it matters most is a kernel that takes the XTLB refill for everything: on an emulated O2 (IRIX, UX set), a 5 s memory sweep went from 43M to 9M interpreted instructions.
Tests
cargo test --lib: all pass, apart frombreakpoints_can_be_set_while_running_and_report_their_hitandudp_fragmented_both_ways, which fail the same way onmainhere. Built in the three CI configurations.🤖 Generated with Claude Code