RFR: 8308231: Faster MemAllocator::Allocation checks for verify/notification [v3]
Aleksey Shipilev
shade at openjdk.org
Tue May 23 08:46:01 UTC 2023
On Mon, 22 May 2023 21:06:01 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>>
>> - Reshuffle and simplify
>> - Merge branch 'master' into JDK-8308231-memalloc-check-faster
>> - Touch up comment
>> - Merge branch 'master' into JDK-8308231-memalloc-check-faster
>> - Hide more stuff
>> - Touchups
>> - Branch
>> - Fix
>
> src/hotspot/share/gc/shared/memAllocator.cpp line 98:
>
>> 96:
>> 97: if ((is_real_allocation || _tlab_end_reset_for_sample) &&
>> 98: JvmtiExport::should_post_sampled_object_alloc()) {
>
> The same check is done inside the caller already.
>
> On this note, I think all checks using info outside `class Allocation` should not be present on this level. (Ofc, this is very subjective.)
This is a fast-path code, and it is extremely sensitive to the overheads of the actual calls. So I made a point to check the pre-conditions before calling them. It is much less sensitive to the overheads for the methods that are already protected by `is_real_allocations`, but for others the condtions are pulled to the fast path.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14019#discussion_r1201818427
More information about the hotspot-gc-dev
mailing list