RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

Erik Österlund-2
Hi,

The JVMTI tag hashmap has weak oop references that are handled using raw
oop accesses and a G1-specific SATB enqueue call when leaking out
objects from the tag map, requiring them to be marked as live by G1.

This should now be refactored to use the Access API to annotate that
these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.

Webrev:
http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/

Bug:
https://bugs.openjdk.java.net/browse/JDK-8191894

Thanks,
/Erik
Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

coleen.phillimore
http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/src/hotspot/share/prims/jvmtiTagMap.cpp.udiff.html

+ return RootAccess<ON_PHANTOM_OOP_REF |
AS_NO_KEEPALIVE>::oop_load(object_addr());


Why is this not access ON_ROOT{_CONCURRENT} ?  The thing holding the
object that you are peeking at is not in the Java Heap?

thanks,
Coleen

On 11/27/17 6:28 AM, Erik Österlund wrote:

> Hi,
>
> The JVMTI tag hashmap has weak oop references that are handled using
> raw oop accesses and a G1-specific SATB enqueue call when leaking out
> objects from the tag map, requiring them to be marked as live by G1.
>
> This should now be refactored to use the Access API to annotate that
> these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
> ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8191894
>
> Thanks,
> /Erik

Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

coleen.phillimore


On 11/27/17 1:21 PM, [hidden email] wrote:
> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/src/hotspot/share/prims/jvmtiTagMap.cpp.udiff.html 
>
>
> + return RootAccess<ON_PHANTOM_OOP_REF |
> AS_NO_KEEPALIVE>::oop_load(object_addr());
>

Sorry I have my Access API dimensions mixed up.  RootAccess is IN_ROOT
not ON_ROOT (and not concurrent).

Coleen

>
> Why is this not access ON_ROOT{_CONCURRENT} ?  The thing holding the
> object that you are peeking at is not in the Java Heap?
>
> thanks,
> Coleen
>
> On 11/27/17 6:28 AM, Erik Österlund wrote:
>> Hi,
>>
>> The JVMTI tag hashmap has weak oop references that are handled using
>> raw oop accesses and a G1-specific SATB enqueue call when leaking out
>> objects from the tag map, requiring them to be marked as live by G1.
>>
>> This should now be refactored to use the Access API to annotate that
>> these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
>> ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8191894
>>
>> Thanks,
>> /Erik
>

Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

serguei.spitsyn@oracle.com
In reply to this post by Erik Österlund-2
Hi Erik,

This looks good to me.

Thanks,
Serguei


On 11/27/17 05:22, Daniel D. Daugherty wrote:

> Adding serviceability-dev@... since this is JVM/TI related...
>
> Dan
>
>
> On 11/27/17 6:28 AM, Erik Österlund wrote:
>> Hi,
>>
>> The JVMTI tag hashmap has weak oop references that are handled using
>> raw oop accesses and a G1-specific SATB enqueue call when leaking out
>> objects from the tag map, requiring them to be marked as live by G1.
>>
>> This should now be refactored to use the Access API to annotate that
>> these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
>> ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8191894
>>
>> Thanks,
>> /Erik
>

Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

Erik Österlund-2
Hi Serguei,

Thanks for the review.

/Erik

On 2017-11-28 06:43, [hidden email] wrote:

> Hi Erik,
>
> This looks good to me.
>
> Thanks,
> Serguei
>
>
> On 11/27/17 05:22, Daniel D. Daugherty wrote:
>> Adding serviceability-dev@... since this is JVM/TI related...
>>
>> Dan
>>
>>
>> On 11/27/17 6:28 AM, Erik Österlund wrote:
>>> Hi,
>>>
>>> The JVMTI tag hashmap has weak oop references that are handled using
>>> raw oop accesses and a G1-specific SATB enqueue call when leaking
>>> out objects from the tag map, requiring them to be marked as live by
>>> G1.
>>>
>>> This should now be refactored to use the Access API to annotate that
>>> these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
>>> ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>>>
>>> Bug:
>>> https://bugs.openjdk.java.net/browse/JDK-8191894
>>>
>>> Thanks,
>>> /Erik
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

Erik Österlund-2
In reply to this post by coleen.phillimore
Hi Coleen,

