Andrey Bokhanko via llvm-dev
2021-Jul-08 15:06 UTC
[llvm-dev] RFC: Sanitizer-based Heap Profiler
Hi David, On Wed, Jul 7, 2021 at 7:25 AM Xinliang David Li <xinliangli at gmail.com> wrote:>> > We initially plan to use the profile information to provide guidance to the dynamic allocation runtime on data allocation and placement. We'll send more details on that when it is fleshed out too. >> >> Just to double check: do you plan to open-source this runtime? -- > > > It will be in tcmalloc initially. > >> >> perhaps as a part of LLVM? > > > A wrapper runtime layer in LLVM is possible, but not initially.I wonder how you plan to deliver guidance on what allocations should be made from the same memory chunk to tcmalloc -- unless you plan to read data profile directly from the runtime (I doubt so...) this should be done via some kind of instrumentation done by a compiler / binary optimizer (a la BOLT) -- right? Yours, Andrey
Teresa Johnson via llvm-dev
2021-Jul-08 15:25 UTC
[llvm-dev] RFC: Sanitizer-based Heap Profiler
On Thu, Jul 8, 2021 at 8:06 AM Andrey Bokhanko <andreybokhanko at gmail.com> wrote:> Hi David, > > On Wed, Jul 7, 2021 at 7:25 AM Xinliang David Li <xinliangli at gmail.com> > wrote: > >> > We initially plan to use the profile information to provide guidance > to the dynamic allocation runtime on data allocation and placement. We'll > send more details on that when it is fleshed out too. > >> > >> Just to double check: do you plan to open-source this runtime? -- > > > > > > It will be in tcmalloc initially. > > > >> > >> perhaps as a part of LLVM? > > > > > > A wrapper runtime layer in LLVM is possible, but not initially. > > I wonder how you plan to deliver guidance on what allocations should > be made from the same memory chunk to tcmalloc -- unless you plan to > read data profile directly from the runtime (I doubt so...) this > should be done via some kind of instrumentation done by a compiler / > binary optimizer (a la BOLT) -- right? >Hi Andrey, Responding to this one first, I'll respond to your other email shortly. Initially we plan to provide hints to tcmalloc via new APIs to help it make allocation decisions (things like hotness and lifetime). The compiler will be responsible for adding these hints, using some method to disambiguate the calling context (e.g. via function cloning, new parameter, etc). Teresa> Yours, > Andrey >-- Teresa Johnson | Software Engineer | tejohnson at google.com | -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210708/ac57e8b3/attachment.html>