Reference to a document in the sources

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

Reference to a document in the sources

Ivan Krylov-4
Hi all,

In the sources for klass.hpp [1] there is a reference to some discussion

// The fields _super_check_offset, _secondary_super_cache, _secondary_supers
// and _primary_supers all help make fast subtype checks. See big discussion
// in doc/server_compiler/checktype.txt

This reference is present in JDK 11 latest sources however this comment
dates back to as far as I can trace (1.7).
I assume this link is to some internal wiki page. Is it possible to make
it publicly visible somehow? It is understood that the content is likely
to be outdated.

Thanks,
Ivan

[1] -
http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105




Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

Gilles Duboscq-2
Hi Ivan,

I don't know for sure what that file contains but it's probably very similar to the content of this paper: Fast subtype checking in the HotSpot JVM [1].

 Gilles

[1]: https://dl.acm.org/citation.cfm?id=583821

On 13/06/18 14:20, Ivan Krylov wrote:

> Hi all,
>
> In the sources for klass.hpp [1] there is a reference to some discussion
>
> // The fields _super_check_offset, _secondary_super_cache, _secondary_supers
> // and _primary_supers all help make fast subtype checks. See big discussion
> // in doc/server_compiler/checktype.txt
>
> This reference is present in JDK 11 latest sources however this comment dates back to as far as I can trace (1.7).
> I assume this link is to some internal wiki page. Is it possible to make it publicly visible somehow? It is understood that the content is likely to be outdated.
>
> Thanks,
> Ivan
>
> [1] - http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

David Holmes
On 13/06/2018 10:32 PM, Gilles Duboscq wrote:
> Hi Ivan,
>
> I don't know for sure what that file contains but it's probably very similar to the content of this paper: Fast subtype checking in the HotSpot JVM [1].

That seems like a good bet. The comment was added in September 2001 - by
Cliff Click.

I can't find any trace of the actual file though.

Cheers,
David

>   Gilles
>
> [1]: https://dl.acm.org/citation.cfm?id=583821
>
> On 13/06/18 14:20, Ivan Krylov wrote:
>> Hi all,
>>
>> In the sources for klass.hpp [1] there is a reference to some discussion
>>
>> // The fields _super_check_offset, _secondary_super_cache, _secondary_supers
>> // and _primary_supers all help make fast subtype checks. See big discussion
>> // in doc/server_compiler/checktype.txt
>>
>> This reference is present in JDK 11 latest sources however this comment dates back to as far as I can trace (1.7).
>> I assume this link is to some internal wiki page. Is it possible to make it publicly visible somehow? It is understood that the content is likely to be outdated.
>>
>> Thanks,
>> Ivan
>>
>> [1] - http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105
>>
>>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

Vladimir Ivanov
The file is located at:
   hotspot/doc/server-compiler/checktype.txt

I can trace it till 6u1 and its content matches the article pretty well.
Still it'd be nice to have it published on OpenJDK wiki [1].

Best regards,
Vladimir Ivanov

[1] https://wiki.openjdk.java.net/display/HotSpot/Main

On 13/06/2018 15:55, David Holmes wrote:

> On 13/06/2018 10:32 PM, Gilles Duboscq wrote:
>> Hi Ivan,
>>
>> I don't know for sure what that file contains but it's probably very
>> similar to the content of this paper: Fast subtype checking in the
>> HotSpot JVM [1].
>
> That seems like a good bet. The comment was added in September 2001 - by
> Cliff Click.
>
> I can't find any trace of the actual file though.
>
> Cheers,
> David
>
>>   Gilles
>>
>> [1]: https://dl.acm.org/citation.cfm?id=583821
>>
>> On 13/06/18 14:20, Ivan Krylov wrote:
>>> Hi all,
>>>
>>> In the sources for klass.hpp [1] there is a reference to some discussion
>>>
>>> // The fields _super_check_offset, _secondary_super_cache,
>>> _secondary_supers
>>> // and _primary_supers all help make fast subtype checks. See big
>>> discussion
>>> // in doc/server_compiler/checktype.txt
>>>
>>> This reference is present in JDK 11 latest sources however this
>>> comment dates back to as far as I can trace (1.7).
>>> I assume this link is to some internal wiki page. Is it possible to
>>> make it publicly visible somehow? It is understood that the content
>>> is likely to be outdated.
>>>
>>> Thanks,
>>> Ivan
>>>
>>> [1] -
>>> http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105 
>>>
>>>
>>>
>>>
>>>
Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

