RFR: 8264424: Support OopStorage bulk allocation [v3]

Kim Barrett kbarrett at openjdk.java.net
Wed Apr 7 19:47:34 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 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 three additional commits since the last revision:

 - Merge branch 'master' into bulk_alloc
 - improve comments per ayang
 - oopstorage bulk allocation

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

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

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

  Stats: 26753 lines in 510 files changed: 20294 ins; 3517 del; 2942 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