Closed lano1106 closed 3 months ago
$ bazel run tcmalloc/testing:hello_main
INFO: Analyzed target //tcmalloc/testing:hello_main (0 packages loaded, 2 targets configured).
INFO: Found 1 target...
Target //tcmalloc/testing:hello_main up-to-date:
bazel-bin/tcmalloc/testing/hello_main
INFO: Elapsed time: 3.929s, Critical Path: 3.79s
INFO: 3 processes: 1 internal, 2 linux-sandbox.
INFO: Build completed successfully, 3 total actions
INFO: Running command line: bazel-bin/tcmalloc/testing/hello_main
Current heap size = 73728 bytes
hello world!
new'd 1073741824 bytes at 0x7174c0000000
Current heap size = 1073816576 bytes
malloc'd 1073741824 bytes at 0x717500000000
Current heap size = 2147558400 bytes
PerCpuCachesActive:0
$ GLIBC_TUNABLES=glibc.pthread.rseq=0 ./a.out
a PerCpuCachesActive:1
I have found this idea in #144
I have glibc v2.40 on my system
Dupe of #144
I have this simple program:
compiled with:
g++ -g -std=c++26 -I/home/lano1106/dev/tcmalloc tcmalloc_new_test.cpp -L/home/lano1106/dev/tcmalloc/bazel-bin/tcmalloc/ -ltcmalloc_new
the so file has been created by adding to tcmalloc/BUILD
I am trying to understand how to enable the PerCpuCaches...
My kernel is 6.10.3. I have validated that the rseq syscall is available:
next step is to modify the tcmalloc/testing:hello_main to see if a pure bazel exec is behaving differently... I might also start to pepper tcmalloc code with printf to track the issue but before going through all these loops and hoops, I am just checking with you if anyone has an idea why my percpu caches are not enabled...