RFR: JDK-8199620: Support for JNI object pinning

White, Derek Derek.White at cavium.com
Wed Mar 14 22:22:07 UTC 2018


Hi Roman,

Interesting idea.

Is the intention to NOT call GCLocker::lock_critical() in the case when the object can be pinned?

I can see how this allows pinning a region, but I don't see in this webrev where we’re getting any benefit.

Thanks!

 - Derek

> -----Original Message-----
> From: hotspot-gc-dev [mailto:hotspot-gc-dev-bounces at openjdk.java.net]
> On Behalf Of Roman Kennke
> Sent: Wednesday, March 14, 2018 2:51 PM
> To: hotspot-gc-dev at openjdk.java.net
> Subject: Re: RFR: JDK-8199620: Support for JNI object pinning
> 
> Am 14.03.2018 um 19:13 schrieb Roman Kennke:
> > Currently, the Get/Release*Critical() family of functions use the
> > GCLocker protocol to ensure that no JNI critical arrays are in use
> > when a GC pause is entered.
> >
> > Some GCs may instead want to use object pinning and guarantee that the
> > object does not move. For example, this is easy to do with
> > region-based GCs (G1, Shenandoah, ZGC) by simply not including regions
> > with pinned objects in the collection set.
> >
> > The implementation/API that I'm proposing is fairly simple: add two
> > methods oop pin_object(oop) and void unpin_object(oop) to
> > CollectedHeap, and call them from JNI's Get/Release*Critical methods.
> >
> > This approach has been working perfectly fine since a long time in
> > Shenandoah.
> >
> > Bug:
> > https://bugs.openjdk.java.net/browse/JDK-8199620
> > Webrev:
> > http://cr.openjdk.java.net/~rkennke/8199620/webrev.00/
> 
> And here is the correct patch:
> 
> http://cr.openjdk.java.net/~rkennke/8199620/webrev.01/
> 
> Roman



More information about the hotspot-gc-dev mailing list