John Rose-3
A blast from the past!  I posted a copy (sampled circa JDK 1.4.2) here:

http://cr.openjdk.java.net/~jrose/jvm/checktype-2001.txt

— John

On Jun 13, 2018, at 6:53 AM, Vladimir Ivanov <[hidden email]> wrote:

>
> The file is located at:
>  hotspot/doc/server-compiler/checktype.txt
>
> I can trace it till 6u1 and its content matches the article pretty well. Still it'd be nice to have it published on OpenJDK wiki [1].
>
> Best regards,
> Vladimir Ivanov
>
> [1] https://wiki.openjdk.java.net/display/HotSpot/Main
>
> On 13/06/2018 15:55, David Holmes wrote:
>> On 13/06/2018 10:32 PM, Gilles Duboscq wrote:
>>> Hi Ivan,
>>>
>>> I don't know for sure what that file contains but it's probably very similar to the content of this paper: Fast subtype checking in the HotSpot JVM [1].
>> That seems like a good bet. The comment was added in September 2001 - by Cliff Click.
>> I can't find any trace of the actual file though.
>> Cheers,
>> David
>>>   Gilles
>>>
>>> [1]: https://dl.acm.org/citation.cfm?id=583821
>>>
>>> On 13/06/18 14:20, Ivan Krylov wrote:
>>>> Hi all,
>>>>
>>>> In the sources for klass.hpp [1] there is a reference to some discussion
>>>>
>>>> // The fields _super_check_offset, _secondary_super_cache, _secondary_supers
>>>> // and _primary_supers all help make fast subtype checks. See big discussion
>>>> // in doc/server_compiler/checktype.txt
>>>>
>>>> This reference is present in JDK 11 latest sources however this comment dates back to as far as I can trace (1.7).
>>>> I assume this link is to some internal wiki page. Is it possible to make it publicly visible somehow? It is understood that the content is likely to be outdated.
>>>>
>>>> Thanks,
>>>> Ivan
>>>>
>>>> [1] - http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105 
>>>>
>>>>
>>>>
>>>>

Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

Andrew Dinn
On 13/06/18 15:11, John Rose wrote:
> A blast from the past!  I posted a copy (sampled circa JDK 1.4.2) here:
>
> http://cr.openjdk.java.net/~jrose/jvm/checktype-2001.txt
Oooh, very nice! I am glad (and not at all surprised) to see this stuff
was indeed based on a written spec backed up by careful testing. I could
have done with seeing this doc a year ago before I started trying to
work it all out from the code ;-)

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

John Rose-3
On Jun 13, 2018, at 9:35 AM, Andrew Dinn <[hidden email]> wrote:
>
> On 13/06/18 15:11, John Rose wrote:
>> A blast from the past!  I posted a copy (sampled circa JDK 1.4.2) here:
>>
>> http://cr.openjdk.java.net/~jrose/jvm/checktype-2001.txt <http://cr.openjdk.java.net/~jrose/jvm/checktype-2001.txt>
> Oooh, very nice! I am glad (and not at all surprised) to see this stuff
> was indeed based on a written spec backed up by careful testing. I could
> have done with seeing this doc a year ago before I started trying to
> work it all out from the code ;-)

Thank you!

The design has worn well over the years.  There is one serious
flaw that I am aware of:  In certain unusual workloads, the secondary
supertype cache will thrash, *and* multiple threads will thrash it.
This leads to a slowdown from cache line motion, which is more
noticeable than just the slowdown from repeatedly linear-searching
the supertype array.

I think there's some Scala workload out there that shows this, when
many threads iterate over a list of objects testing each object against
two (or more) different interfaces.  That will continually refill the SSC.

The solution would be to throttle updates to the secondary supertype
cache if they become very frequent, or (and now I'm dreaming) if the
processor can detect too many RTO events on the cache line.

This would be a good project for someone to take on.  The bug is:
  https://bugs.openjdk.java.net/browse/JDK-8180450

— John
Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

David Holmes
In reply to this post by Vladimir Ivanov
On 13/06/2018 11:53 PM, Vladimir Ivanov wrote:
> The file is located at:
>    hotspot/doc/server-compiler/checktype.txt

?? Help me out with the initial part of that path please. :) Where is
this "hotspot" directory?

Thanks,
David

