RFR: JDK-8299703: Improvements in card scanning

Y. Srinivas Ramakrishna ysr at openjdk.org
Sat Jan 21 22:18:29 UTC 2023


**Main changes:**
1. `process_clusters()` now finds and processes contiguous ranges of dirty cards, skipping over contiguous ranges of clean cards.
2. the ShenandoahCardCluster class has been extended by a `block_start()` method which returns the first object in a card (which could be co-initial with the card); this method is used by the refactored process_clusters() above.
3. ShenandoahCardCluster class's `has_object()` method has been renamed `starts_object()` which more closely reflects the API.
4. ShenandoahCardStats class has been modified to better suit the way statistics are gathered in the rewritten `process_clusters()`. The larger-grain API should also result in less overhead for gathering the statistics and might (subject to measurement) allow it to be available in product/release builds (if so, that will be done in a separate follow-up ticket).

**Testing & Implementation Notes:**
5. Tested with Extremem and SpecJBB, fastdebug, release, and product builds, with and without verification enabled.
6. Preliminary performance data with an Extremem workload show roughly 17-18% reduction in wall-clock durations of concurrent remembered set scanning across the distribution (p0, p25, p50, p75), p100 (max) was marginally down at 2%. The trend of the change was as expected since the gains are lost when we have a higher frequency of dirty/clean alternations with short dirty/clean runs.
7. More performance data with SPECjbb and a different Extremem workload are being gathered, and will be included. We will also include the impact on the concurrent update refs phase, as well as the overall impact on latency scores.

**Acknowledgments**:
8. Many thanks to @kdnilsen for feedback on an earlier version of the draft PR, which helped catch a crucial misunderstanding on the role of TAMS and object start marks, and helped fix the error that had been dogging me.

**Epilogue**:
9. Further performance improvements are possible, but are deferred for follow-up.

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

Commit messages:
 - More const safety, some asserts, some comments.
 - Change type of loop variable to signed to allow correct termination for the case when start_card_index is 0. Nominal check for overflow when using signed type for card index.
 - Fix the direction of an address comparison, add a couple of assertions,
 - Fixes related to tams logic and iteration, block_start backwards walk
 - TODO: marks the places identified in code walkthrough / review with
 - ...
 - Clean up & refine comments; rename a variable or two; add a couple of
 - Correct tracking of oldest address scanned; relax an overly strong
 - const some methods.
 - Merge branch 'master' into rs_scan
 - ... and 99 more: https://git.openjdk.org/shenandoah/compare/2cab4e76...eaadac7c

Changes: https://git.openjdk.org/shenandoah/pull/193/files
 Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=193&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8299703
  Stats: 836 lines in 11 files changed: 325 ins; 274 del; 237 mod
  Patch: https://git.openjdk.org/shenandoah/pull/193.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah pull/193/head:pull/193

PR: https://git.openjdk.org/shenandoah/pull/193


More information about the shenandoah-dev mailing list