RFR: Refactor budgeting to make the logic cleaner [v3]
Kelvin Nilsen
kdnilsen at openjdk.org
Wed Jul 13 15:37:33 UTC 2022
> This commit consolidates computations related to budgeting of reserves for old-gen evacuation and old-gen promotion within shenandoahGeneration::prepare_regions_and_collection_set(). Previously, these computations had been scattered between several functional units, including shenandoahHeuristics::choose_collection_set() and shenandoahOldHeuristics::prime_collection_set(). A previous pull request brought some of the redundant functionality into prepare_regions_and_collection_set(). This pull request removes the redundant computations from the other locations.
Kelvin Nilsen has updated the pull request incrementally with 12 additional commits since the last revision:
- Fix typo in on-line documentation
- Fixup traditional Shennadoah performance regressions
1. Since young-gen is currently used in some contexts as another name
for the GLOBAL generation (may fix this later), fix the size of
young-generation when we are in non-generational mode.
2. Restore a heuristic that allows regions smaller than the
min-threshold to be added into the collection set.
- Fix size of traditional Shenandoah GLOBAL generation
- Remove instrumentation
- Only check preselected in generational mode
- Use old-evac reserve for GLOBAL max old cset
Copy and paste error in previous commit was using young-evac reserve.
- Global collections need to honor evacuation reservations
This fixes up adaptive heuristic to distinguish between old and young
evacuations and their respective budgets.
- Heuristics should not overwrite old evacuation budget
In refactored code, we shrink old evcacuation budget in
ShenandoahdGeneration::adjust_evacuation_budgets() which executes after
the call to ShenandoahHeuristics::choose_collection_set().
- Fix two refactoring errors
1. An off-by-one error in calculating aged-region promotion bias
2. The stack-allocated preselection array needs to be established in a
more outer context.
- Fixup tenure bias for aged regions
Also insert disabled instrumentation to assist with debugging. This
instrumentation will be removed in a subsequent commit if we pass
regression testing.
- ... and 2 more: https://git.openjdk.org/shenandoah/compare/be1fb125...60951ee2
-------------
Changes:
- all: https://git.openjdk.org/shenandoah/pull/148/files
- new: https://git.openjdk.org/shenandoah/pull/148/files/be1fb125..60951ee2
Webrevs:
- full: https://webrevs.openjdk.org/?repo=shenandoah&pr=148&range=02
- incr: https://webrevs.openjdk.org/?repo=shenandoah&pr=148&range=01-02
Stats: 363 lines in 10 files changed: 189 ins; 65 del; 109 mod
Patch: https://git.openjdk.org/shenandoah/pull/148.diff
Fetch: git fetch https://git.openjdk.org/shenandoah pull/148/head:pull/148
PR: https://git.openjdk.org/shenandoah/pull/148
More information about the shenandoah-dev
mailing list