RFR (XS): Correct prefetch offset for marked object iteration

Zhengyu Gu zgu at redhat.com
Mon Apr 17 15:52:21 UTC 2017


Good to me.

-Zhengyu

On 04/17/2017 11:39 AM, Aleksey Shipilev wrote:
> Hi,
>
> I don't know what I was thinking when setting prefetch offset to 1 in
> marked_object_iterate. We should actually prefetch for forwarding pointer,
> because we would most probably touch it first.
>
> diff -r 3b56bf7682d0 src/share/vm/gc/shenandoah/shenandoahHeap.inline.hpp
> --- a/src/share/vm/gc/shenandoah/shenandoahHeap.inline.hpp	Sat Apr 15 10:14:47
> 2017 +0200
> +++ b/src/share/vm/gc/shenandoah/shenandoahHeap.inline.hpp	Mon Apr 17 17:32:32
> 2017 +0200
> @@ -474,7 +474,7 @@
>      do {
>        avail = 0;
>        for (int c = 0; (c < dist) && (addr < limit); c++) {
> -        Prefetch::read(addr, 1);
> +        Prefetch::read(addr, BrooksPointer::byte_offset());
>          oop obj = oop(addr);
>          slots[avail++] = obj;
>          if (addr < top_at_mark_start) {
>
> Helps GC times for SPECjbb2015 in both adaptive+update-refs and passive modes.
>
> Thanks,
> -Aleksey
>


More information about the shenandoah-dev mailing list