Skip to content

Clamp CacheTopology::l3_count_ to [1, 256]. - #1856

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1014423300
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1014423300

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Clamp CacheTopology::l3_count_ to [1, 256].

CacheTopology::l3_cache_index_ stores each CPU's L3 shard index in a
uint8_t, wrapping indices modulo 256 when more than 256 L3 domains are
present in sysfs. Clamp l3_count_ to [1, 256] after scanning CPUs so
GetL3FromCpuId(cpu) < l3_count() continues to hold without growing
ShardedTransferCacheManager beyond 256 shards.

@copybara-service copybara-service Bot changed the title Avoid 8-bit L3 shard index truncation in CacheTopology and No public description Nov 5, 2026
CacheTopology::l3_cache_index_ stores each CPU's L3 shard index in a
uint8_t, wrapping indices modulo 256 when more than 256 L3 domains are
present in sysfs. Clamp l3_count_ to [1, 256] after scanning CPUs so
GetL3FromCpuId(cpu) < l3_count() continues to hold without growing
ShardedTransferCacheManager beyond 256 shards.
PiperOrigin-RevId: 1014423300
@copybara-service copybara-service Bot changed the title No public description Clamp CacheTopology::l3_count_ to [1, 256]. Nov 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant