SA for ZGC
Per Liden
per.liden at oracle.com
Thu Jan 11 12:40:30 UTC 2018
Hi,
On 01/10/2018 05:55 PM, Stefan Karlsson wrote:
> Hi Yasumasa,
>
> Here's my first stab at adding the ZGC load barries to the SA:
>
> http://cr.openjdk.java.net/~stefank/zgc/zSALoadBarriers/webrev.01/
Just one comment, in ZPage.java:
91 // There's no relocate operation in the SA. Simply use the
from address and hope for the best.
92 return from;
we should return ZAddress.good(from) here. And then we can remove the
last part of the comment. Maybe say something about in-place forwarding
instead.
cheers,
Per
>
> I find it unfortunate that we have to duplicate the C++ code into Java,
> to get this to work. But it is what it is.
>
> Some comments about the code:
>
> 1) Some of the constants are Linux-specific and there's no platform
> abstraction in place.
>
> 2) ZOop.to_address subverts the type system so that we can get from
> OopHandles and longs to Addresses. This seems to be frowned upon if you
> read the SA code. Maybe there are more correct ways to implement this?
>
> 3) I use the ZGC weak barrier, since the SA agent only needs to be able
> to access the Objects, not mark them. Which is what the weak barriers
> provide.
>
> 4) I see that you used VMObjectFactory.newObject, I skipped that part,
> but we can think about unifying our patches.
>
> 5) I had to invent a way to read global variables from HotSpot. See the
> usage of ZGlobalsForVMStructs. Maybe there's a more correct way to do this?
>
> I stress tested the thread dumping part that threw exceptions for me
> earlier by running SPECjbb2005:
> $ java -XX:+UseZGC -Xlog:gc -cp jbb.jar:check.jar spec.jbb.JBBmain
>
> and then continuously dumping the threads:
> $ while true; do echo -e "verbose true\nthreads" | jhsdb -J-ea clhsdb
> --pid=`jps | grep JBBmain | awk '{print $1}'`; done
>
>
> Cheers,
> StefanK
>
> On 2018-01-09 13:59, Yasumasa Suenaga wrote:
>> Hi Stefan,
>>
>>
>>> Let me try to create an initial prototype for load barriers in the SA
>>> case and see where this takes us.
>>
>> Sure!
>>
>>
>>> FYI i also found that compressed oops are not fully supported in the SA:
>>> https://bugs.openjdk.java.net/browse/JDK-8194737
>>
>> Thanks, I didn't know that.
>> I hope this issue will be fixed soon :-)
>>
>>
>> Yasumasa
>>
>>
>> On 2018/01/09 18:36, Stefan Karlsson wrote:
>>> Hi Yasumasa,
>>>
>>> Thanks for your contribution!
>>>
>>> I tested your patch together with jhsdb hsdb and immediately hit
>>> problems because of the lack of load barriers in the SA code. Let me
>>> try to create an initial prototype for load barriers in the SA case
>>> and see where this takes us.
>>>
>>> FYI i also found that compressed oops are not fully supported in the SA:
>>> https://bugs.openjdk.java.net/browse/JDK-8194737
>>>
>>> Thanks,
>>> StefanK
>>>
>>> On 2017-12-21 23:38, Yasumasa Suenaga wrote:
>>>> Thanks Per!
>>>>
>>>> I'm waiting for comments and sponsorship.
>>>>
>>>>
>>>> Yasumasa
>>>>
>>>>
>>>> On 2017/12/22 4:33, Per Liden wrote:
>>>>> Hi Yasumasa,
>>>>>
>>>>> On 2017-12-21 09:40, Yasumasa Suenaga wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I checked SA implementation for ZGC, but it is not yet available.
>>>>>> For example, we can see WrongTypeException when CLHSDB `universe`
>>>>>> command is executed.
>>>>>>
>>>>>> As the first step, I propose to implement ZCollectedHeap and
>>>>>> related classes for
>>>>>> SA as this webrev:
>>>>>>
>>>>>> http://cr.openjdk.java.net/~ysuenaga/z/sa-universe/
>>>>>>
>>>>>> After applying this patch, we can use `universe` command on CLHSDB.
>>>>>> (I followed `VM.info` jcmd output format)
>>>>>
>>>>> Thanks! Most of us working on ZGC are currently on vacation, but
>>>>> we'll have a closer look at the patch after the holidays.
>>>>>
>>>>> cheers,
>>>>> Per
>>>>>
>>>>>>
>>>>>> Of course, it is not all. We need to work more for it.
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Yasumasa
>>>>>>
More information about the zgc-dev
mailing list