Git Product home page Git Product logo

Comments (5)

westlaker avatar westlaker commented on May 4, 2024 2

Hello, I have just compiled snort 3.1 on Arm64 machine
snort_strace_tmalloc.txt
with tcmalloc enabled, the snort binary won't run, it is stuck see attached log file.
without tcmalloc enabled, it works fine.

any idea?

from tcmalloc.

alschult-saildrone avatar alschult-saildrone commented on May 4, 2024

NOTE: I am building currently with the SMALL_BUT_SLOW option on because I first thought maybe the default 1GB mapping was causing the issue, but I get the same problem with either option.

from tcmalloc.

ckennelly avatar ckennelly commented on May 4, 2024

As a general note, ARM64 support would be desirable, but it's not yet ready. Our per-CPU cache implementation relies on hand-written assembly and needs to be ported to ARM.

Do you know how your page table is configured with your kernel build? https://kernel.org/doc/Documentation/arm64/memory.txt has a discussion of 39- versus 48-bit address spaces.

As an optimization, we "tag" (by using an upper bit of the pointer) sampled objects during allocation. The tag makes it easy to distinguish sampled objects from unsampled ones. My suspicion is that we are unable to allocate memory with the right bit pattern--possibly due to a constrained 39-bit address space--and so we fail. One way of testing this hypothesis is to edit tcmalloc/common.h's kAddressBits to 39 (instead of 48) for the ARM configuration.

from tcmalloc.

alschult-saildrone avatar alschult-saildrone commented on May 4, 2024

Thanks for the quick reply! Based on the boot output, I think it is using 39-bit addresses:

[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xffffff8000000000 - 0xffffff8008000000   (   128 MB)
[    0.000000]     vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000   (   250 GB)
[    0.000000]       .text : 0xffffff8008080000 - 0xffffff8008f60000   ( 15232 KB)
[    0.000000]     .rodata : 0xffffff8008f60000 - 0xffffff80095e0000   (  6656 KB)
[    0.000000]       .init : 0xffffff80095e0000 - 0xffffff8009e40000   (  8576 KB)
[    0.000000]       .data : 0xffffff8009e40000 - 0xffffff800a11b808   (  2927 KB)
[    0.000000]        .bss : 0xffffff800a11b808 - 0xffffff800a1b3dbc   (   610 KB)
[    0.000000]     fixed   : 0xffffffbefe7fd000 - 0xffffffbefec00000   (  4108 KB)
[    0.000000]     PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000   (    16 MB)
[    0.000000]     vmemmap : 0xffffffbf00000000 - 0xffffffc000000000   (     4 GB maximum)
[    0.000000]               0xffffffbf00000000 - 0xffffffbf03fc8000   (    63 MB actual)
[    0.000000]     memory  : 0xffffffc000000000 - 0xffffffc0ff200000   (  4082 MB)

I'll give it a try to change the address bits and see if it works.

In the short term I'm interested in using tcmalloc for the heap profiling abilities, so even if the assembly code is not complete, do you expect tcmalloc to work functionally (albeit not at max performance) on ARM64?

from tcmalloc.

alschult-saildrone avatar alschult-saildrone commented on May 4, 2024

BTW, the change to 39-bits seems to work (at least for the hello_main test program). Going to try with our main application. If you think that it's likely we'll run into other problems given the not-officially-supported nature, please let me know. Thanks agian!

from tcmalloc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.