Repository navigation
PR 0047 lru skip free node scans when the cache is
- GitHub state: Merged
- Disposition at review: Merged
-
Current head at review:
ff9625dddb32e9c5e60f548c5c19015f4d0a6f54(fix/lru-full-cache-scan) -
Reviewed head:
ff9625dddb32e9c5e60f548c5c19015f4d0a6f54 - Last reviewed: 2026-09-14 UTC
-
Base:
release/eng-2026-523-stable-v2-finalatd9bf8e1dcfd4ee72813c9f9f5572b780fc65cc76 - Subsystem: Core utility / cache
Review freshness: this page records the final/known PR head at review time. If the PR is reopened or rewritten, re-review before relying on implementation details.
- What it changes: lru: skip free-node scans when the cache is full
- Why it was attempted: Observed problem: A miss in a full LRU cache traversed the complete global list searching for free storage even though the maintained num free count already proved there were no free nodes. Profiling evidence: The production-header regression records exact loop visits. At 4,096 entries and 1,024 saturated misses, the parent performs 4,194,304 unsuccessful free-node visits before the normal 1,024 eviction visits. Suspected cause: lru get one free() always…
- Current/final result: Merged isolated LRU fast-path repair with focused unit coverage.
- Lesson: When LRU bookkeeping already proves the cache is full, skip scanning for a free node; encode that invariant with focused full-cache tests.
| Implementation file | Δ | Why it matters |
|---|---|---|
include/qemu/lru.h |
+4/-0 | Generic LRU cache lookup/eviction fast path. |
tests/unit/meson.build |
+1/-0 | Focused/regression validation for the implementation contract. |
tests/unit/test-lru-full.c |
+238/-0 | Focused/regression validation for the implementation contract. |
flowchart LR
subgraph Before
A[Core utility / cache input] --> B[Existing path] --> C[Observed limitation/cost] --> D[Guest-visible result]
end
subgraph PR_47[PR #47]
E[Core utility / cache input] --> F[PR #47 change/measurement] --> G[Qualified behavior] --> H[Guest-visible result]
end
Skip lru get one free() free-node traversal when num free == 0 . - Preserve the existing eviction operation and callback/veto contracts. - Add production-header regression coverage for full/partial caches, hits, collisions, vetoes, flush/reuse, and exhaustion. Main code path: include/qemu/lru.h , tests/unit/test-lru-full.c Commits: tested f75368d4d358b5e87765fe953df49f646533914f ; merged as bac2cae991a2d359eddfc6836dec3db60fba5618
Merged isolated LRU fast-path repair with focused unit coverage.
When LRU bookkeeping already proves the cache is full, skip scanning for a free node; encode that invariant with focused full-cache tests.
Do not add LRU shortcuts without tests covering empty, partially occupied, full, and eviction states.
Pointers only; the detailed evidence remains in its original location.
docs/performance/lru-full-cache/
DSP tooling guide and navigation updated November 2, 2026 for experimental PR #384, source 8f51d237. Capture/replay usage and limits.
The earlier wiki-wide review was published November 1, 2026. Emulator source: b7140848. Reviewed wiki content: 1d2b671. Current status · Release availability · Publication process.
- Home
- Current status
- Stable versus main
- Implemented mechanisms
- Controls and defaults
- Measured results and limits
- Complete change register
- System
- CPU and vCPU
- Memory and DMA
- Graphics / NV2A
- APU and audio
- Timing and timers
- Platform and I/O
- Hardware observations
- Fidelity boundaries
- Methodology
- PGR2 routes
- Debugging lag / hot paths
- Tools and commands
- DSP capture, replay and fuzzing
- HLE readiness and public XISO proof
- Concurrent DSP shadow and OpenAL proof
- DSP HLE operation inventory
- DSP HLE fix examples and testing
- Development
- Upstream shortlist
- Wiki maintenance
- Research / retired work
- Optimization catalog
- Hot-path shortcuts
- Researched experiments
- Unproven proposal directory
- PR lessons
- September26 snapshot
Repository · PRs · Issues