8385592: Shenandoah: Introduce ShenandoahAllocator interface to encapsulate memory allocation#31314
8385592: Shenandoah: Introduce ShenandoahAllocator interface to encapsulate memory allocation#31314pengxiaolong wants to merge 7 commits into
Conversation
…ahAllocator interface
…r-interface # Conflicts: # src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp # src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp
|
👋 Welcome back xpeng! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@pengxiaolong The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
Webrevs
|
kdnilsen
left a comment
There was a problem hiding this comment.
Thanks for this refactoring. It establishes a good foundation for further integrations.
The memory allocation path in ShenandoahGC is currently embedded within ShenandoahFreeSet, mixing region-selection strategy with partition management and accounting. This coupling makes it difficult to experiment with alternative allocation strategies (e.g., CAS-based concurrent allocation).
This change introduces a ShenandoahAllocator interface and a concrete ShenandoahSerialAllocator implementation that extracts the allocation logic out of ShenandoahFreeSet. The serial allocator performs all allocations under the heap lock, preserving existing behavior:
Partition accounting (used/capacity tracking, region retirement, affiliated region totals) remains in ShenandoahFreeSet, invoked by the allocator via notify_allocation().
ShenandoahHeap now owns the allocator instance and calls it directly, replacing the previous ShenandoahFreeSet::allocate() call site.
This is a pure refactoring — no behavioral change.
Test:
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31314/head:pull/31314$ git checkout pull/31314Update a local copy of the PR:
$ git checkout pull/31314$ git pull https://git.openjdk.org/jdk.git pull/31314/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31314View PR using the GUI difftool:
$ git pr show -t 31314Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31314.diff
Using Webrev
Link to Webrev Comment