RFR: 8264424: Support OopStorage bulk allocation [v2]

Kim Barrett kbarrett at openjdk.java.net
Wed Apr 7 19:31:15 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.

Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:

  improve comments per ayang

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3264/files
  - new: https://git.openjdk.java.net/jdk/pull/3264/files/3ac5fec7..a0c7f91c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3264&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3264&range=00-01

  Stats: 8 lines in 2 files changed: 1 ins; 1 del; 6 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