Repository navigation
[cDAC] Cache small target-memory reads in bounded pages - #136661
Open
max-charlamb wants to merge 3 commits into
Open
max-charlamb wants to merge 3 commits into
max-charlamb wants to merge 3 commits into
Conversation
Use 32 preallocated 4 KiB pages with dictionary indexing and FIFO eviction. Retain unavailable-page entries for exact-read fallback, clear on flush and writes, and preserve logical-read notifications outside the cache. Cover sparse memory, replacement failures, invalidation, endianness and logical dump-read reporting in the existing cDAC tests. Co-authored-by: Copilot <[email protected]> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Add direct AppContext/runtime-host options for enabling caching, page size and page count. Keep the 4096-byte/32-page defaults, validate dimensions, and cover configuration in isolated tests. Co-authored-by: Copilot <[email protected]> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
max-charlamb
marked this pull request as ready for review
October 30, 2026 20:21
Reconstruct loaded-image pointer values when ClrMdDumpHost fills missing dump memory from a PE file, matching SOS image mapping behavior. Co-authored-by: Copilot <[email protected]> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
This branch has not been deployed
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.
Summary
Cache small target-memory reads in
ContractDescriptorTargetusing 32 preallocated 4 KiB pages by default. A pre-sized dictionary maps aligned addresses to cache slots, and misses replace slots in FIFO order.The cache targets workloads such as dump enumeration and stack walking that issue many small reads from nearby addresses. Cache hits avoid repeated physical
ReadVirtualcallbacks while preserving logical-read notifications, so dump-region reporting is unchanged. Failed full-page fills fall back to the exact requested read, and unavailable pages are retried after eviction or invalidation. The cache is cleared on every flush scope and before writes.Configuration
Managed consumers can configure the cache with standard runtime-host configuration options:
These are the defaults when omitted. Disabling the cache avoids allocating its storage. Page size must be a positive power of two, page count must be positive, and their product must fit in a managed byte array.
Performance
This PR: before and after versus native DAC
Heap-mode
ICLRDataEnumMemoryRegionsusing six fixed snapshots and matching native DAC. These are standalone measurements of main cDAC before this PR and the same source with only this page cache added. Values are means from 90 retained observations per provider/workload.Physical target-read callbacks fell by 97.5%-99.6%:
All 18 Mini/Heap/Triage enumeration outputs matched the reader without this PR.
Mini dumps remain a limitation because sparse pages frequently reject full-page fills and fall back to exact reads.
Note
This PR description and implementation were developed with GitHub Copilot.