RFR: 8264424: Support OopStorage bulk allocation
Kim Barrett
kbarrett at openjdk.java.net
Tue Mar 30 12:13:27 UTC 2021
Please review this change to OopStorage to support bulk allocation. A new overload for allocate is provided:
size_t allocate(oop** entries, size_t size)
The approach taken is to claim all of the available entries in the first available block, add as many of those entries as will fit in the buffer, and release any remaining entries back to the block. Only the claim part needs to be done while holding the allocation mutex. This is is optimized for clients that want more than just a couple entries, and minimizes time under the lock. The maximum number of entries (the number of entries in a block) is provided as a constant for sizing requests, to avoid the release of unrequested entries. An application that wants more than that, or a specific number that might not be available from the next block, needs to make multiple bulk allocation calls, but that's still going to be much faster than one at a time allocations.
Testing:
mach5 tier1
New gtest for bulk allocation.
I've been using this for a while as part of another in-development change that makes heavy use of this feature.
-------------
Commit messages:
- oopstorage bulk allocation
Changes: https://git.openjdk.java.net/jdk/pull/3264/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3264&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8264424
Stats: 132 lines in 4 files changed: 118 ins; 1 del; 13 mod
Patch: https://git.openjdk.java.net/jdk/pull/3264.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3264/head:pull/3264
PR: https://git.openjdk.java.net/jdk/pull/3264
More information about the hotspot-gc-dev
mailing list