Skip to content

Always-inline CacheCpuSlab and avoid dirtying ResizeInfo::touched. - #818

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

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

Conversation

@copybara-service

Copy link
Copy Markdown

Always-inline CacheCpuSlab and avoid dirtying ResizeInfo::touched.

Marking CpuCache::CacheCpuSlab ABSL_ATTRIBUTE_ALWAYS_INLINE eliminates call/return overhead and allows the compiler to fold duplicate cached/cpu checks in AllocateSlowNoHooks and DeallocateSlowNoHooks. Guarding state.touched.store(true) with a relaxed load avoids dirtying the shared ResizeInfo cacheline on every slab recache when touched is already true.

@copybara-service
copybara-service Bot force-pushed the test_981444438 branch 3 times, most recently from 18ba54b to 7f48780 Compare September 16, 2026 23:58
Marking CpuCache::CacheCpuSlab ABSL_ATTRIBUTE_ALWAYS_INLINE eliminates call/return overhead and allows the compiler to fold duplicate cached/cpu checks in AllocateSlowNoHooks and DeallocateSlowNoHooks. Guarding state.touched.store(true) with a relaxed load avoids dirtying the shared ResizeInfo cacheline on every slab recache when touched is already true.

PiperOrigin-RevId: 981444438
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