Skip to content

Zero initialize NumaTopology so it lands in .bss. - #948

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

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

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 16, 2026

Copy link
Copy Markdown

Zero initialize NumaTopology so it lands in .bss.

bind_mode_ and num_nodes_ were the only non-zero member initializers in
NumaTopology, so Static::numa_topology_ (16440 B) was emitted into
google_malloc_data (PROGBITS) rather than google_malloc_bss (NOBITS).
This shrinks google_malloc_data from 19252 B to 2812 B (-85%) in
alloc_at_least_test built with -c opt --dynamic_mode=off.

InitNumaTopology unconditionally writes *num_nodes, but only wrote
*bind_mode when TCMALLOC_NUMA_AWARE selected a recognized mode, so the
kAdvisory default came solely from the in-class initializer. Write it
explicitly instead, preserving behavior.

@copybara-service copybara-service Bot changed the title Set the default NumaBindMode in InitNumaTopology. Zero initialize NumaTopology so it lands in .bss. Sep 16, 2026
@copybara-service
copybara-service Bot force-pushed the test_982642502 branch 3 times, most recently from f4e8de7 to f1853f2 Compare September 17, 2026 01:56
bind_mode_ and num_nodes_ were the only non-zero member initializers in
NumaTopology, so Static::numa_topology_ (16440 B) was emitted into
google_malloc_data (PROGBITS) rather than google_malloc_bss (NOBITS).
This shrinks google_malloc_data from 19252 B to 2812 B (-85%) in
alloc_at_least_test built with -c opt --dynamic_mode=off.

InitNumaTopology unconditionally writes *num_nodes, but only wrote
*bind_mode when TCMALLOC_NUMA_AWARE selected a recognized mode, so the
kAdvisory default came solely from the in-class initializer.  Write it
explicitly instead, preserving behavior.

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