Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler#44043
Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler#44043
Conversation
vilterp
left a comment
There was a problem hiding this comment.
this looks in line (pun somewhat intended) with what we do for pool alloc :)
|
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
|
^ Kind of hard to believe this isn't just noise… Like big alloc gets called waaay less than pool alloc — how could instrumenting pool alloc not cause a regression, but this does? 🤔 |
|
Yep, 100% agreed. The Nanosoldier report for the |
…cations Profiler Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to allow us to instrument it in the Allocations Profiler. Followup to #43868 Finishes fixing #43688 (gets the stacks, though not the types, of big allocs). ----- - Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined - add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner - replace all internal calls to jl_gc_big_alloc to call this instead - add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner - This one is instrumented, and is meant to be called by generated code.
4da776a to
4d0fd4d
Compare
|
K, I've also updated the diagrams at the top of the PR description. This should be ready for a re-review @vtjnash. Thanks again! 👍 |
Dropping JL_DLLEXPORT from jl_gc_big_alloc_noinline declaration, per @vchuravy's previous comment, above.
|
Thanks everyone! Merging now 👍 |
|
|
||
| jl_value_t *jl_gc_pool_alloc_noinline(jl_ptls_t ptls, int pool_offset, | ||
| int osize); | ||
| JL_DLLEXPORT jl_value_t *jl_gc_big_alloc(jl_ptls_t ptls, size_t allocsz); |
There was a problem hiding this comment.
I think you technically want to keep this line still? jl_gc_big_alloc is still an exported function?
There was a problem hiding this comment.
🤔 it is, but it's not meant to be called anywhere from inside our C code, only from LLVM-generated code. So it doesn't need to be declared in julia_internal.h, which, from what i understand, is a private header only for internal functions?
It's still exported via the definition, which is all that really matters to the linker anyway, this declaration is only here for compiling C files.
So i think it's okay to delete, like we did. We did the same thing for pool_alloc in #43688, too.
…cations Profiler (#44043) * Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to allow us to instrument it in the Allocations Profiler. Followup to #43868 Finishes fixing #43688 (gets the stacks, though not the types, of big allocs). ----- - Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined - add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner - replace all internal calls to jl_gc_big_alloc to call this instead - add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner - This one is instrumented, and is meant to be called by generated code. Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
…cations Profiler (JuliaLang#44043) * Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to allow us to instrument it in the Allocations Profiler. Followup to JuliaLang#43868 Finishes fixing JuliaLang#43688 (gets the stacks, though not the types, of big allocs). ----- - Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined - add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner - replace all internal calls to jl_gc_big_alloc to call this instead - add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner - This one is instrumented, and is meant to be called by generated code. Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
…cations Profiler (JuliaLang#44043) * Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to allow us to instrument it in the Allocations Profiler. Followup to JuliaLang#43868 Finishes fixing JuliaLang#43688 (gets the stacks, though not the types, of big allocs). ----- - Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined - add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner - replace all internal calls to jl_gc_big_alloc to call this instead - add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner - This one is instrumented, and is meant to be called by generated code. Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
…cations Profiler (JuliaLang#44043) * Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to allow us to instrument it in the Allocations Profiler. Followup to JuliaLang#43868 Finishes fixing JuliaLang#43688 (gets the stacks, though not the types, of big allocs). ----- - Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined - add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner - replace all internal calls to jl_gc_big_alloc to call this instead - add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner - This one is instrumented, and is meant to be called by generated code. Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
…cations Profiler (#44043) * Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to allow us to instrument it in the Allocations Profiler. Followup to #43868 Finishes fixing #43688 (gets the stacks, though not the types, of big allocs). ----- - Rename jl_gc_big_alloc to jl_gc_big_alloc_inner, make it inlined - add jl_gc_pool_alloc_noinline that calls jl_gc_big_alloc_inner - replace all internal calls to jl_gc_big_alloc to call this instead - add a new jl_gc_pool_alloc that calls jl_gc_big_alloc_inner - This one is instrumented, and is meant to be called by generated code. Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com>
Instrument jl_gc_big_alloc() when called from generated code for Allocations Profiler
Add _maybe_record_alloc_to_profile() call into jl_gc_big_alloc() to
allow us to instrument it in the Allocations Profiler.
Followup to #43868
Finishes last case of #43688 (gets the stacks, though not the types, of big allocs).
Before
*: instrumented; red: currently missed; green: newly introduced function
graphviz
After
*: instrumented; green: newly introduced function
graphviz