On 2017-11-27 19:21, [hidden email] wrote:
> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/src/hotspot/share/prims/jvmtiTagMap.cpp.udiff.html 
>
>
> + return RootAccess<ON_PHANTOM_OOP_REF |
> AS_NO_KEEPALIVE>::oop_load(object_addr());
>
>
> Why is this not access ON_ROOT{_CONCURRENT} ?  The thing holding the
> object that you are peeking at is not in the Java Heap?

The reason is that all GC root processing of these roots (off-heap oop*)
are performed completely in a safepoints as opposed to concurrently.

Thanks,
/Erik

>
> thanks,
> Coleen
>
> On 11/27/17 6:28 AM, Erik Österlund wrote:
>> Hi,
>>
>> The JVMTI tag hashmap has weak oop references that are handled using
>> raw oop accesses and a G1-specific SATB enqueue call when leaking out
>> objects from the tag map, requiring them to be marked as live by G1.
>>
>> This should now be refactored to use the Access API to annotate that
>> these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
>> ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8191894
>>
>> Thanks,
>> /Erik
>

Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

Erik Österlund-2
In reply to this post by coleen.phillimore
Hi Coleen,

That's it, yes. Hope I answered the question.

Thanks,
/Erik

On 2017-11-27 19:28, [hidden email] wrote:

>
>
> On 11/27/17 1:21 PM, [hidden email] wrote:
>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/src/hotspot/share/prims/jvmtiTagMap.cpp.udiff.html 
>>
>>
>> + return RootAccess<ON_PHANTOM_OOP_REF |
>> AS_NO_KEEPALIVE>::oop_load(object_addr());
>>
>
> Sorry I have my Access API dimensions mixed up.  RootAccess is IN_ROOT
> not ON_ROOT (and not concurrent).
>
> Coleen
>>
>> Why is this not access ON_ROOT{_CONCURRENT} ?  The thing holding the
>> object that you are peeking at is not in the Java Heap?
>>
>> thanks,
>> Coleen
>>
>> On 11/27/17 6:28 AM, Erik Österlund wrote:
>>> Hi,
>>>
>>> The JVMTI tag hashmap has weak oop references that are handled using
>>> raw oop accesses and a G1-specific SATB enqueue call when leaking
>>> out objects from the tag map, requiring them to be marked as live by
>>> G1.
>>>
>>> This should now be refactored to use the Access API to annotate that
>>> these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads to use
>>> ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>>>
>>> Bug:
>>> https://bugs.openjdk.java.net/browse/JDK-8191894
>>>
>>> Thanks,
>>> /Erik
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: RFR (S): 8191894: Refactor weak references in JvmtiTagHashmap to use the Access API

coleen.phillimore


On 11/28/17 7:37 AM, Erik Österlund wrote:
> Hi Coleen,
>
> That's it, yes. Hope I answered the question.

Yes, thanks.
Coleen

>
> Thanks,
> /Erik
>
> On 2017-11-27 19:28, [hidden email] wrote:
>>
>>
>> On 11/27/17 1:21 PM, [hidden email] wrote:
>>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/src/hotspot/share/prims/jvmtiTagMap.cpp.udiff.html 
>>>
>>>
>>> + return RootAccess<ON_PHANTOM_OOP_REF |
>>> AS_NO_KEEPALIVE>::oop_load(object_addr());
>>>
>>
>> Sorry I have my Access API dimensions mixed up.  RootAccess is
>> IN_ROOT not ON_ROOT (and not concurrent).
>>
>> Coleen
>>>
>>> Why is this not access ON_ROOT{_CONCURRENT} ?  The thing holding the
>>> object that you are peeking at is not in the Java Heap?
>>>
>>> thanks,
>>> Coleen
>>>
>>> On 11/27/17 6:28 AM, Erik Österlund wrote:
>>>> Hi,
>>>>
>>>> The JVMTI tag hashmap has weak oop references that are handled
>>>> using raw oop accesses and a G1-specific SATB enqueue call when
>>>> leaking out objects from the tag map, requiring them to be marked
>>>> as live by G1.
>>>>
>>>> This should now be refactored to use the Access API to annotate
>>>> that these are ON_PHANTOM_OOP_REF, and refactor the raw oop loads
>>>> to use ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE.
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~eosterlund/8191894/webrev.00/
>>>>
>>>> Bug:
>>>> https://bugs.openjdk.java.net/browse/JDK-8191894
>>>>
>>>> Thanks,
>>>> /Erik
>>>
>>
>