RFR (S): 8179679: Rearrange filters before card scanning

Thomas Schatzl thomas.schatzl at oracle.com
Fri May 5 19:56:12 UTC 2017


Hi all,

  can I have reviews for this small change that rearranges the filter
clauses while scanning cards to be more effective, and use the recently
introduced _scan_top array to more effectively filter out already
claimed cards?
This improves scan rs performance by ~5%. I have not seen a performance
degradation. Not a lot, but the code is cleaner too imho :)

Improvements:
- moving the check whether a card has been claimed to the front, before
doing any preparatory calculations so that the code does not do wasted
work in the (almost always common) case of attempts of scanning cards
multiple times.
- rearrangement of the checks for whether a card is claimed and card is
dirty allows the compiler to merge the loads from the card table.
- the used _scan_top array already subsumes one check (card_region-
>in_collection_set()), and we can use some a bit more efficient code to
find out whether the area to scan is completely empty as cards never
cross regions.

CR:
https://bugs.openjdk.java.net/browse/JDK-8179679
Webrev:
http://cr.openjdk.java.net/~tschatzl/8179679/webrev/
Testing:
jprt, various benchmarks

This patch depends on the patches presented in the email thread
starting at http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2017-
April/019653.html .

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list