> I can trace it till 6u1 and its content matches the article pretty well.
> Still it'd be nice to have it published on OpenJDK wiki [1].
>
> Best regards,
> Vladimir Ivanov
>
> [1] https://wiki.openjdk.java.net/display/HotSpot/Main
>
> On 13/06/2018 15:55, David Holmes wrote:
>> On 13/06/2018 10:32 PM, Gilles Duboscq wrote:
>>> Hi Ivan,
>>>
>>> I don't know for sure what that file contains but it's probably very
>>> similar to the content of this paper: Fast subtype checking in the
>>> HotSpot JVM [1].
>>
>> That seems like a good bet. The comment was added in September 2001 -
>> by Cliff Click.
>>
>> I can't find any trace of the actual file though.
>>
>> Cheers,
>> David
>>
>>>   Gilles
>>>
>>> [1]: https://dl.acm.org/citation.cfm?id=583821
>>>
>>> On 13/06/18 14:20, Ivan Krylov wrote:
>>>> Hi all,
>>>>
>>>> In the sources for klass.hpp [1] there is a reference to some
>>>> discussion
>>>>
>>>> // The fields _super_check_offset, _secondary_super_cache,
>>>> _secondary_supers
>>>> // and _primary_supers all help make fast subtype checks. See big
>>>> discussion
>>>> // in doc/server_compiler/checktype.txt
>>>>
>>>> This reference is present in JDK 11 latest sources however this
>>>> comment dates back to as far as I can trace (1.7).
>>>> I assume this link is to some internal wiki page. Is it possible to
>>>> make it publicly visible somehow? It is understood that the content
>>>> is likely to be outdated.
>>>>
>>>> Thanks,
>>>> Ivan
>>>>
>>>> [1] -
>>>> http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105 
>>>>
>>>>
>>>>
>>>>
>>>>
Reply | Threaded
Open this post in threaded view
|

Re: Reference to a document in the sources

David Holmes
On 14/06/2018 7:42 AM, David Holmes wrote:
> On 13/06/2018 11:53 PM, Vladimir Ivanov wrote:
>> The file is located at:
>>    hotspot/doc/server-compiler/checktype.txt
>
> ?? Help me out with the initial part of that path please. :) Where is
> this "hotspot" directory?

Ah I see. hotspot/doc appeared in the workspace circa 1.4, but was not
in 1.3.1. However the 1.4 workspace doesn't have server-compiler in it,
and as that post-dates when the comment was added (2002 versus 2001) I
was only looking for it earlier.

Cheers,
David

> Thanks,
> David
>
>> I can trace it till 6u1 and its content matches the article pretty
>> well. Still it'd be nice to have it published on OpenJDK wiki [1].
>>
>> Best regards,
>> Vladimir Ivanov
>>
>> [1] https://wiki.openjdk.java.net/display/HotSpot/Main
>>
>> On 13/06/2018 15:55, David Holmes wrote:
>>> On 13/06/2018 10:32 PM, Gilles Duboscq wrote:
>>>> Hi Ivan,
>>>>
>>>> I don't know for sure what that file contains but it's probably very
>>>> similar to the content of this paper: Fast subtype checking in the
>>>> HotSpot JVM [1].
>>>
>>> That seems like a good bet. The comment was added in September 2001 -
>>> by Cliff Click.
>>>
>>> I can't find any trace of the actual file though.
>>>
>>> Cheers,
>>> David
>>>
>>>>   Gilles
>>>>
>>>> [1]: https://dl.acm.org/citation.cfm?id=583821
>>>>
>>>> On 13/06/18 14:20, Ivan Krylov wrote:
>>>>> Hi all,
>>>>>
>>>>> In the sources for klass.hpp [1] there is a reference to some
>>>>> discussion
>>>>>
>>>>> // The fields _super_check_offset, _secondary_super_cache,
>>>>> _secondary_supers
>>>>> // and _primary_supers all help make fast subtype checks. See big
>>>>> discussion
>>>>> // in doc/server_compiler/checktype.txt
>>>>>
>>>>> This reference is present in JDK 11 latest sources however this
>>>>> comment dates back to as far as I can trace (1.7).
>>>>> I assume this link is to some internal wiki page. Is it possible to
>>>>> make it publicly visible somehow? It is understood that the content
>>>>> is likely to be outdated.
>>>>>
>>>>> Thanks,
>>>>> Ivan
>>>>>
>>>>> [1] -
>>>>> http://hg.openjdk.java.net/jdk/jdk/file/7bf4f1b5e438/src/hotspot/share/oops/klass.hpp#l105 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>