RFR: Locked allocation
Roman Kennke
rkennke at redhat.com
Wed Dec 14 18:52:10 UTC 2016
Am Mittwoch, den 14.12.2016, 18:33 +0100 schrieb Aleksey Shipilev:
> On 12/14/2016 05:36 PM, Roman Kennke wrote:
> > http://cr.openjdk.java.net/~rkennke/lockedalloc/webrev.00/
>
> Impressive!
>
> Comments:
>
> *) Double/long assert in ShenandoahFreeSet::increase_used. At least
> break the
> line, or better yet, combine two asserts in one?
It's a sort of pre- and post-condition, hence the two checks. This guy
was driving me nuts (and probably still is), so I'll leave it for now.
I'll break the line though.
> *) Outdated comment:
> 90 // The modulo will take care of wrapping around.
Oops. Will remove it.
> *) Also, where *does* it wrap around now? Or we don't need it now,
> because we
> guarantee all the previous regions are finally claimed, and no holes
> left?
We used a ring-buffer when claiming humongous regions. When we found a
region starting at index X away from 'current', then we would re-append
all regions between current and X to the end of the list. We couldn't
reasonable skip humongous regions concurrently. Now that it's single-
threaded, we can simply ignore any humongous regions on the list. No
more ring buffer needed, and we can never exceed _max_regions length.
> *) Can we write this:
>
> while (_active_end - next > num) { ...
>
> as this?
>
> while (next + num < _active_end) { ...
>
> I think it is a tad more readable: the bound is on the right.
Yep. Thanks for reminding me of good practices ! :-)
> *) In RecycleDirtyRegionsClosure, there is no more add_region, why?
> Was that
> call superfluous before?
Yes. Right after recycling regions, we will clear the free list. This
was bogus.
Will come with an updated patch shortly.
Roman
More information about the shenandoah-dev
mailing list