From erik.osterlund at oracle.com Thu Mar 1 15:46:58 2018
From: erik.osterlund at oracle.com (=?utf-8?Q?Erik_=C3=96sterlund?=)
Date: Thu, 1 Mar 2018 16:46:58 +0100
Subject: RFR (XS): 8198896: Remove dead code: cardTableModRefBSForCTRS.hpp
Message-ID: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
Hi,
The cardTableModRefBSForCTRS.hpp file is no longer referenced from anywhere and may be removed.
Webrev:
http://cr.openjdk.java.net/~eosterlund/8198896/webrev.00/
Bug:
https://bugs.openjdk.java.net/browse/JDK-8198896
Thanks,
/Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From kim.barrett at oracle.com Thu Mar 1 21:39:23 2018
From: kim.barrett at oracle.com (Kim Barrett)
Date: Thu, 1 Mar 2018 16:39:23 -0500
Subject: RFR (XS): 8198896: Remove dead code: cardTableModRefBSForCTRS.hpp
In-Reply-To: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
References: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
Message-ID: <9E1FDCF9-20C9-4331-AF3B-B8EDB9C7F6C3@oracle.com>
> On Mar 1, 2018, at 10:46 AM, Erik ?sterlund wrote:
>
> Hi,
>
> The cardTableModRefBSForCTRS.hpp file is no longer referenced from anywhere and may be removed.
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8198896/webrev.00/
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8198896
>
> Thanks,
> /Erik
Looks good.
From per.liden at oracle.com Fri Mar 2 06:45:44 2018
From: per.liden at oracle.com (Per Liden)
Date: Fri, 2 Mar 2018 07:45:44 +0100
Subject: RFR (XS): 8198896: Remove dead code: cardTableModRefBSForCTRS.hpp
In-Reply-To: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
References: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
Message-ID: <88df8a71-1b9f-0ff9-1df0-85c776799b17@oracle.com>
Looks good!
/Per
On 03/01/2018 04:46 PM, Erik ?sterlund wrote:
> Hi,
>
> The cardTableModRefBSForCTRS.hpp file is no longer referenced from
> anywhere and may be removed.
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8198896/webrev.00/
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8198896
>
> Thanks,
> /Erik
From erik.osterlund at oracle.com Fri Mar 2 07:11:40 2018
From: erik.osterlund at oracle.com (Erik Osterlund)
Date: Fri, 2 Mar 2018 08:11:40 +0100
Subject: RFR (XS): 8198896: Remove dead code: cardTableModRefBSForCTRS.hpp
In-Reply-To: <9E1FDCF9-20C9-4331-AF3B-B8EDB9C7F6C3@oracle.com>
References: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
<9E1FDCF9-20C9-4331-AF3B-B8EDB9C7F6C3@oracle.com>
Message-ID:
Hi Kim,
Thanks for the review.
/Erik
On 1 Mar 2018, at 22:39, Kim Barrett wrote:
>> On Mar 1, 2018, at 10:46 AM, Erik ?sterlund wrote:
>>
>> Hi,
>>
>> The cardTableModRefBSForCTRS.hpp file is no longer referenced from anywhere and may be removed.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8198896/webrev.00/
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8198896
>>
>> Thanks,
>> /Erik
>
> Looks good.
>
From erik.osterlund at oracle.com Fri Mar 2 07:12:20 2018
From: erik.osterlund at oracle.com (Erik Osterlund)
Date: Fri, 2 Mar 2018 08:12:20 +0100
Subject: RFR (XS): 8198896: Remove dead code: cardTableModRefBSForCTRS.hpp
In-Reply-To: <88df8a71-1b9f-0ff9-1df0-85c776799b17@oracle.com>
References: <06EB2BA8-321E-4647-81A8-D943D95D5C70@oracle.com>
<88df8a71-1b9f-0ff9-1df0-85c776799b17@oracle.com>
Message-ID: <6F663A75-7BD6-4FE4-A5C5-F86B256F94EF@oracle.com>
Hi Per,
Thanks for the review.
/Erik
> On 2 Mar 2018, at 07:45, Per Liden wrote:
>
> Looks good!
>
> /Per
>
>> On 03/01/2018 04:46 PM, Erik ?sterlund wrote:
>> Hi,
>> The cardTableModRefBSForCTRS.hpp file is no longer referenced from anywhere and may be removed.
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8198896/webrev.00/
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8198896
>> Thanks,
>> /Erik
From erik.helin at oracle.com Fri Mar 2 10:39:55 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Fri, 2 Mar 2018 11:39:55 +0100
Subject: RFR: 8198948: Remove unused parameter evacuation_info from
G1CollectedHeap::evacuate_collection_set
Message-ID:
Hi all,
while cruising through the code on this fine Friday morning I noticed
that the parameter evacuation_info for
G1CollectedHeap::evacuate_collection_set is not used, so I simply
removed it :)
Issue:
https://bugs.openjdk.java.net/browse/JDK-8198948
Webrev:
http://cr.openjdk.java.net/~ehelin/8198948/00/
Testing:
- make run-test-tier1 on Linux x86-64
Thanks,
Erik
From stefan.johansson at oracle.com Fri Mar 2 10:45:53 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Fri, 2 Mar 2018 11:45:53 +0100
Subject: RFR: 8198948: Remove unused parameter evacuation_info from
G1CollectedHeap::evacuate_collection_set
In-Reply-To:
References:
Message-ID:
On 2018-03-02 11:39, Erik Helin wrote:
> Hi all,
>
> while cruising through the code on this fine Friday morning I noticed
> that the parameter evacuation_info for
> G1CollectedHeap::evacuate_collection_set is not used, so I simply
> removed it :)
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8198948
>
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8198948/00/
>
Looks good, thanks for cleaning this up.
Cheers,
Stefan
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From erik.helin at oracle.com Fri Mar 2 11:12:58 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Fri, 2 Mar 2018 12:12:58 +0100
Subject: RFR: 8197843: Remove unused method
G1EvacuationRootClosures::create_root_closures_ext
Message-ID:
Hi all,
this patch removes the unused method
G1EvacuationRootClosures::create_root_closures_ext. Since this method is
the sole content of the file g1RootClosures_ext.cpp, that file is also
removed.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8197843
Patch:
http://cr.openjdk.java.net/~ehelin/8197843/00/
Testing:
- make run-test-tier1 on Linux x86-64
Thanks,
Erik
From thomas.schatzl at oracle.com Fri Mar 2 11:42:15 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Fri, 02 Mar 2018 12:42:15 +0100
Subject: RFR: 8198948: Remove unused parameter evacuation_info from
G1CollectedHeap::evacuate_collection_set
In-Reply-To:
References:
Message-ID: <1519990935.5140.1.camel@oracle.com>
Hi,
On Fri, 2018-03-02 at 11:39 +0100, Erik Helin wrote:
> Hi all,
>
> while cruising through the code on this fine Friday morning I
> noticed
> that the parameter evacuation_info for
> G1CollectedHeap::evacuate_collection_set is not used, so I simply
> removed it :)
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8198948
>
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8198948/00/
>
> Testing:
> - make run-test-tier1 on Linux x86-64
looks good.
Thomas
From stefan.johansson at oracle.com Fri Mar 2 12:26:11 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Fri, 2 Mar 2018 13:26:11 +0100
Subject: RFR: 8197843: Remove unused method
G1EvacuationRootClosures::create_root_closures_ext
In-Reply-To:
References:
Message-ID:
On 2018-03-02 12:12, Erik Helin wrote:
> Hi all,
>
> this patch removes the unused method
> G1EvacuationRootClosures::create_root_closures_ext. Since this method
> is the sole content of the file g1RootClosures_ext.cpp, that file is
> also removed.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197843
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197843/00/
Looks good,
Stefan
>
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From erik.osterlund at oracle.com Fri Mar 2 12:32:17 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Fri, 2 Mar 2018 13:32:17 +0100
Subject: RFR: 8197843: Remove unused method
G1EvacuationRootClosures::create_root_closures_ext
In-Reply-To:
References:
Message-ID: <5A994451.2000106@oracle.com>
Hi Erik,
Looks good.
Thanks,
/Erik
On 2018-03-02 12:12, Erik Helin wrote:
> Hi all,
>
> this patch removes the unused method
> G1EvacuationRootClosures::create_root_closures_ext. Since this method
> is the sole content of the file g1RootClosures_ext.cpp, that file is
> also removed.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197843
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197843/00/
>
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From erik.helin at oracle.com Fri Mar 2 13:30:50 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Fri, 2 Mar 2018 14:30:50 +0100
Subject: RFR: 8197847: Remove unused file g1ParScanThreadState_ext.cpp
Message-ID: <7bd6d3d1-c166-ef35-25d3-e6858e88a5f2@oracle.com>
Hi all,
this patch removes the unused file g1ParScanThreadState_ext.cpp and also
all the mechanics involved with using these extension points.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8197847
Patch:
http://cr.openjdk.java.net/~ehelin/8197847/00/
Testing:
- make run-test-tier1 on Linux x86-64
Thanks,
Erik
From stefan.johansson at oracle.com Fri Mar 2 14:39:00 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Fri, 2 Mar 2018 15:39:00 +0100
Subject: RFR: 8197847: Remove unused file g1ParScanThreadState_ext.cpp
In-Reply-To: <7bd6d3d1-c166-ef35-25d3-e6858e88a5f2@oracle.com>
References: <7bd6d3d1-c166-ef35-25d3-e6858e88a5f2@oracle.com>
Message-ID:
On 2018-03-02 14:30, Erik Helin wrote:
> Hi all,
>
> this patch removes the unused file g1ParScanThreadState_ext.cpp and
> also all the mechanics involved with using these extension points.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197847
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197847/00/
>
Looks good,
Stefan
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From erik.osterlund at oracle.com Fri Mar 2 15:12:43 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Fri, 2 Mar 2018 16:12:43 +0100
Subject: RFR: 8197847: Remove unused file g1ParScanThreadState_ext.cpp
In-Reply-To: <7bd6d3d1-c166-ef35-25d3-e6858e88a5f2@oracle.com>
References: <7bd6d3d1-c166-ef35-25d3-e6858e88a5f2@oracle.com>
Message-ID: <5A9969EB.50104@oracle.com>
Hi Erik,
Looks good.
Thanks,
/Erik
On 2018-03-02 14:30, Erik Helin wrote:
> Hi all,
>
> this patch removes the unused file g1ParScanThreadState_ext.cpp and
> also all the mechanics involved with using these extension points.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197847
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197847/00/
>
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From erik.helin at oracle.com Fri Mar 2 15:53:42 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Fri, 2 Mar 2018 16:53:42 +0100
Subject: RFR: 8198957: Remove unused function
ArgumentsExt::set_gc_specific_flags
Message-ID: <366e468e-0283-b338-77d8-97df0c1fc905@oracle.com>
Hi all,
this small patch removes the unused function
ArgumentsExt::set_gc_specific_flags.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8198957
Patch:
http://cr.openjdk.java.net/~ehelin/8198957/00/
Testing:
- make run-test-tier1 on Linux x86-64
Thanks,
Erik
From stefan.johansson at oracle.com Fri Mar 2 16:04:12 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Fri, 2 Mar 2018 17:04:12 +0100
Subject: RFR: 8198957: Remove unused function
ArgumentsExt::set_gc_specific_flags
In-Reply-To: <366e468e-0283-b338-77d8-97df0c1fc905@oracle.com>
References: <366e468e-0283-b338-77d8-97df0c1fc905@oracle.com>
Message-ID: <93606fe4-f2c7-6543-a8ef-9ca351c388f3@oracle.com>
Looks awesome!
Stefan
On 2018-03-02 16:53, Erik Helin wrote:
> Hi all,
>
> this small patch removes the unused function
> ArgumentsExt::set_gc_specific_flags.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8198957
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8198957/00/
>
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From erik.helin at oracle.com Fri Mar 2 16:04:11 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Fri, 2 Mar 2018 17:04:11 +0100
Subject: RFR: 8197845: Remove unnecessary method
G1CollectedHeap::create_g1_policy
Message-ID: <028ebe1d-c200-a990-d844-5917a039f1fd@oracle.com>
Hi all,
this patch removes the no longer needed method
G1CollectedHeap::create_g1_policy. Since that method is the sole content
of the file g1CollectedHeap_ext.cpp, that file is also removed as part
of this patch.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8197845
Patch:
http://cr.openjdk.java.net/~ehelin/8197845/00/
Testing:
- make run-test-tier1 on Linux x86-64
Thanks,
Erik
From thomas.schatzl at oracle.com Mon Mar 5 07:53:25 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 08:53:25 +0100
Subject: RFR: 8198957: Remove unused function
ArgumentsExt::set_gc_specific_flags
In-Reply-To: <366e468e-0283-b338-77d8-97df0c1fc905@oracle.com>
References: <366e468e-0283-b338-77d8-97df0c1fc905@oracle.com>
Message-ID: <1520236405.2532.0.camel@oracle.com>
Hi,
On Fri, 2018-03-02 at 16:53 +0100, Erik Helin wrote:
> Hi all,
>
> this small patch removes the unused function
> ArgumentsExt::set_gc_specific_flags.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8198957
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8198957/00/
>
> Testing:
> - make run-test-tier1 on Linux x86-64
looks good.
Thomas
From stefan.johansson at oracle.com Mon Mar 5 08:18:13 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 5 Mar 2018 09:18:13 +0100
Subject: RFR: 8197845: Remove unnecessary method
G1CollectedHeap::create_g1_policy
In-Reply-To: <028ebe1d-c200-a990-d844-5917a039f1fd@oracle.com>
References: <028ebe1d-c200-a990-d844-5917a039f1fd@oracle.com>
Message-ID: <2f24383e-b180-91f2-d851-40882af43cd3@oracle.com>
Looks good,
Stefan
On 2018-03-02 17:04, Erik Helin wrote:
> Hi all,
>
> this patch removes the no longer needed method
> G1CollectedHeap::create_g1_policy. Since that method is the sole
> content of the file g1CollectedHeap_ext.cpp, that file is also removed
> as part of this patch.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197845
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197845/00/
>
> Testing:
> - make run-test-tier1 on Linux x86-64
>
> Thanks,
> Erik
From thomas.schatzl at oracle.com Mon Mar 5 08:31:50 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 09:31:50 +0100
Subject: RFR: 8197845: Remove unnecessary method
G1CollectedHeap::create_g1_policy
In-Reply-To: <028ebe1d-c200-a990-d844-5917a039f1fd@oracle.com>
References: <028ebe1d-c200-a990-d844-5917a039f1fd@oracle.com>
Message-ID: <1520238710.2532.3.camel@oracle.com>
Hi,
On Fri, 2018-03-02 at 17:04 +0100, Erik Helin wrote:
> Hi all,
>
> this patch removes the no longer needed method
> G1CollectedHeap::create_g1_policy. Since that method is the sole
> content of the file g1CollectedHeap_ext.cpp, that file is also
> removed as part of this patch.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197845
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197845/00/
>
Looks good.
Thanks,
Thomas
From thomas.schatzl at oracle.com Mon Mar 5 14:09:45 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 15:09:45 +0100
Subject: RFR [0/7]: Rebuild remembered sets concurrently
Message-ID: <1520258985.2532.40.camel@oracle.com>
Hi all,
I would like to ask for reviews for a significant change in how G1
manages its remembered sets by rebuilding its remembered sets
concurrently.
Currently G1 maintains the remembered sets for all regions all the
time. This has several drawbacks:
- memory consumption for remembered sets is very high all the time, not
only due to actually storing these remembered sets, but also due to
additional memory wastage due to fragmentation.
- the mechanism to combat this memory fragmentation (somewhat) has been
to periodically "scrub" remembered sets, at high costs during the
"Cleanup" pause.
- maintenance of ultimately unused remembered sets decreases overall
throughput.
With these changes, G1 will only maintain remembered sets that will
ever be considered for evacuation ("candidate collection set regions")
only during marking and the following mixed gc phase.
This not only to a very significant degree decreases average memory
consumption (e.g. during the young-only phase mainly remembered sets
for young-only regions are maintained), but also maximum memory
consumption, as there is little fragmentation while remembered sets are
maintained.
There is no need for scrubbing the remembered sets any more either,
making the Cleanup pause very fast. This allows us to actually remove
some previously (very small) concurrent phase.
As a beneficial side-effect we noticed that particularly mixed gc
performance may increase significantly (up to like 40%-50% faster) due
to improved remembered set memory locality.
Particularly "big data" workloads where the remembered sets take a lot
of memory and maintenance cpu resources benefit most, but we have also
noticed significant throughput improvements when running with G1 in
other cases.
The only drawback we are aware of is that the delay from start of
marking to the first mixed gc is longer. G1's mechanism to adaptively
start marking seems to be able to manage this change nicely, but some
people that already set a very high specific IHOP manually may
experience full gcs.
Due to the large benefits we do not intend to provide the original
behavior, although it could be implemented as the decisions which
regions to maintain the remembered sets are encapsulated into a single
class.
For more information look at my somewhat recent FOSDEM talk explaining
this change in more details [1].
For further review purposes this change will be split into seven
distinct changesets that will be organized into a thread below this
post, each tagged with a running number. Obviously they are dependent
on each other.
These are in order:
8197569: Refactor eager reclaim for concurrent remembered set
rebuilding
8197570: Make rules for choosing collection set candidates more
explicit
8197850: Calculate liveness in regions during marking
8180415: Rebuild remembered sets during concurrent mark (main change)
8197573: Remove concurrent cleanup and secondary free list handling
8197928: Only enqueue deferred cards with references into regions that
have a tracked remembered set during GC
8197932: Better split work in rebuild remembered sets phase
Each of those changesets will have its own webrev, and there will be
notes about each of the changes. However, for reference a webrev
containing all the changes can be found here:
http://cr.openjdk.java.net/~tschatzl/rebuild-all/webrev/
Testing: hs-tier1-5, internal perf tests
Enjoy! :)
Thomas
[1] https://fosdem.org/2018/schedule/event/g1/
From thomas.schatzl at oracle.com Mon Mar 5 14:18:19 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 15:18:19 +0100
Subject: RFR [1/7]: 8197569: Refactor eager reclaim for concurrent
remembered set rebuilding
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520259499.2532.44.camel@oracle.com>
Hi all,
can I have some reviews for the following change that refactors the
eager reclaim condition so that it can be later used for the policy
that determines for which regions G1 should rebuild the remembered set?
(And it's a reasonable refactoring on its own btw).
CR:
https://bugs.openjdk.java.net/browse/JDK-8197569
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197569/webrev/
Testing:
hs-tier 1-5, mostly as part of other related changes
Thanks,
Thomas
From thomas.schatzl at oracle.com Mon Mar 5 14:22:15 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 15:22:15 +0100
Subject: RFR [S][2/7] 8197570: Make rules for choosing collection set
candidates more explicit
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520259735.2532.48.camel@oracle.com>
Hi all,
can I have reviews for this change that makes the rule (occupancy)
for choosing collection set candidates more explicit, i.e. factor it
into a single method. This is needed for selecting the regions we want
to rebuild the remembered sets concurrently (JDK-8180415) more
straightforward.
It also adds a method to allow iteration over the regions in the
collection set - I did not see that worth an extra webrev.
CR:
https://bugs.openjdk.java.net/browse/JDK-8197570
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197570/webrev/
Testing:
hs-tier 1-5, mostly in conjunction with related changes
Thanks,
Thomas
From thomas.schatzl at oracle.com Mon Mar 5 14:41:42 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 15:41:42 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520260902.2532.66.camel@oracle.com>
Hi all,
can I have reviews for this change that calculates the liveness in
regions (below nTAMS) during marking?
This is required to be more clever about selecting the regions G1 is
going to rebuild the remembered sets for (i.e. the well-known
G1MixedGCLiveThresholdPercent threshold).
This slows down the marking part of the concurrent phase a bit, but all
alternatives were worse:
- initially rebuild everything and then drop remembered sets for
regions for too highly occupied regions at cleanup: wastes lots of
space and memory maintaining these superfluous remembered sets.
- choose regions using previous marking cycle data: this is generally
not a good idea if your marking cycles are infrequent (which should be
the normal case), as it tends to make too few regions available for
evacuation (e.g. eager reclaim may already reclaim a lot). I.e. you
need extra headroom, or be more aggressive with rebuilding.
The main change, next to the calls that add the liveness to some
internal data structure every time an object is marked, is some per-
thread cache that (G1RegionMarkStatsCache). It helps decreasing the
synchronization overhead the (atomic) increments in the global result
cause.
It is a very simple fixed size hashmap where increments to the same
entries are collected, and on collision evicts the previous entry,
doing the atomic operation on the global result.
There is also some unfortunate moving of code that is required to flush
these caches correctly during mark overflow handling.
CR:
https://bugs.openjdk.java.net/browse/JDK-8197850
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.html
Testing:
hs-tier 1-5; the next change will add an assert that verifies that this
concurrently calculated value is correct at the end of rebuild, i.e.
the results will always verified.
Thanks,
Thomas
From erik.helin at oracle.com Mon Mar 5 15:02:54 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Mon, 5 Mar 2018 16:02:54 +0100
Subject: RFR: 8197852: Move G1DefaultPolicy into G1Policy
Message-ID:
Hi all,
this fairly small patch re-unites G1Policy and G1DefaultPolicy, there is
no need for having both classes. With this patch we only have G1Policy
(and of course G1CollectorPolicy as the little CollectorPolicy shim).
Issue:
https://bugs.openjdk.java.net/browse/JDK-8197852
Patch:
http://cr.openjdk.java.net/~ehelin/8197852/00/
Testing:
- make run-test-tier1 on Linux, Windows, Mac, Solaris (SPARC and x86-64)
Thanks,
Erik
From thomas.schatzl at oracle.com Mon Mar 5 15:07:58 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 16:07:58 +0100
Subject: RFR [L][4/7]: 8180415: Rebuild remembered sets during the
concurrent cycle
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520262478.2532.91.camel@oracle.com>
Hi all,
can I have reviews for this change that implements the bulk of the
"rebuild remembered sets concurrently" mechanism?
This change modifies the management of remembered sets so that those
are only maintained when they are useful. This roughly means:
- always maintain remembered sets for young gen regions
- (almost) always maintain remembered sets for humongous regions (for
eager reclaim) as long as they meet the eager reclaim criteria.
- never create remembered sets for archive regions
- do not create remembered sets for any regions during full gc
- do not create remembered sets for regions with evacuation failure
(The latter two decisions may not be optimal, but the idea was to
strictly only maintain remembered sets for regions we are going to try
to evacuate soon)
- create remembered sets for old gen regions after finishing marking
(starting at the Remark pause), iff
- the liveness of these regions indicate so (liveness <=
G1MixedGCLiveThresholdPercent)
- any (non-objArray) humongous region that does not have a remembered
set yet (eg. because of full gc)
(Please see the new G1RemSetTrackingPolicy implementation for exact
details)
During the following "Rebuild Remembered Set" phase, that replaces the
"Create Live Data" phase, all non-young regions that may contain
outgoing pointers (i.e. excluding closed archive regions), G1 scans the
live objects in the regions between bottom and TARS
("top_at_rebuild_start" - yes, that's new :) for inter-region
references and add them to the appropriate remembered set.
The TARS, as the name indicates, is the top-value at the start of
remark, and the regions contain live data between this value and bottom
that needs to be scanned during this rebuild phase.
The reason for a new indicator is that nTAMS is *not* sufficient:
during marking there might have been more allocations in the old gen
that also need to be scanned for new references.
All references above TARS (and below the region's top) will be handled
by the existing barrier mechanism.
After rebuild, during the Cleanup pause, we create the new (candidate)
collection set, eventually filtering out more regions, like humongous
ones that exceed the eager reclaim criteria.
The current state of the remembered set for a given region is tracked
within the remembered set for that region (HeapRegionRememberedSet
class): a remembered set can be either Untracked, Updating or Complete.
Untracked means that we do not manage a remembered set for this region,
Complete means just that, and Updating means that we are currently in
the process of updating the remembered set. This distinction is
relevant for evacuation, e.g. we obviously must not evacuate not-
Complete remembered sets.
Note that this change contains one single temporary ugly hack that
allows G1 to work until the next change :) - so in this change G1
determines whether there will be a mixed gc phase during the Cleanup
pause. It needs to determine this information at that time, instead of
previously during concurrent cleanup, to, if there is no mixed gc
coming, drop all remembered sets to not maintain them further.
For this reason, and to avoid duplicate recalculation that may yield
different results after dropping remembered sets, there is a new flag
mixed_gc_pending in CollectorState, making it even more complicated.
That one is going away in the next change, promised. :)
Some imho useful messages about remembered set tracking are printed
using "gc, remset, tracking" log tags, both in debug and trace level.
CR:
https://bugs.openjdk.java.net/browse/JDK-8180415
Webrev:
http://cr.openjdk.java.net/~tschatzl/8180415/webrev/index.html
Testing:
hs-tier 1-5, etc. etc.
Thanks,
Thomas
From stefan.johansson at oracle.com Mon Mar 5 15:11:53 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 5 Mar 2018 16:11:53 +0100
Subject: RFR [1/7]: 8197569: Refactor eager reclaim for concurrent
remembered set rebuilding
In-Reply-To: <1520259499.2532.44.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259499.2532.44.camel@oracle.com>
Message-ID: <8d58ae9c-1c18-c317-a40c-66241faa9a81@oracle.com>
Thanks for splitting this change up Thomas,
On 2018-03-05 15:18, Thomas Schatzl wrote:
> Hi all,
>
> can I have some reviews for the following change that refactors the
> eager reclaim condition so that it can be later used for the policy
> that determines for which regions G1 should rebuild the remembered set?
> (And it's a reasonable refactoring on its own btw).
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8197569
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197569/webrev/
Look good, just one thing:
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
2542?? bool humongous_region_is_candidate(G1CollectedHeap* heap,
HeapRegion* region) const {
...
2594???? return obj->is_typeArray() &&
2595 G1CollectedHeap::heap()->is_potential_eager_reclaim_candidate(region);
You could use the passed in heap parameter instead of using
G1CollectedHeap::heap(). Another, maybe even nicer, solution would be to
move is_potential_eager_reclaim_candidate() to HeapRegion, and just call
region->is_potential_eager_reclaim_candidate().
Thanks,
Stefan
> Testing:
> hs-tier 1-5, mostly as part of other related changes
>
> Thanks,
> Thomas
From thomas.schatzl at oracle.com Mon Mar 5 15:16:35 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 16:16:35 +0100
Subject: RFR [S][5/7]: 8197573: Remove concurrent cleanup and secondary
free list handling
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520262995.2532.99.camel@oracle.com>
Hi all,
can I have reviews for this change that removes the concurrent
cleanup phase and the secondary free list handling entirely. It moves
leftover work into the Cleanup pause.
In the previous change the remembered set scrubbing, which took in
cases where it mattered like 95%+ of time, has been removed because it
is not required any more.
The reasons for removal are:
- due to JDK-8180415 *freeing* remembered sets (as opposed to
calculating occupancy) is really fast, so this phase has never been
very long for a long time.
- it adds a lock in the LAB allocation path
It also allows us to remove the "mixed_gc_pending" flag in the
CollectorState, as there is no further time to wait until G1 can
schedule the "last young gc".
CR:
https://bugs.openjdk.java.net/browse/JDK-8197573
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197573/webrev/index.html
Testing:
hs-tier 1-3, ....
(I consider this an "S" changeset because it is mostly removal of
code).
Thanks,
Thomas
From stefan.johansson at oracle.com Mon Mar 5 15:19:31 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 5 Mar 2018 16:19:31 +0100
Subject: RFR [S][2/7] 8197570: Make rules for choosing collection set
candidates more explicit
In-Reply-To: <1520259735.2532.48.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259735.2532.48.camel@oracle.com>
Message-ID: <172e3f7e-e326-274b-f20f-90167b6aaeb9@oracle.com>
Hi Thomas,
On 2018-03-05 15:22, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this change that makes the rule (occupancy)
> for choosing collection set candidates more explicit, i.e. factor it
> into a single method. This is needed for selecting the regions we want
> to rebuild the remembered sets concurrently (JDK-8180415) more
> straightforward.
>
> It also adds a method to allow iteration over the regions in the
> collection set - I did not see that worth an extra webrev.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8197570
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197570/webrev/
Looks good,
Stefan
> Testing:
> hs-tier 1-5, mostly in conjunction with related changes
>
> Thanks,
> Thomas
>
From thomas.schatzl at oracle.com Mon Mar 5 15:25:15 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 16:25:15 +0100
Subject: RFR [XS][6/7]: 8197928: Only enqueue deferred cards with
references into regions that have a tracked remembered set during GC
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520263515.2532.106.camel@oracle.com>
Hi all,
can I have reviews for this tiny change that optimizes evacuation a
little: in particular, when updating the remembered sets (enqueuing
cards), we do not need to do this for regions where we do not track the
remembered sets.
The suggested implementation is rather primitive, I have not noticed
pause time impact on doing so (of course it can lessen the concurrent
work later).
An alternative implementation I considered has been to create a per-
region map with a single flag that contains the "needs-update/does-not-
need-update" information, like the _fast_in_cset_state table.
However creating such a table requires G1 to iterate over all regions
before evacuation, and that would be something that needs to be added
as G1 does not do that yet.
Another would be to move remembered set state/remembered sets outside
of the region, so it can be accessed quickly during GC.
In any case I thought this implementation is better than not doing it,
hoping for some input here. :)
CR:
https://bugs.openjdk.java.net/browse/JDK-8197928
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197928/webrev/
Testing:
hs-tier1-5, ...
Thanks,
Thomas
From thomas.schatzl at oracle.com Mon Mar 5 15:32:43 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 16:32:43 +0100
Subject: RFR [M][7/7]: Rebuild remembered sets concurrently
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520263963.2532.113.camel@oracle.com>
Hi all,
(last one for now :))
please have a look at this change that improves TTSP during the
rebuild remembered set phase.
So in the original change G1 yields only after processing a particular
region - in case of humongous objArrays at e.g. 32M region size with
lots of references this can take a bit.
This change modifies the rebuild remembered set closure to yield more
finely grained. Still a single thread processes a single region, there
is a different CR out there for improving that a bit.
The default "chunk size" of 256K of references has been measured to
take <1ms in the large majority of cases on my setup on some of these
densely occupied humongous objArrays, there are log messages for that,
and is configurable.
CR:
https://bugs.openjdk.java.net/browse/JDK-8197932
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
Testing:
see main thread
Thanks,
Thomas
From thomas.schatzl at oracle.com Mon Mar 5 15:45:28 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 16:45:28 +0100
Subject: RFR [L][4/7]: 8180415: Rebuild remembered sets during the
concurrent cycle
In-Reply-To: <1520262478.2532.91.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262478.2532.91.camel@oracle.com>
Message-ID: <1520264728.2532.124.camel@oracle.com>
Hi all,
just a note: alternatives to this 2-pass scheme were considered and
implemented, however overall performed worse. Also alternatives to
"only" fixing the long Cleanup/Scrubbing times were considered but
rejected due to similar reasons (e.g. JDK-7187490, which contains a lot
of comments about this).
One issue is that the remembered set add operation itself just does not
scale too well (which needs significant love anyway for other reasons
too, but that is a completely different issue), and in conjunction with
the already ongoing (already bandwidth intensive) marking the overall
result is a longer total cycle time.
There is already the already mentioned issue that during marking you do
not have too good information about the heap too, so you may end up
kind of blindly rebuilding remembered sets for the wrong regions.
A separate pass may in the future also allow gathering more data to
improve the selection of the rebuild region set (see e.g. JDK-8198419).
Of course, alternative suggestions and ideas welcome :)
Thanks,
Thomas
On Mon, 2018-03-05 at 16:07 +0100, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this change that implements the bulk of the
> "rebuild remembered sets concurrently" mechanism?
>
> This change modifies the management of remembered sets so that those
> are only maintained when they are useful. This roughly means:
> - always maintain remembered sets for young gen regions
> - (almost) always maintain remembered sets for humongous regions (for
> eager reclaim) as long as they meet the eager reclaim criteria.
> - never create remembered sets for archive regions
> - do not create remembered sets for any regions during full gc
> - do not create remembered sets for regions with evacuation failure
>
> (The latter two decisions may not be optimal, but the idea was to
> strictly only maintain remembered sets for regions we are going to
> try
> to evacuate soon)
>
> - create remembered sets for old gen regions after finishing marking
> (starting at the Remark pause), iff
>
> - the liveness of these regions indicate so (liveness <=
> G1MixedGCLiveThresholdPercent)
> - any (non-objArray) humongous region that does not have a
> remembered
> set yet (eg. because of full gc)
>
> (Please see the new G1RemSetTrackingPolicy implementation for exact
> details)
>
> During the following "Rebuild Remembered Set" phase, that replaces
> the
> "Create Live Data" phase, all non-young regions that may contain
> outgoing pointers (i.e. excluding closed archive regions), G1 scans
> the
> live objects in the regions between bottom and TARS
> ("top_at_rebuild_start" - yes, that's new :) for inter-region
> references and add them to the appropriate remembered set.
>
> The TARS, as the name indicates, is the top-value at the start of
> remark, and the regions contain live data between this value and
> bottom
> that needs to be scanned during this rebuild phase.
>
> The reason for a new indicator is that nTAMS is *not* sufficient:
> during marking there might have been more allocations in the old gen
> that also need to be scanned for new references.
>
> All references above TARS (and below the region's top) will be
> handled
> by the existing barrier mechanism.
>
> After rebuild, during the Cleanup pause, we create the new
> (candidate)
> collection set, eventually filtering out more regions, like humongous
> ones that exceed the eager reclaim criteria.
>
> The current state of the remembered set for a given region is tracked
> within the remembered set for that region (HeapRegionRememberedSet
> class): a remembered set can be either Untracked, Updating or
> Complete.
> Untracked means that we do not manage a remembered set for this
> region,
> Complete means just that, and Updating means that we are currently in
> the process of updating the remembered set. This distinction is
> relevant for evacuation, e.g. we obviously must not evacuate not-
> Complete remembered sets.
>
> Note that this change contains one single temporary ugly hack that
> allows G1 to work until the next change :) - so in this change G1
> determines whether there will be a mixed gc phase during the Cleanup
> pause. It needs to determine this information at that time, instead
> of
> previously during concurrent cleanup, to, if there is no mixed gc
> coming, drop all remembered sets to not maintain them further.
>
> For this reason, and to avoid duplicate recalculation that may yield
> different results after dropping remembered sets, there is a new flag
> mixed_gc_pending in CollectorState, making it even more complicated.
> That one is going away in the next change, promised. :)
>
> Some imho useful messages about remembered set tracking are printed
> using "gc, remset, tracking" log tags, both in debug and trace level.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8180415
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8180415/webrev/index.html
> Testing:
> hs-tier 1-5, etc. etc.
>
> Thanks,
> Thomas
From thomas.schatzl at oracle.com Mon Mar 5 15:51:55 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 05 Mar 2018 16:51:55 +0100
Subject: RFR [M][7/7]: 8197932: Better split work in rebuild remembered
sets phase
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520265115.2532.126.camel@oracle.com>
Hi all,
(last one for now :)) (resend because I forgot to change the subject)
please have a look at this change that improves TTSP during the
rebuild remembered set phase.
So in the original change G1 yields only after processing a particular
region - in case of humongous objArrays at e.g. 32M region size with
lots of references this can take a bit.
This change modifies the rebuild remembered set closure to yield more
finely grained. Still a single thread processes a single region, there
is a different CR out there for improving that a bit.
The default "chunk size" of 256K of references has been measured to
take <1ms in the large majority of cases on my setup on some of these
densely occupied humongous objArrays, there are log messages for that,
and is configurable.
CR:
https://bugs.openjdk.java.net/browse/JDK-8197932
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
Testing:
see main thread
Thanks,
Thomas
From erik.helin at oracle.com Mon Mar 5 16:44:07 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Mon, 5 Mar 2018 17:44:07 +0100
Subject: RFR: 8199024: Remove unneccessary protected and virtual modifiers
from G1CollectedHeap
Message-ID:
Hi all,
this tiny patch cleans up the visibility for members in G1CollectedHeap
a bit. There is no need for protected members, I also removed two
unnecessary virtual modifiers.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8199024
Patch:
http://cr.openjdk.java.net/~ehelin/8199024/00/
Testing:
- make run-test-tier1 on Linux, macOS, Windows (x86-64) and
Solaris (SPARC and x86-64)
Thanks,
Erik
From thomas.stuefe at gmail.com Mon Mar 5 18:47:39 2018
From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=)
Date: Mon, 05 Mar 2018 18:47:39 +0000
Subject: RFR: 8199024: Remove unneccessary protected and virtual modifiers
from G1CollectedHeap
In-Reply-To:
References:
Message-ID:
Hi Erik,
Looks good :)
..Thomas
On Mon 5. Mar 2018 at 17:44, Erik Helin wrote:
> Hi all,
>
> this tiny patch cleans up the visibility for members in G1CollectedHeap
> a bit. There is no need for protected members, I also removed two
> unnecessary virtual modifiers.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8199024
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8199024/00/
>
> Testing:
> - make run-test-tier1 on Linux, macOS, Windows (x86-64) and
> Solaris (SPARC and x86-64)
>
> Thanks,
> Erik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From kim.barrett at oracle.com Mon Mar 5 23:27:23 2018
From: kim.barrett at oracle.com (Kim Barrett)
Date: Mon, 5 Mar 2018 18:27:23 -0500
Subject: RFR: 8199024: Remove unneccessary protected and virtual modifiers
from G1CollectedHeap
In-Reply-To:
References:
Message-ID: <56AB7ED0-2BDA-4814-9486-8386A65BD7A6@oracle.com>
> On Mar 5, 2018, at 11:44 AM, Erik Helin wrote:
>
> Hi all,
>
> this tiny patch cleans up the visibility for members in G1CollectedHeap a bit. There is no need for protected members, I also removed two unnecessary virtual modifiers.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8199024
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8199024/00/
>
> Testing:
> - make run-test-tier1 on Linux, macOS, Windows (x86-64) and
> Solaris (SPARC and x86-64)
>
> Thanks,
> Erik
Looks good.
The (pre-existing) placement of the declarations for pending_card_num() and _max_heap_capacity
at the end of the class seems odd. I don?t need a new webrev if you want to move them to some
more logical place in the class.
From thomas.schatzl at oracle.com Tue Mar 6 11:32:38 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 06 Mar 2018 12:32:38 +0100
Subject: RFR (XXS): 8198546: [Redo] JDK-8196883
G1RemSet::refine_card_concurrently doesn't need to check for cards in
collection set
Message-ID: <1520335958.2360.14.camel@oracle.com>
Hi all,
can I have reviews for this redo of an earlier change that has been
accidentally pushed to the jdk10 repo, backed out there, and everything
only recently been merged with jdk 11?
The change itself is unmodified.
CR:
https://bugs.openjdk.java.net/browse/JDK-8198546
Webrev:
http://cr.openjdk.java.net/~tschatzl/8198546/webrev/
Testing:
local compilation
Thanks,
Thomas
From rkennke at redhat.com Tue Mar 6 11:56:50 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 6 Mar 2018 12:56:50 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
Message-ID: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
Currently, the Access API is only used for oop-arraycopy, but not for
primitive arraycopy. GCs might want to intercept this too, e.g. resolve
src and dst arrays.
There *is* an implementation of primitive arraycopy in the Access API,
but it doesn't even compile, because Raw::arraycopy() does not take src
and dst oop operands, but it's called like that. The only reason why
this does not blow up (I think) is that because nobody calls it, the
compiler doesn't even get there.
This change fixes the Access API/impl and adds the relevant calls into
it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
handled here) or calls out to the ArrayKlass::copy_array(), which should
be covered with this change.
It should be possible to use the same Access API for Java-array <->
native-array bulk transfers, which currently use the rather ugly
typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
separate change though.
http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
Tests: tier1 ok
Please review!
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From erik.osterlund at oracle.com Tue Mar 6 12:10:05 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Tue, 6 Mar 2018 13:10:05 +0100
Subject: RFR (XXS): 8198546: [Redo] JDK-8196883
G1RemSet::refine_card_concurrently doesn't need to check for cards in
collection set
In-Reply-To: <1520335958.2360.14.camel@oracle.com>
References: <1520335958.2360.14.camel@oracle.com>
Message-ID: <5A9E851D.1010108@oracle.com>
Hi Thomas,
Looks good.
Thanks,
/Erik
On 2018-03-06 12:32, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this redo of an earlier change that has been
> accidentally pushed to the jdk10 repo, backed out there, and everything
> only recently been merged with jdk 11?
>
> The change itself is unmodified.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8198546
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8198546/webrev/
> Testing:
> local compilation
>
> Thanks,
> Thomas
From thomas.schatzl at oracle.com Tue Mar 6 12:25:50 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 06 Mar 2018 13:25:50 +0100
Subject: RFR (XXS): 8198546: [Redo] JDK-8196883
G1RemSet::refine_card_concurrently doesn't need to check for cards in
collection set
In-Reply-To: <5A9E851D.1010108@oracle.com>
References: <1520335958.2360.14.camel@oracle.com> <5A9E851D.1010108@oracle.com>
Message-ID: <1520339150.2378.1.camel@oracle.com>
Hi,
On Tue, 2018-03-06 at 13:10 +0100, Erik ?sterlund wrote:
> Hi Thomas,
>
> Looks good.
thanks. I will push this right away due to triviality, nothing
changed since last time, and already having been tested (accidentally)
quite thoroughly over time.
I will add the original reviewers too.
Thanks a lot,
Thomas
>
> Thanks,
> /Erik
>
> On 2018-03-06 12:32, Thomas Schatzl wrote:
> > Hi all,
> >
> > can I have reviews for this redo of an earlier change that has
> > been
> > accidentally pushed to the jdk10 repo, backed out there, and
> > everything
> > only recently been merged with jdk 11?
> >
> > The change itself is unmodified.
> >
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8198546
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8198546/webrev/
> > Testing:
> > local compilation
> >
> > Thanks,
> > Thomas
>
>
From stefan.johansson at oracle.com Tue Mar 6 12:31:31 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Tue, 6 Mar 2018 13:31:31 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <1520260902.2532.66.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
Message-ID:
Hi Thomas,
On 2018-03-05 15:41, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this change that calculates the liveness in
> regions (below nTAMS) during marking?
>
> This is required to be more clever about selecting the regions G1 is
> going to rebuild the remembered sets for (i.e. the well-known
> G1MixedGCLiveThresholdPercent threshold).
>
> This slows down the marking part of the concurrent phase a bit, but all
> alternatives were worse:
>
> - initially rebuild everything and then drop remembered sets for
> regions for too highly occupied regions at cleanup: wastes lots of
> space and memory maintaining these superfluous remembered sets.
>
> - choose regions using previous marking cycle data: this is generally
> not a good idea if your marking cycles are infrequent (which should be
> the normal case), as it tends to make too few regions available for
> evacuation (e.g. eager reclaim may already reclaim a lot). I.e. you
> need extra headroom, or be more aggressive with rebuilding.
>
> The main change, next to the calls that add the liveness to some
> internal data structure every time an object is marked, is some per-
> thread cache that (G1RegionMarkStatsCache). It helps decreasing the
> synchronization overhead the (atomic) increments in the global result
> cause.
>
> It is a very simple fixed size hashmap where increments to the same
> entries are collected, and on collision evicts the previous entry,
> doing the atomic operation on the global result.
>
> There is also some unfortunate moving of code that is required to flush
> these caches correctly during mark overflow handling.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8197850
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.html
Look good, just some minor things.
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
394?? _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
max_regions, mtGC))
max_regions is passed into the constructor but everywhere else in
G1ConcurrentMark we use g1h->max_regions(). I would consider either
calling g1h->max_regions() in the constructor too, or save the value in
a member and use it everywhere.
---
src/hotspot/share/gc/g1/g1_globals.hpp
?262?? experimental(size_t, G1RegionMarkStatsCacheSize, 1024,
?...
?265?????????? range(128, (max_juint / 2) + 1)
Do we need this flag or should we scale it against the number of
regions? If we want to keep it I think we should have a somewhat more
restrictive range.
---
src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when clearing. I
don't see a problem with it right now, but it feels a bit wrong since
index 0 is a valid region index. Maybe we could use another cleared marker.
---
Thanks,
Stefan
> Testing:
> hs-tier 1-5; the next change will add an assert that verifies that this
> concurrently calculated value is correct at the end of rebuild, i.e.
> the results will always verified.
>
> Thanks,
> Thomas
>
From per.liden at oracle.com Tue Mar 6 12:47:16 2018
From: per.liden at oracle.com (Per Liden)
Date: Tue, 6 Mar 2018 13:47:16 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
Message-ID: <41715172-d010-c5ef-c4b0-66f393601051@oracle.com>
Hi Roman,
On 03/06/2018 12:56 PM, Roman Kennke wrote:
> Currently, the Access API is only used for oop-arraycopy, but not for
> primitive arraycopy. GCs might want to intercept this too, e.g. resolve
> src and dst arrays.
>
> There *is* an implementation of primitive arraycopy in the Access API,
> but it doesn't even compile, because Raw::arraycopy() does not take src
> and dst oop operands, but it's called like that. The only reason why
> this does not blow up (I think) is that because nobody calls it, the
> compiler doesn't even get there.
>
> This change fixes the Access API/impl and adds the relevant calls into
> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
> handled here) or calls out to the ArrayKlass::copy_array(), which should
> be covered with this change.
>
> It should be possible to use the same Access API for Java-array <->
> native-array bulk transfers, which currently use the rather ugly
> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
> separate change though.
>
> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
src/hotspot/share/c1/c1_Runtime1.cpp
------------------------------------
- memmove(dst_addr, src_addr, length << l2es);
- return ac_ok;
+ return HeapAccess<>::arraycopy(arrayOop(src), arrayOop(dst),
src_addr, dst_addr, length << l2es) ? ac_ok : ac_failed;
I think we should always return ac_ok here, and change
Heap<>::arraycopy() to return void, since it will always return true for
primitive types.
src/hotspot/share/gc/shared/barrierSet.hpp
------------------------------------------
- return Raw::arraycopy(src_obj, dst_obj, src, dst, length);
+ return Raw::arraycopy(src, dst, length);
I'd suggest that we adjust the Raw::arraycopy() signature instead to
accept these arguments (even if they are later unused), to keep this
symmetric with oop_arraycopy() and avoid doing these types of
"decisions" in this layer.
src/hotspot/share/oops/accessBackend.cpp
----------------------------------------
+ void arraycopy_conjoint(char* src, char* dst, size_t length) {
+ Copy::conjoint_jbytes(src, dst, length);
+ }
This looks like an unnecessary addition. I suggest you adjust the code
in src/hotspot/share/c1/c1_Runtime1.cpp to use jbyte* instead char* in
the address calculations. I.e. these lines:
char* src_addr = (char*) ((oopDesc**)src + ihs) + (src_pos << l2es);
char* dst_addr = (char*) ((oopDesc**)dst + ihs) + (dst_pos << l2es);
cheers,
Per
>
> Tests: tier1 ok
>
> Please review!
> Thanks, Roman
>
From david.holmes at oracle.com Tue Mar 6 12:48:31 2018
From: david.holmes at oracle.com (David Holmes)
Date: Tue, 6 Mar 2018 22:48:31 +1000
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
Message-ID:
Hi Roman,
Not a review as I'm not familiar enough with the Access API, but in
src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed code
need updating - probably deleting. I assume the Access API arraycopy is
atomic?
Thanks,
David
On 6/03/2018 9:56 PM, Roman Kennke wrote:
> Currently, the Access API is only used for oop-arraycopy, but not for
> primitive arraycopy. GCs might want to intercept this too, e.g. resolve
> src and dst arrays.
>
> There *is* an implementation of primitive arraycopy in the Access API,
> but it doesn't even compile, because Raw::arraycopy() does not take src
> and dst oop operands, but it's called like that. The only reason why
> this does not blow up (I think) is that because nobody calls it, the
> compiler doesn't even get there.
>
> This change fixes the Access API/impl and adds the relevant calls into
> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
> handled here) or calls out to the ArrayKlass::copy_array(), which should
> be covered with this change.
>
> It should be possible to use the same Access API for Java-array <->
> native-array bulk transfers, which currently use the rather ugly
> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
> separate change though.
>
> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>
> Tests: tier1 ok
>
> Please review!
> Thanks, Roman
>
From per.liden at oracle.com Tue Mar 6 12:51:24 2018
From: per.liden at oracle.com (Per Liden)
Date: Tue, 6 Mar 2018 13:51:24 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To:
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
Message-ID: <7213ece8-4604-5410-aaab-1fcca23abd33@oracle.com>
On 03/06/2018 01:48 PM, David Holmes wrote:
> Hi Roman,
>
> Not a review as I'm not familiar enough with the Access API, but in
> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed code
> need updating - probably deleting. I assume the Access API arraycopy is
> atomic?
Agree. We should understand of that comment is correct, and if so use
the ARRAYCOPY_ATOMIC decorator, i.e.
HeapAccess::arraycopy().
/Per
>
> Thanks,
> David
>
> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>> Currently, the Access API is only used for oop-arraycopy, but not for
>> primitive arraycopy. GCs might want to intercept this too, e.g. resolve
>> src and dst arrays.
>>
>> There *is* an implementation of primitive arraycopy in the Access API,
>> but it doesn't even compile, because Raw::arraycopy() does not take src
>> and dst oop operands, but it's called like that. The only reason why
>> this does not blow up (I think) is that because nobody calls it, the
>> compiler doesn't even get there.
>>
>> This change fixes the Access API/impl and adds the relevant calls into
>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>> handled here) or calls out to the ArrayKlass::copy_array(), which should
>> be covered with this change.
>>
>> It should be possible to use the same Access API for Java-array <->
>> native-array bulk transfers, which currently use the rather ugly
>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>> separate change though.
>>
>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>
>> Tests: tier1 ok
>>
>> Please review!
>> Thanks, Roman
>>
From david.holmes at oracle.com Tue Mar 6 12:56:22 2018
From: david.holmes at oracle.com (David Holmes)
Date: Tue, 6 Mar 2018 22:56:22 +1000
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <5A9E8F76.1050809@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
Message-ID: <83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
> Hi David,
>
> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
> should probably be used here.
If that code implements a Java array copy then yes it is required to be
32-bit atomic. Do you need the decorator to get 32-bit atomicity?
David
> Thanks,
> /Erik
>
> On 2018-03-06 13:48, David Holmes wrote:
>> Hi Roman,
>>
>> Not a review as I'm not familiar enough with the Access API, but in
>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>> code need updating - probably deleting. I assume the Access API
>> arraycopy is atomic?
>>
>> Thanks,
>> David
>>
>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>> Currently, the Access API is only used for oop-arraycopy, but not for
>>> primitive arraycopy. GCs might want to intercept this too, e.g. resolve
>>> src and dst arrays.
>>>
>>> There *is* an implementation of primitive arraycopy in the Access API,
>>> but it doesn't even compile, because Raw::arraycopy() does not take src
>>> and dst oop operands, but it's called like that. The only reason why
>>> this does not blow up (I think) is that because nobody calls it, the
>>> compiler doesn't even get there.
>>>
>>> This change fixes the Access API/impl and adds the relevant calls into
>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>>> handled here) or calls out to the ArrayKlass::copy_array(), which should
>>> be covered with this change.
>>>
>>> It should be possible to use the same Access API for Java-array <->
>>> native-array bulk transfers, which currently use the rather ugly
>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>> separate change though.
>>>
>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>
>>> Tests: tier1 ok
>>>
>>> Please review!
>>> Thanks, Roman
>>>
>
From erik.osterlund at oracle.com Tue Mar 6 12:54:14 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Tue, 6 Mar 2018 13:54:14 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To:
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
Message-ID: <5A9E8F76.1050809@oracle.com>
Hi David,
It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
should probably be used here.
Thanks,
/Erik
On 2018-03-06 13:48, David Holmes wrote:
> Hi Roman,
>
> Not a review as I'm not familiar enough with the Access API, but in
> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
> code need updating - probably deleting. I assume the Access API
> arraycopy is atomic?
>
> Thanks,
> David
>
> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>> Currently, the Access API is only used for oop-arraycopy, but not for
>> primitive arraycopy. GCs might want to intercept this too, e.g. resolve
>> src and dst arrays.
>>
>> There *is* an implementation of primitive arraycopy in the Access API,
>> but it doesn't even compile, because Raw::arraycopy() does not take src
>> and dst oop operands, but it's called like that. The only reason why
>> this does not blow up (I think) is that because nobody calls it, the
>> compiler doesn't even get there.
>>
>> This change fixes the Access API/impl and adds the relevant calls into
>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>> handled here) or calls out to the ArrayKlass::copy_array(), which should
>> be covered with this change.
>>
>> It should be possible to use the same Access API for Java-array <->
>> native-array bulk transfers, which currently use the rather ugly
>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>> separate change though.
>>
>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>
>> Tests: tier1 ok
>>
>> Please review!
>> Thanks, Roman
>>
From thomas.schatzl at oracle.com Tue Mar 6 13:17:53 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 06 Mar 2018 14:17:53 +0100
Subject: RFR [1/7]: 8197569: Refactor eager reclaim for concurrent
remembered set rebuilding
In-Reply-To: <8d58ae9c-1c18-c317-a40c-66241faa9a81@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259499.2532.44.camel@oracle.com>
<8d58ae9c-1c18-c317-a40c-66241faa9a81@oracle.com>
Message-ID: <1520342273.2378.15.camel@oracle.com>
Hi Stefan,
thanks for looking into this.
On Mon, 2018-03-05 at 16:11 +0100, Stefan Johansson wrote:
> Thanks for splitting this change up Thomas,
>
> On 2018-03-05 15:18, Thomas Schatzl wrote:
> > Hi all,
> >
> > can I have some reviews for the following change that refactors
> > the
> > eager reclaim condition so that it can be later used for the policy
> > that determines for which regions G1 should rebuild the remembered
> > set?
> > (And it's a reasonable refactoring on its own btw).
> >
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8197569
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8197569/webrev/
>
> Look good, just one thing:
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp
> 2542 bool humongous_region_is_candidate(G1CollectedHeap* heap,
> HeapRegion* region) const {
> ...
> 2594 return obj->is_typeArray() &&
> 2595 G1CollectedHeap::heap()-
> >is_potential_eager_reclaim_candidate(region);
>
> You could use the passed in heap parameter instead of using
> G1CollectedHeap::heap().
Done. Also renamed the parameter to "g1h" as used everywhere else.
> Another, maybe even nicer, solution would be to
> move is_potential_eager_reclaim_candidate() to HeapRegion, and just
> call region->is_potential_eager_reclaim_candidate().
I did not do this for the following reasons:
- is_potential_eager_reclaim_candidate may depend on global state in
the future. E.g. when trying to eagerly reclaim objArrays or similar the result depends on whether we are currently marking or not.
I do not like making HeapRegion dependent on e.g. G1CollectorState :)
(any more than it already may be).
- (almost) all eager reclaim related code has until now been in
G1CollectedHeap. Such a change would go against this, and run kind of
contrary to my intent to move away from using HeapRegion as dumping
ground for anything loosely related to it out of convenience, but only
as a representation for that memory.
Either way is kind of fine for me right now, so let's see what others
say?
New webrevs:
http://cr.openjdk.java.net/~tschatzl/8197569/webrev.0_to_1/ (diff)
http://cr.openjdk.java.net/~tschatzl/8197569/webrev.1/ (full)
Thanks,
Thomas
From per.liden at oracle.com Tue Mar 6 13:18:21 2018
From: per.liden at oracle.com (Per Liden)
Date: Tue, 6 Mar 2018 14:18:21 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <41715172-d010-c5ef-c4b0-66f393601051@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<41715172-d010-c5ef-c4b0-66f393601051@oracle.com>
Message-ID: <1721af77-7378-0e24-fab0-bdaa7614e925@oracle.com>
On 03/06/2018 01:47 PM, Per Liden wrote:
> Hi Roman,
>
> On 03/06/2018 12:56 PM, Roman Kennke wrote:
>> Currently, the Access API is only used for oop-arraycopy, but not for
>> primitive arraycopy. GCs might want to intercept this too, e.g. resolve
>> src and dst arrays.
>>
>> There *is* an implementation of primitive arraycopy in the Access API,
>> but it doesn't even compile, because Raw::arraycopy() does not take src
>> and dst oop operands, but it's called like that. The only reason why
>> this does not blow up (I think) is that because nobody calls it, the
>> compiler doesn't even get there.
>>
>> This change fixes the Access API/impl and adds the relevant calls into
>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>> handled here) or calls out to the ArrayKlass::copy_array(), which should
>> be covered with this change.
>>
>> It should be possible to use the same Access API for Java-array <->
>> native-array bulk transfers, which currently use the rather ugly
>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>> separate change though.
>>
>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>
> src/hotspot/share/c1/c1_Runtime1.cpp
> ------------------------------------
>
> -??? memmove(dst_addr, src_addr, length << l2es);
> -??? return ac_ok;
> +??? return HeapAccess<>::arraycopy(arrayOop(src), arrayOop(dst),
> src_addr, dst_addr, length << l2es) ? ac_ok : ac_failed;
>
> I think we should always return ac_ok here, and change
> Heap<>::arraycopy() to return void, since it will always return true for
> primitive types.
>
>
> src/hotspot/share/gc/shared/barrierSet.hpp
> ------------------------------------------
> -????? return Raw::arraycopy(src_obj, dst_obj, src, dst, length);
> +????? return Raw::arraycopy(src, dst, length);
>
> I'd suggest that we adjust the Raw::arraycopy() signature instead to
> accept these arguments (even if they are later unused), to keep this
> symmetric with oop_arraycopy() and avoid doing these types of
> "decisions" in this layer.
>
>
> src/hotspot/share/oops/accessBackend.cpp
> ----------------------------------------
>
> +? void arraycopy_conjoint(char* src, char* dst, size_t length) {
> +??? Copy::conjoint_jbytes(src, dst, length);
> +? }
>
> This looks like an unnecessary addition. I suggest you adjust the code
> in src/hotspot/share/c1/c1_Runtime1.cpp to use jbyte* instead char* in
> the address calculations. I.e. these lines:
>
> ???? char* src_addr = (char*) ((oopDesc**)src + ihs) + (src_pos << l2es);
> ???? char* dst_addr = (char*) ((oopDesc**)dst + ihs) + (dst_pos << l2es);
>
I missed this one...
src/hotspot/share/oops/typeArrayKlass.cpp
-----------------------------------------
- Copy::conjoint_memory_atomic(src, dst, (size_t)length << l2es);
+ HeapAccess<>::arraycopy(s, d, src, dst, (size_t)length << l2es);
You're loosing the atomic part here, which should translate to an
ARRAYCOPY_ATOMIC decorator.
Erik will send out a proposal for how to deal with the atomic stuff when
we've erased the type information, like in C1's stub.
/Per
> cheers,
> Per
>
>>
>> Tests: tier1 ok
>>
>> Please review!
>> Thanks, Roman
>>
From thomas.schatzl at oracle.com Tue Mar 6 13:18:37 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 06 Mar 2018 14:18:37 +0100
Subject: RFR [S][2/7] 8197570: Make rules for choosing collection set
candidates more explicit
In-Reply-To: <172e3f7e-e326-274b-f20f-90167b6aaeb9@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259735.2532.48.camel@oracle.com>
<172e3f7e-e326-274b-f20f-90167b6aaeb9@oracle.com>
Message-ID: <1520342317.2378.16.camel@oracle.com>
Hi Stefan,
On Mon, 2018-03-05 at 16:19 +0100, Stefan Johansson wrote:
> Hi Thomas,
>
> On 2018-03-05 15:22, Thomas Schatzl wrote:
> > Hi all,
> >
> > can I have reviews for this change that makes the rule
> > (occupancy) for choosing collection set candidates more explicit,
> > i.e. factor it into a single method. This is needed for selecting
> > the regions we want to rebuild the remembered sets concurrently
> > (JDK-8180415) more straightforward.
> >
> > It also adds a method to allow iteration over the regions in the
> > collection set - I did not see that worth an extra webrev.
> >
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8197570
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8197570/webrev/
>
> Looks good,
thanks for your review.
Thomas
From erik.osterlund at oracle.com Tue Mar 6 13:21:28 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Tue, 6 Mar 2018 14:21:28 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
Message-ID: <5A9E95D8.6080602@oracle.com>
Hi David,
The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
of the passed in elements.
In this case, it looks like the address has been type erased to void*,
and hence lost what the element size was. There is currently no overload
accepted for type erased element - only accurate elements {jbyte,
jshort, jint, jlong}.
So it looks like an overload must be added to accept type erased void*
elements and make that call conjoint_memory_atomic when the
ARRAYCOPY_ATOMIC decorator is passed in.
Thanks,
/Erik
On 2018-03-06 13:56, David Holmes wrote:
> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>> Hi David,
>>
>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>> should probably be used here.
>
> If that code implements a Java array copy then yes it is required to
> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>
> David
>
>> Thanks,
>> /Erik
>>
>> On 2018-03-06 13:48, David Holmes wrote:
>>> Hi Roman,
>>>
>>> Not a review as I'm not familiar enough with the Access API, but in
>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>> code need updating - probably deleting. I assume the Access API
>>> arraycopy is atomic?
>>>
>>> Thanks,
>>> David
>>>
>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>> Currently, the Access API is only used for oop-arraycopy, but not for
>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>> resolve
>>>> src and dst arrays.
>>>>
>>>> There *is* an implementation of primitive arraycopy in the Access API,
>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>> src
>>>> and dst oop operands, but it's called like that. The only reason why
>>>> this does not blow up (I think) is that because nobody calls it, the
>>>> compiler doesn't even get there.
>>>>
>>>> This change fixes the Access API/impl and adds the relevant calls into
>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>> should
>>>> be covered with this change.
>>>>
>>>> It should be possible to use the same Access API for Java-array <->
>>>> native-array bulk transfers, which currently use the rather ugly
>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>> separate change though.
>>>>
>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>
>>>> Tests: tier1 ok
>>>>
>>>> Please review!
>>>> Thanks, Roman
>>>>
>>
From rkennke at redhat.com Tue Mar 6 13:35:02 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 6 Mar 2018 14:35:02 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <5A9E95D8.6080602@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
Message-ID: <2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when we can
just as well call typeArrayOop::copy_array() and have it do the right
thing? Or go even further and also do it for oop-arraycopy?
Roman
>
> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
> of the passed in elements.
> In this case, it looks like the address has been type erased to void*,
> and hence lost what the element size was. There is currently no overload
> accepted for type erased element - only accurate elements {jbyte,
> jshort, jint, jlong}.
>
> So it looks like an overload must be added to accept type erased void*
> elements and make that call conjoint_memory_atomic when the
> ARRAYCOPY_ATOMIC decorator is passed in.
>
> Thanks,
> /Erik
>
> On 2018-03-06 13:56, David Holmes wrote:
>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>> Hi David,
>>>
>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>>> should probably be used here.
>>
>> If that code implements a Java array copy then yes it is required to
>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>
>> David
>>
>>> Thanks,
>>> /Erik
>>>
>>> On 2018-03-06 13:48, David Holmes wrote:
>>>> Hi Roman,
>>>>
>>>> Not a review as I'm not familiar enough with the Access API, but in
>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>>> code need updating - probably deleting. I assume the Access API
>>>> arraycopy is atomic?
>>>>
>>>> Thanks,
>>>> David
>>>>
>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>> Currently, the Access API is only used for oop-arraycopy, but not for
>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>> resolve
>>>>> src and dst arrays.
>>>>>
>>>>> There *is* an implementation of primitive arraycopy in the Access API,
>>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>>> src
>>>>> and dst oop operands, but it's called like that. The only reason why
>>>>> this does not blow up (I think) is that because nobody calls it, the
>>>>> compiler doesn't even get there.
>>>>>
>>>>> This change fixes the Access API/impl and adds the relevant calls into
>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>> should
>>>>> be covered with this change.
>>>>>
>>>>> It should be possible to use the same Access API for Java-array <->
>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>>> separate change though.
>>>>>
>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>
>>>>> Tests: tier1 ok
>>>>>
>>>>> Please review!
>>>>> Thanks, Roman
>>>>>
>>>
>
From thomas.schatzl at oracle.com Tue Mar 6 13:33:54 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 06 Mar 2018 14:33:54 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To:
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
Message-ID: <1520343234.2378.29.camel@oracle.com>
On Tue, 2018-03-06 at 13:31 +0100, Stefan Johansson wrote:
> Hi Thomas,
>
> On 2018-03-05 15:41, Thomas Schatzl wrote:
> > Hi all,
> >
> > can I have reviews for this change that calculates the liveness
> > in regions (below nTAMS) during marking?
> >
> > This is required to be more clever about selecting the regions G1
> > is going to rebuild the remembered sets for (i.e. the well-known
> > G1MixedGCLiveThresholdPercent threshold).
> >
> > This slows down the marking part of the concurrent phase a bit, but
> > all alternatives were worse:
> >
> > - initially rebuild everything and then drop remembered sets for
> > regions for too highly occupied regions at cleanup: wastes lots of
> > space and memory maintaining these superfluous remembered sets.
> >
> > - choose regions using previous marking cycle data: this is
> > generally not a good idea if your marking cycles are infrequent
> > (which should be the normal case), as it tends to make too few
> > regions available for evacuation (e.g. eager reclaim may already
> > reclaim a lot). I.e. you need extra headroom, or be more aggressive
> > with rebuilding.
> >
> > The main change, next to the calls that add the liveness to some
> > internal data structure every time an object is marked, is some
> > per- thread cache that (G1RegionMarkStatsCache). It helps
> > decreasing the synchronization overhead the (atomic) increments in
> > the global result cause.
> >
> > It is a very simple fixed size hashmap where increments to the same
> > entries are collected, and on collision evicts the previous entry,
> > doing the atomic operation on the global result.
> >
> > There is also some unfortunate moving of code that is required to
> > flush these caches correctly during mark overflow handling.
> >
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8197850
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.html
>
> Look good, just some minor things.
>
> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
> 394 _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
> max_regions, mtGC))
>
> max_regions is passed into the constructor but everywhere else in
> G1ConcurrentMark we use g1h->max_regions(). I would consider either
> calling g1h->max_regions() in the constructor too, or save the value
> in a member and use it everywhere.
Done using option 1), use g1h->max_regions() everywhere.
> ---
>src/hotspot/share/gc/g1/g1_globals.hpp
> 262 experimental(size_t, G1RegionMarkStatsCacheSize, 1024,
> ...
> 265 range(128, (max_juint / 2) + 1)
>
> Do we need this flag or should we scale it against the number of
> regions? If we want to keep it I think we should have a somewhat
> more restrictive range.
I would not want this to scale according to the number of heap regions,
because that is going to have a significant impact on pause times when
all of the thread's caches are evicted (The O(#regions) part).
The flag has only been added (rather late, admittedly) to fix potential
issues with marking time with really large heaps with tens of thousands
of regions.
Let me do some more measurements, I will get back to you with them
before giving you a new webrev.
> ---
> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
>
> In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when clearing.
> I don't see a problem with it right now, but it feels a bit wrong
> since index 0 is a valid region index. Maybe we could use another
> cleared marker.
Unfortunately there is none (one could use something like -1, but that
one is valid too), and it seems a waste of memory to reserve more space
for it.
I see your point that this is a bit ugly, but there should never be any
issue because of the initialization of the value part of an entry with
zero. It simply has no impact on totals if you add zero.
The code could initialize the cache with region indices from 0 to cache
size - 1, which are valid values given the hash function, what do you
think?
However that would slow down clearing a little (the compiler will just
compile it to a memset() in the loop right now).
Thanks,
Thomas
From stefan.johansson at oracle.com Tue Mar 6 13:49:20 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Tue, 6 Mar 2018 14:49:20 +0100
Subject: RFR [1/7]: 8197569: Refactor eager reclaim for concurrent
remembered set rebuilding
In-Reply-To: <1520342273.2378.15.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259499.2532.44.camel@oracle.com>
<8d58ae9c-1c18-c317-a40c-66241faa9a81@oracle.com>
<1520342273.2378.15.camel@oracle.com>
Message-ID:
On 2018-03-06 14:17, Thomas Schatzl wrote:
> Hi Stefan,
>
> thanks for looking into this.
>
> On Mon, 2018-03-05 at 16:11 +0100, Stefan Johansson wrote:
>> Thanks for splitting this change up Thomas,
>>
>> On 2018-03-05 15:18, Thomas Schatzl wrote:
>>> Hi all,
>>>
>>> can I have some reviews for the following change that refactors
>>> the
>>> eager reclaim condition so that it can be later used for the policy
>>> that determines for which regions G1 should rebuild the remembered
>>> set?
>>> (And it's a reasonable refactoring on its own btw).
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8197569
>>> Webrev:
>>> http://cr.openjdk.java.net/~tschatzl/8197569/webrev/
>> Look good, just one thing:
>> src/hotspot/share/gc/g1/g1CollectedHeap.cpp
>> 2542 bool humongous_region_is_candidate(G1CollectedHeap* heap,
>> HeapRegion* region) const {
>> ...
>> 2594 return obj->is_typeArray() &&
>> 2595 G1CollectedHeap::heap()-
>>> is_potential_eager_reclaim_candidate(region);
>> You could use the passed in heap parameter instead of using
>> G1CollectedHeap::heap().
> Done. Also renamed the parameter to "g1h" as used everywhere else.
>
>> Another, maybe even nicer, solution would be to
>> move is_potential_eager_reclaim_candidate() to HeapRegion, and just
>> call region->is_potential_eager_reclaim_candidate().
> I did not do this for the following reasons:
>
> - is_potential_eager_reclaim_candidate may depend on global state in
> the future. E.g. when trying to eagerly reclaim objArrays or similar the result depends on whether we are currently marking or not.
>
> I do not like making HeapRegion dependent on e.g. G1CollectorState :)
> (any more than it already may be).
>
> - (almost) all eager reclaim related code has until now been in
> G1CollectedHeap. Such a change would go against this, and run kind of
> contrary to my intent to move away from using HeapRegion as dumping
> ground for anything loosely related to it out of convenience, but only
> as a representation for that memory.
>
> Either way is kind of fine for me right now, so let's see what others
> say?
I'm fine with this as well. Consider it reviewed :)
Stefan
> New webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197569/webrev.0_to_1/ (diff)
> http://cr.openjdk.java.net/~tschatzl/8197569/webrev.1/ (full)
>
> Thanks,
> Thomas
>
From stefan.johansson at oracle.com Tue Mar 6 14:03:11 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Tue, 6 Mar 2018 15:03:11 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <1520343234.2378.29.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
Message-ID: <8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
On 2018-03-06 14:33, Thomas Schatzl wrote:
> On Tue, 2018-03-06 at 13:31 +0100, Stefan Johansson wrote:
>> Hi Thomas,
>>
>> On 2018-03-05 15:41, Thomas Schatzl wrote:
>>> Hi all,
>>>
>>> ...
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8197850
>>> Webrev:
>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.html
>> Look good, just some minor things.
>>
>> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
>> 394 _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
>> max_regions, mtGC))
>>
>> max_regions is passed into the constructor but everywhere else in
>> G1ConcurrentMark we use g1h->max_regions(). I would consider either
>> calling g1h->max_regions() in the constructor too, or save the value
>> in a member and use it everywhere.
> Done using option 1), use g1h->max_regions() everywhere.
Thanks.
>> ---
>> src/hotspot/share/gc/g1/g1_globals.hpp
>> 262 experimental(size_t, G1RegionMarkStatsCacheSize, 1024,
>> ...
>> 265 range(128, (max_juint / 2) + 1)
>>
>> Do we need this flag or should we scale it against the number of
>> regions? If we want to keep it I think we should have a somewhat
>> more restrictive range.
> I would not want this to scale according to the number of heap regions,
> because that is going to have a significant impact on pause times when
> all of the thread's caches are evicted (The O(#regions) part).
True, just a thought since 1024 is roughly half the number regions we
aim for maybe this could be used together with a reasonable upper bound.
> The flag has only been added (rather late, admittedly) to fix potential
> issues with marking time with really large heaps with tens of thousands
> of regions.
> Let me do some more measurements, I will get back to you with them
> before giving you a new webrev.
Sound good.
>> ---
>> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
>>
>> In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when clearing.
>> I don't see a problem with it right now, but it feels a bit wrong
>> since index 0 is a valid region index. Maybe we could use another
>> cleared marker.
> Unfortunately there is none (one could use something like -1, but that
> one is valid too), and it seems a waste of memory to reserve more space
> for it.
>
> I see your point that this is a bit ugly, but there should never be any
> issue because of the initialization of the value part of an entry with
> zero. It simply has no impact on totals if you add zero.
>
> The code could initialize the cache with region indices from 0 to cache
> size - 1, which are valid values given the hash function, what do you
> think?
>
> However that would slow down clearing a little (the compiler will just
> compile it to a memset() in the loop right now).
You are correct that -1 is a valid index, but we seldom see heaps with
so many regions. I'm fine with leaving it as is, if you dislike using -1
and if it will slow down clearing.
Thanks,
Stefan
>
> Thanks,
> Thomas
>
From martin.doerr at sap.com Tue Mar 6 14:37:07 2018
From: martin.doerr at sap.com (Doerr, Martin)
Date: Tue, 6 Mar 2018 14:37:07 +0000
Subject: RFR(S): 8198510: Enable UseDynamicNumberOfGCThreads by default
Message-ID: <96da428b596e4a729612b32415d2ed11@sap.com>
Hi,
I'd like to solve the problem that an unnecessarily high number of GC threads get started in some situations. This wastes resources.
The proposal is to enable the existing flag UseDynamicNumberOfGCThreads by default.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8198510
CSR:
https://bugs.openjdk.java.net/browse/JDK-8198547
Webrev:
http://cr.openjdk.java.net/~mdoerr/8198510_gc_threads/webrev.01/
Please review.
Thanks and best regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From thomas.schatzl at oracle.com Tue Mar 6 15:01:04 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 06 Mar 2018 16:01:04 +0100
Subject: RFR(S): 8198510: Enable UseDynamicNumberOfGCThreads by default
In-Reply-To: <96da428b596e4a729612b32415d2ed11@sap.com>
References: <96da428b596e4a729612b32415d2ed11@sap.com>
Message-ID: <1520348464.2378.39.camel@oracle.com>
Hi,
On Tue, 2018-03-06 at 14:37 +0000, Doerr, Martin wrote:
> Hi,
>
> I?d like to solve the problem that an unnecessarily high number of GC
> threads get started in some situations. This wastes resources.
> The proposal is to enable the existing flag
> UseDynamicNumberOfGCThreads by default.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8198510
>
> CSR:
> https://bugs.openjdk.java.net/browse/JDK-8198547
>
> Webrev:
> http://cr.openjdk.java.net/~mdoerr/8198510_gc_threads/webrev.01/
>
> Please review.
>
looks good to me :)
Thomas
From rkennke at redhat.com Tue Mar 6 16:03:28 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 6 Mar 2018 17:03:28 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
Message-ID: <6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
Am 06.03.2018 um 14:35 schrieb Roman Kennke:
> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when we can
> just as well call typeArrayOop::copy_array() and have it do the right
> thing? Or go even further and also do it for oop-arraycopy?
Something like:
http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
This wouldn't compile because of bunch of missing
arraycopy_conjoint_atomic defintions for extra types like jfloat,
jdouble, jboolean, etc, which in turn would be missing the same
Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
specific stuff... and my question before I go there is: do we want all
that? Or can you think of a better way to solve it?
Roman
>
> Roman
>
>>
>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
>> of the passed in elements.
>> In this case, it looks like the address has been type erased to void*,
>> and hence lost what the element size was. There is currently no overload
>> accepted for type erased element - only accurate elements {jbyte,
>> jshort, jint, jlong}.
>>
>> So it looks like an overload must be added to accept type erased void*
>> elements and make that call conjoint_memory_atomic when the
>> ARRAYCOPY_ATOMIC decorator is passed in.
>>
>> Thanks,
>> /Erik
>>
>> On 2018-03-06 13:56, David Holmes wrote:
>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>> Hi David,
>>>>
>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>>>> should probably be used here.
>>>
>>> If that code implements a Java array copy then yes it is required to
>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>
>>> David
>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>> Hi Roman,
>>>>>
>>>>> Not a review as I'm not familiar enough with the Access API, but in
>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>>>> code need updating - probably deleting. I assume the Access API
>>>>> arraycopy is atomic?
>>>>>
>>>>> Thanks,
>>>>> David
>>>>>
>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>> Currently, the Access API is only used for oop-arraycopy, but not for
>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>> resolve
>>>>>> src and dst arrays.
>>>>>>
>>>>>> There *is* an implementation of primitive arraycopy in the Access API,
>>>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>>>> src
>>>>>> and dst oop operands, but it's called like that. The only reason why
>>>>>> this does not blow up (I think) is that because nobody calls it, the
>>>>>> compiler doesn't even get there.
>>>>>>
>>>>>> This change fixes the Access API/impl and adds the relevant calls into
>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>> should
>>>>>> be covered with this change.
>>>>>>
>>>>>> It should be possible to use the same Access API for Java-array <->
>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>>>> separate change though.
>>>>>>
>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>
>>>>>> Tests: tier1 ok
>>>>>>
>>>>>> Please review!
>>>>>> Thanks, Roman
>>>>>>
>>>>
>>
>
From erik.osterlund at oracle.com Tue Mar 6 16:10:22 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Tue, 6 Mar 2018 17:10:22 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
Message-ID: <5A9EBD6E.3070005@oracle.com>
Hi Roman,
My spontaneous idea was to have an overload for type erased void* that
when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
which AFAIK is conservatively atomic regardless of what the precise
element type is.
But if you have better ideas, I am open for suggestions.
Thanks,
/Erik
On 2018-03-06 17:03, Roman Kennke wrote:
> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when we can
>> just as well call typeArrayOop::copy_array() and have it do the right
>> thing? Or go even further and also do it for oop-arraycopy?
> Something like:
>
> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>
> This wouldn't compile because of bunch of missing
> arraycopy_conjoint_atomic defintions for extra types like jfloat,
> jdouble, jboolean, etc, which in turn would be missing the same
> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
> specific stuff... and my question before I go there is: do we want all
> that? Or can you think of a better way to solve it?
>
> Roman
>
>> Roman
>>
>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
>>> of the passed in elements.
>>> In this case, it looks like the address has been type erased to void*,
>>> and hence lost what the element size was. There is currently no overload
>>> accepted for type erased element - only accurate elements {jbyte,
>>> jshort, jint, jlong}.
>>>
>>> So it looks like an overload must be added to accept type erased void*
>>> elements and make that call conjoint_memory_atomic when the
>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>
>>> Thanks,
>>> /Erik
>>>
>>> On 2018-03-06 13:56, David Holmes wrote:
>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>> Hi David,
>>>>>
>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>>>>> should probably be used here.
>>>> If that code implements a Java array copy then yes it is required to
>>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>>
>>>> David
>>>>
>>>>> Thanks,
>>>>> /Erik
>>>>>
>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>> Hi Roman,
>>>>>>
>>>>>> Not a review as I'm not familiar enough with the Access API, but in
>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>> arraycopy is atomic?
>>>>>>
>>>>>> Thanks,
>>>>>> David
>>>>>>
>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>> Currently, the Access API is only used for oop-arraycopy, but not for
>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>> resolve
>>>>>>> src and dst arrays.
>>>>>>>
>>>>>>> There *is* an implementation of primitive arraycopy in the Access API,
>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>>>>> src
>>>>>>> and dst oop operands, but it's called like that. The only reason why
>>>>>>> this does not blow up (I think) is that because nobody calls it, the
>>>>>>> compiler doesn't even get there.
>>>>>>>
>>>>>>> This change fixes the Access API/impl and adds the relevant calls into
>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which cannot be
>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>>> should
>>>>>>> be covered with this change.
>>>>>>>
>>>>>>> It should be possible to use the same Access API for Java-array <->
>>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>>>>> separate change though.
>>>>>>>
>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>
>>>>>>> Tests: tier1 ok
>>>>>>>
>>>>>>> Please review!
>>>>>>> Thanks, Roman
>>>>>>>
From sangheon.kim at oracle.com Tue Mar 6 23:28:46 2018
From: sangheon.kim at oracle.com (sangheon.kim)
Date: Tue, 6 Mar 2018 15:28:46 -0800
Subject: RFR [1/7]: 8197569: Refactor eager reclaim for concurrent
remembered set rebuilding
In-Reply-To: <1520342273.2378.15.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259499.2532.44.camel@oracle.com>
<8d58ae9c-1c18-c317-a40c-66241faa9a81@oracle.com>
<1520342273.2378.15.camel@oracle.com>
Message-ID: <35988ffd-383e-307e-f297-8abaad1dd43b@oracle.com>
Hi Thomas,
Thank you for these bunch of patches for rebuilding RemSet concurrently.
This is really nice.
On 03/06/2018 05:17 AM, Thomas Schatzl wrote:
> Hi Stefan,
>
> thanks for looking into this.
>
> On Mon, 2018-03-05 at 16:11 +0100, Stefan Johansson wrote:
>> Thanks for splitting this change up Thomas,
>>
>> On 2018-03-05 15:18, Thomas Schatzl wrote:
>>> Hi all,
>>>
>>> can I have some reviews for the following change that refactors
>>> the
>>> eager reclaim condition so that it can be later used for the policy
>>> that determines for which regions G1 should rebuild the remembered
>>> set?
>>> (And it's a reasonable refactoring on its own btw).
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8197569
>>> Webrev:
>>> http://cr.openjdk.java.net/~tschatzl/8197569/webrev/
>> Look good, just one thing:
>> src/hotspot/share/gc/g1/g1CollectedHeap.cpp
>> 2542 bool humongous_region_is_candidate(G1CollectedHeap* heap,
>> HeapRegion* region) const {
>> ...
>> 2594 return obj->is_typeArray() &&
>> 2595 G1CollectedHeap::heap()-
>>> is_potential_eager_reclaim_candidate(region);
>> You could use the passed in heap parameter instead of using
>> G1CollectedHeap::heap().
> Done. Also renamed the parameter to "g1h" as used everywhere else.
Good but still there are some places using 'g1'. It would be good idea
to fix, of course in other CR.
>
>> Another, maybe even nicer, solution would be to
>> move is_potential_eager_reclaim_candidate() to HeapRegion, and just
>> call region->is_potential_eager_reclaim_candidate().
> I did not do this for the following reasons:
>
> - is_potential_eager_reclaim_candidate may depend on global state in
> the future. E.g. when trying to eagerly reclaim objArrays or similar the result depends on whether we are currently marking or not.
>
> I do not like making HeapRegion dependent on e.g. G1CollectorState :)
> (any more than it already may be).
>
> - (almost) all eager reclaim related code has until now been in
> G1CollectedHeap. Such a change would go against this, and run kind of
> contrary to my intent to move away from using HeapRegion as dumping
> ground for anything loosely related to it out of convenience, but only
> as a representation for that memory.
>
> Either way is kind of fine for me right now, so let's see what others
> say?
Sounds reasonable to me.
>
> New webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197569/webrev.0_to_1/ (diff)
> http://cr.openjdk.java.net/~tschatzl/8197569/webrev.1/ (full)
webrev.1 seems good to me.
Thanks,
Sangheon
>
> Thanks,
> Thomas
>
From sangheon.kim at oracle.com Wed Mar 7 00:02:05 2018
From: sangheon.kim at oracle.com (sangheon.kim)
Date: Tue, 6 Mar 2018 16:02:05 -0800
Subject: RFR [S][2/7] 8197570: Make rules for choosing collection set
candidates more explicit
In-Reply-To: <1520259735.2532.48.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520259735.2532.48.camel@oracle.com>
Message-ID:
Hi Thomas,
On 03/05/2018 06:22 AM, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this change that makes the rule (occupancy)
> for choosing collection set candidates more explicit, i.e. factor it
> into a single method. This is needed for selecting the regions we want
> to rebuild the remembered sets concurrently (JDK-8180415) more
> straightforward.
>
> It also adds a method to allow iteration over the regions in the
> collection set - I did not see that worth an extra webrev.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8197570
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197570/webrev/
Looks good.
One minor nit:
You can add 'const' qualifier to the newly added method,
CollectionSetChooser::should_add(HeapRegion* hr).
I don't need a new webrev for this.
Thanks,
Sangheon
> Testing:
> hs-tier 1-5, mostly in conjunction with related changes
>
> Thanks,
> Thomas
>
From stefan.johansson at oracle.com Wed Mar 7 08:25:35 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Wed, 7 Mar 2018 09:25:35 +0100
Subject: RFR: 8197852: Move G1DefaultPolicy into G1Policy
In-Reply-To:
References:
Message-ID: <045edcd2-884a-a0a6-a3b6-49d2a7810de7@oracle.com>
Looks good,
StefanJ
On 2018-03-05 16:02, Erik Helin wrote:
> Hi all,
>
> this fairly small patch re-unites G1Policy and G1DefaultPolicy, there
> is no need for having both classes. With this patch we only have
> G1Policy (and of course G1CollectorPolicy as the little
> CollectorPolicy shim).
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197852
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197852/00/
>
> Testing:
> - make run-test-tier1 on Linux, Windows, Mac, Solaris (SPARC and x86-64)
>
> Thanks,
> Erik
From thomas.schatzl at oracle.com Wed Mar 7 08:48:41 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 07 Mar 2018 09:48:41 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
<8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
Message-ID: <1520412521.2346.4.camel@oracle.com>
Hi,
On Tue, 2018-03-06 at 15:03 +0100, Stefan Johansson wrote:
>
> On 2018-03-06 14:33, Thomas Schatzl wrote:
> > On Tue, 2018-03-06 at 13:31 +0100, Stefan Johansson wrote:
> > > Hi Thomas,
> > >
> > > On 2018-03-05 15:41, Thomas Schatzl wrote:
> > > > Hi all,
> > > >
> > > > ...
> > > >
> > > > CR:
> > > > https://bugs.openjdk.java.net/browse/JDK-8197850
> > > > Webrev:
> > > > http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.html
> > >
> > > Look good, just some minor things.
> > >
> > > src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
> > > 394 _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
> > > max_regions, mtGC))
> > >
> > > max_regions is passed into the constructor but everywhere else in
> > > G1ConcurrentMark we use g1h->max_regions(). I would consider
> > > either
> > > calling g1h->max_regions() in the constructor too, or save the
> > > value
> > > in a member and use it everywhere.
> >
> > Done using option 1), use g1h->max_regions() everywhere.
>
> Thanks.
> > > ---
> > > src/hotspot/share/gc/g1/g1_globals.hpp
> > > 262 experimental(size_t, G1RegionMarkStatsCacheSize, 1024,
> > > ...
> > > 265 range(128, (max_juint / 2) + 1)
> > >
> > > Do we need this flag or should we scale it against the number of
> > > regions? If we want to keep it I think we should have a somewhat
> > > more restrictive range.
> >
> > I would not want this to scale according to the number of heap
> > regions,
> > because that is going to have a significant impact on pause times
> > when
> > all of the thread's caches are evicted (The O(#regions) part).
>
> True, just a thought since 1024 is roughly half the number regions
> we aim for maybe this could be used together with a reasonable upper
> bound.
>
> > The flag has only been added (rather late, admittedly) to fix
> > potential issues with marking time with really large heaps with
> > tens of thousands of regions.
> > Let me do some more measurements, I will get back to you with them
> > before giving you a new webrev.
>
> Sound good.
I did some measurements with 100k regions, and I think we can just
remove the flag. There is always logging available (gc+mark+stats) that
shows cache hit ratio to diagnose issues.
> > > ---
> > > src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
> > >
> > > In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when
> > > clearing. I don't see a problem with it right now, but it feels a
> > > bit wrong since index 0 is a valid region index. Maybe we could
> > > use another cleared marker.
> >
> > Unfortunately there is none (one could use something like -1, but
> > that one is valid too), and it seems a waste of memory to reserve
> > more space for it.
> >
> > I see your point that this is a bit ugly, but there should never be
> > any issue because of the initialization of the value part of an
> > entry with zero. It simply has no impact on totals if you add zero.
> >
> > The code could initialize the cache with region indices from 0 to
> > cache size - 1, which are valid values given the hash function,
> > what do you think?
> >
> > However that would slow down clearing a little (the compiler will
> > just compile it to a memset() in the loop right now).
>
> You are correct that -1 is a valid index, but we seldom see heaps
> with so many regions. I'm fine with leaving it as is, if you dislike
> using -1 and if it will slow down clearing.
Just a bit. It seems as bad to use -1 or another random value, so I
kept it.
Webrevs:
http://cr.openjdk.java.net/~tschatzl/8197850/webrev.0_to_1/index.html
(diff)
http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1/index.html (full)
Testing:
This change ran, with some changes to 8180415 due to internal comments
(I will post in a few minutes) through hs-tier 1-5 over night.
Thanks,
Thomas
From thomas.schatzl at oracle.com Wed Mar 7 08:59:36 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 07 Mar 2018 09:59:36 +0100
Subject: RFR [L][4/7]: 8180415: Rebuild remembered sets during the
concurrent cycle
In-Reply-To: <1520262478.2532.91.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262478.2532.91.camel@oracle.com>
Message-ID: <1520413176.2346.9.camel@oracle.com>
Hi all,
Stefan had some comments about the HeapRegionType parameter in the
G1RemSetTrackingPolicy::update_at_allocate() method - that one is not
really required when placing the call to this method correctly and just
using the HeapRegion's type directly.
Changing this removes another 40 LOC of changes.
There has been another bug introduced by me during cleaning up for
final review: G1RemSetTrackingPolicy::update_at_free() is empty in this
change, which is wrong for this change - in this change we still do not
free the remembered sets during the cleanup pause, only in the
Concurrent Cleanup phase. When doing this concurrently, an assert
triggers when setting the remembered set state to empty outside a
safepoint.
The fix is to make the remembered set untracked during the Cleanup
phase still.
New webrevs:
http://cr.openjdk.java.net/~tschatzl/8180415/webrev.0_to_1 (diff)
http://cr.openjdk.java.net/~tschatzl/8180415/webrev.1 (full)
Thanks,
Thomas
On Mon, 2018-03-05 at 16:07 +0100, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this change that implements the bulk of the
> "rebuild remembered sets concurrently" mechanism?
>
> This change modifies the management of remembered sets so that those
> are only maintained when they are useful. This roughly means:
> - always maintain remembered sets for young gen regions
> - (almost) always maintain remembered sets for humongous regions (for
> eager reclaim) as long as they meet the eager reclaim criteria.
> - never create remembered sets for archive regions
> - do not create remembered sets for any regions during full gc
> - do not create remembered sets for regions with evacuation failure
>
> (The latter two decisions may not be optimal, but the idea was to
> strictly only maintain remembered sets for regions we are going to
> try
> to evacuate soon)
>
> - create remembered sets for old gen regions after finishing marking
> (starting at the Remark pause), iff
>
> - the liveness of these regions indicate so (liveness <=
> G1MixedGCLiveThresholdPercent)
> - any (non-objArray) humongous region that does not have a
> remembered
> set yet (eg. because of full gc)
>
> (Please see the new G1RemSetTrackingPolicy implementation for exact
> details)
>
> During the following "Rebuild Remembered Set" phase, that replaces
> the
> "Create Live Data" phase, all non-young regions that may contain
> outgoing pointers (i.e. excluding closed archive regions), G1 scans
> the
> live objects in the regions between bottom and TARS
> ("top_at_rebuild_start" - yes, that's new :) for inter-region
> references and add them to the appropriate remembered set.
>
> The TARS, as the name indicates, is the top-value at the start of
> remark, and the regions contain live data between this value and
> bottom
> that needs to be scanned during this rebuild phase.
>
> The reason for a new indicator is that nTAMS is *not* sufficient:
> during marking there might have been more allocations in the old gen
> that also need to be scanned for new references.
>
> All references above TARS (and below the region's top) will be
> handled
> by the existing barrier mechanism.
>
> After rebuild, during the Cleanup pause, we create the new
> (candidate)
> collection set, eventually filtering out more regions, like humongous
> ones that exceed the eager reclaim criteria.
>
> The current state of the remembered set for a given region is tracked
> within the remembered set for that region (HeapRegionRememberedSet
> class): a remembered set can be either Untracked, Updating or
> Complete.
> Untracked means that we do not manage a remembered set for this
> region,
> Complete means just that, and Updating means that we are currently in
> the process of updating the remembered set. This distinction is
> relevant for evacuation, e.g. we obviously must not evacuate not-
> Complete remembered sets.
>
> Note that this change contains one single temporary ugly hack that
> allows G1 to work until the next change :) - so in this change G1
> determines whether there will be a mixed gc phase during the Cleanup
> pause. It needs to determine this information at that time, instead
> of
> previously during concurrent cleanup, to, if there is no mixed gc
> coming, drop all remembered sets to not maintain them further.
>
> For this reason, and to avoid duplicate recalculation that may yield
> different results after dropping remembered sets, there is a new flag
> mixed_gc_pending in CollectorState, making it even more complicated.
> That one is going away in the next change, promised. :)
>
> Some imho useful messages about remembered set tracking are printed
> using "gc, remset, tracking" log tags, both in debug and trace level.
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8180415
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8180415/webrev/index.html
> Testing:
> hs-tier 1-5, etc. etc.
>
> Thanks,
> Thomas
From stefan.johansson at oracle.com Wed Mar 7 09:29:07 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Wed, 7 Mar 2018 10:29:07 +0100
Subject: RFR(S): 8198510: Enable UseDynamicNumberOfGCThreads by default
In-Reply-To: <96da428b596e4a729612b32415d2ed11@sap.com>
References: <96da428b596e4a729612b32415d2ed11@sap.com>
Message-ID: <23a06a29-d8c1-3f85-06be-93a8ca5380a7@oracle.com>
Hi Martin,
On 2018-03-06 15:37, Doerr, Martin wrote:
>
> Hi,
>
> I?d like to solve the problem that an unnecessarily high number of GC
> threads get started in some situations. This wastes resources.
>
> The proposal is to enable the existing flag
> UseDynamicNumberOfGCThreads by default.
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-8198510
>
> CSR:
>
> https://bugs.openjdk.java.net/browse/JDK-8198547
>
> Webrev:
>
> http://cr.openjdk.java.net/~mdoerr/8198510_gc_threads/webrev.01/
>
>
Change looks good and I also reviewed the CSR. So feel free to move it
to proposed (or finalized if you want to fast-track it).
Thanks,
Stefan
> Please review.
>
> Thanks and best regards,
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From thomas.schatzl at oracle.com Wed Mar 7 10:00:09 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 07 Mar 2018 11:00:09 +0100
Subject: RFR [S][2/7] 8197570: Make rules for choosing collection set
candidates more explicit
In-Reply-To:
References: <1520258985.2532.40.camel@oracle.com>
<1520259735.2532.48.camel@oracle.com>
Message-ID: <1520416809.2346.16.camel@oracle.com>
Hi,
thanks for your review.
I created webrevs anyway:
http://cr.openjdk.java.net/~tschatzl/8197570/webrev.0_to_1/ (diff)
http://cr.openjdk.java.net/~tschatzl/8197570/webrev.1/ (full)
Thanks,
Thomas
On Tue, 2018-03-06 at 16:02 -0800, sangheon.kim wrote:
> Hi Thomas,
>
> On 03/05/2018 06:22 AM, Thomas Schatzl wrote:
> > Hi all,
> >
> > can I have reviews for this change that makes the rule
> > (occupancy)
> > for choosing collection set candidates more explicit, i.e. factor
> > it
> > into a single method. This is needed for selecting the regions we
> > want
> > to rebuild the remembered sets concurrently (JDK-8180415) more
> > straightforward.
> >
> > It also adds a method to allow iteration over the regions in the
> > collection set - I did not see that worth an extra webrev.
> >
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8197570
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8197570/webrev/
>
> Looks good.
>
> One minor nit:
> You can add 'const' qualifier to the newly added method,
> CollectionSetChooser::should_add(HeapRegion* hr).
>
> I don't need a new webrev for this.
>
> Thanks,
> Sangheon
>
>
> > Testing:
> > hs-tier 1-5, mostly in conjunction with related changes
> >
> > Thanks,
> > Thomas
> >
>
>
From thomas.schatzl at oracle.com Wed Mar 7 10:04:14 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 07 Mar 2018 11:04:14 +0100
Subject: RFR: 8197852: Move G1DefaultPolicy into G1Policy
In-Reply-To:
References:
Message-ID: <1520417054.2346.19.camel@oracle.com>
Hi,
On Mon, 2018-03-05 at 16:02 +0100, Erik Helin wrote:
> Hi all,
>
> this fairly small patch re-unites G1Policy and G1DefaultPolicy, there
> is no need for having both classes. With this patch we only have
> G1Policy (and of course G1CollectorPolicy as the little
> CollectorPolicy shim).
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8197852
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8197852/00/
>
> Testing:
> - make run-test-tier1 on Linux, Windows, Mac, Solaris (SPARC and x86-
> 64)
in g1Policy.hpp, if you update the copyright notice, please use the
correct year (2018) :)
Is there a way to move g1DefaultPolicy.hpp into g1Policy.hpp while
retaining history? I.e. delete the latter first, and then rename?
I do not need to re-review this change.
Thanks,
Thomas
From stefan.johansson at oracle.com Wed Mar 7 10:12:10 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Wed, 7 Mar 2018 11:12:10 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <1520412521.2346.4.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
<8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
<1520412521.2346.4.camel@oracle.com>
Message-ID: <0cd6cca6-cace-4e4f-7f9c-152e20757dfe@oracle.com>
Thanks Thomas,
This looks good to me, reviewed.
Stefan
On 2018-03-07 09:48, Thomas Schatzl wrote:
> Hi,
>
> On Tue, 2018-03-06 at 15:03 +0100, Stefan Johansson wrote:
>> On 2018-03-06 14:33, Thomas Schatzl wrote:
>>> On Tue, 2018-03-06 at 13:31 +0100, Stefan Johansson wrote:
>>>> Hi Thomas,
>>>>
>>>> On 2018-03-05 15:41, Thomas Schatzl wrote:
>>>>> Hi all,
>>>>>
>>>>> ...
>>>>>
>>>>> CR:
>>>>> https://bugs.openjdk.java.net/browse/JDK-8197850
>>>>> Webrev:
>>>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.html
>>>> Look good, just some minor things.
>>>>
>>>> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
>>>> 394 _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
>>>> max_regions, mtGC))
>>>>
>>>> max_regions is passed into the constructor but everywhere else in
>>>> G1ConcurrentMark we use g1h->max_regions(). I would consider
>>>> either
>>>> calling g1h->max_regions() in the constructor too, or save the
>>>> value
>>>> in a member and use it everywhere.
>>> Done using option 1), use g1h->max_regions() everywhere.
>> Thanks.
>>>> ---
>>>> src/hotspot/share/gc/g1/g1_globals.hpp
>>>> 262 experimental(size_t, G1RegionMarkStatsCacheSize, 1024,
>>>> ...
>>>> 265 range(128, (max_juint / 2) + 1)
>>>>
>>>> Do we need this flag or should we scale it against the number of
>>>> regions? If we want to keep it I think we should have a somewhat
>>>> more restrictive range.
>>> I would not want this to scale according to the number of heap
>>> regions,
>>> because that is going to have a significant impact on pause times
>>> when
>>> all of the thread's caches are evicted (The O(#regions) part).
>> True, just a thought since 1024 is roughly half the number regions
>> we aim for maybe this could be used together with a reasonable upper
>> bound.
>>
>>> The flag has only been added (rather late, admittedly) to fix
>>> potential issues with marking time with really large heaps with
>>> tens of thousands of regions.
>>> Let me do some more measurements, I will get back to you with them
>>> before giving you a new webrev.
>> Sound good.
> I did some measurements with 100k regions, and I think we can just
> remove the flag. There is always logging available (gc+mark+stats) that
> shows cache hit ratio to diagnose issues.
>
>>>> ---
>>>> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
>>>>
>>>> In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when
>>>> clearing. I don't see a problem with it right now, but it feels a
>>>> bit wrong since index 0 is a valid region index. Maybe we could
>>>> use another cleared marker.
>>> Unfortunately there is none (one could use something like -1, but
>>> that one is valid too), and it seems a waste of memory to reserve
>>> more space for it.
>>>
>>> I see your point that this is a bit ugly, but there should never be
>>> any issue because of the initialization of the value part of an
>>> entry with zero. It simply has no impact on totals if you add zero.
>>>
>>> The code could initialize the cache with region indices from 0 to
>>> cache size - 1, which are valid values given the hash function,
>>> what do you think?
>>>
>>> However that would slow down clearing a little (the compiler will
>>> just compile it to a memset() in the loop right now).
>> You are correct that -1 is a valid index, but we seldom see heaps
>> with so many regions. I'm fine with leaving it as is, if you dislike
>> using -1 and if it will slow down clearing.
> Just a bit. It seems as bad to use -1 or another random value, so I
> kept it.
>
> Webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.0_to_1/index.html
> (diff)
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1/index.html (full)
>
> Testing:
> This change ran, with some changes to 8180415 due to internal comments
> (I will post in a few minutes) through hs-tier 1-5 over night.
>
> Thanks,
> Thomas
From erik.helin at oracle.com Wed Mar 7 10:39:44 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Wed, 7 Mar 2018 11:39:44 +0100
Subject: RFR: 8197852: Move G1DefaultPolicy into G1Policy
In-Reply-To: <1520417054.2346.19.camel@oracle.com>
References:
<1520417054.2346.19.camel@oracle.com>
Message-ID: <5587e8c6-2a1c-4c23-dd2b-896cb2876e25@oracle.com>
On 03/07/2018 11:04 AM, Thomas Schatzl wrote:
> Hi,
>
> On Mon, 2018-03-05 at 16:02 +0100, Erik Helin wrote:
>> Hi all,
>>
>> this fairly small patch re-unites G1Policy and G1DefaultPolicy, there
>> is no need for having both classes. With this patch we only have
>> G1Policy (and of course G1CollectorPolicy as the little
>> CollectorPolicy shim).
>>
>> Issue:
>> https://bugs.openjdk.java.net/browse/JDK-8197852
>>
>> Patch:
>> http://cr.openjdk.java.net/~ehelin/8197852/00/
>>
>> Testing:
>> - make run-test-tier1 on Linux, Windows, Mac, Solaris (SPARC and x86-
>> 64)
>
> in g1Policy.hpp, if you update the copyright notice, please use the
> correct year (2018) :)
Oops, my bad, I will fix before I push :)
> Is there a way to move g1DefaultPolicy.hpp into g1Policy.hpp while
> retaining history? I.e. delete the latter first, and then rename?
Yep, the commit does that, it is just not reflected in the webrev. The
"trick" is to `hg mv g1DefaultPolicy.hpp g1Policy.hpp` and then make the
changes, that keeps the history.
Thanks,
Erik
> I do not need to re-review this change.
>
> Thanks,
> Thomas
>
From thomas.schatzl at oracle.com Wed Mar 7 11:47:34 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 07 Mar 2018 12:47:34 +0100
Subject: RFR: 8197852: Move G1DefaultPolicy into G1Policy
In-Reply-To: <5587e8c6-2a1c-4c23-dd2b-896cb2876e25@oracle.com>
References:
<1520417054.2346.19.camel@oracle.com>
<5587e8c6-2a1c-4c23-dd2b-896cb2876e25@oracle.com>
Message-ID: <1520423254.2346.34.camel@oracle.com>
Hi,
On Wed, 2018-03-07 at 11:39 +0100, Erik Helin wrote:
> On 03/07/2018 11:04 AM, Thomas Schatzl wrote:
> > Hi,
> >
> > On Mon, 2018-03-05 at 16:02 +0100, Erik Helin wrote:
> > > Hi all,
> > >
> > > this fairly small patch re-unites G1Policy and G1DefaultPolicy,
> > > there
> > > is no need for having both classes. With this patch we only have
> > > G1Policy (and of course G1CollectorPolicy as the little
> > > CollectorPolicy shim).
> > >
> > > Issue:
> > > https://bugs.openjdk.java.net/browse/JDK-8197852
> > >
> > > Patch:
> > > http://cr.openjdk.java.net/~ehelin/8197852/00/
> > >
> > > Testing:
> > > - make run-test-tier1 on Linux, Windows, Mac, Solaris (SPARC and
> > > x86-
> > > 64)
> >
> > in g1Policy.hpp, if you update the copyright notice, please use
> > the correct year (2018) :)
>
> Oops, my bad, I will fix before I push :)
>
> > Is there a way to move g1DefaultPolicy.hpp into g1Policy.hpp while
> > retaining history? I.e. delete the latter first, and then rename?
>
> Yep, the commit does that, it is just not reflected in the webrev.
> The "trick" is to `hg mv g1DefaultPolicy.hpp g1Policy.hpp` and then
> make the changes, that keeps the history.
okay, thanks for the notice!
Thomas
From yasuenag at gmail.com Wed Mar 7 12:18:41 2018
From: yasuenag at gmail.com (Yasumasa Suenaga)
Date: Wed, 7 Mar 2018 21:18:41 +0900
Subject: PING: RFR: JDK-8153333: [REDO] STW phases at Concurrent GC should
count in PerfCounter
In-Reply-To: <9183dfd3-522f-fd73-a681-5ea957f1d717@gmail.com>
References:
<2f4e0901-1602-6276-e7fd-84e168e7b317@gmail.com>
<3210723e-c5f9-4277-a97a-be61e10e6b3d@oracle.com>
<89a1a161-874d-4743-e52b-7ab202fd8976@gmail.com>
<9799a2ad-6727-cae9-312b-fd9de13c8203@oracle.com>
<9183dfd3-522f-fd73-a681-5ea957f1d717@gmail.com>
Message-ID:
PING: Could you review it?
http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.08/
JBS: https://bugs.openjdk.java.net/browse/JDK-8153333
CSR: https://bugs.openjdk.java.net/browse/JDK-8196862
This change has passed Mach5 on submit repo.
Also it has passed hotspot/jtreg/:hotspot_serviceability and jdk/:jdk_tools jtreg tests.
We need one more reviewer.
Thanks,
Yasumasa
On 2018/02/21 21:14, Yasumasa Suenaga wrote:
> PING: Could you review it?
>
>> ?? http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.07/
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8153333
> CSR: https://bugs.openjdk.java.net/browse/JDK-8196862
>
>
> Yasumasa
>
>
> On 2018/02/15 10:23, Yasumasa Suenaga wrote:
>> Hi all,
>>
>> CSR for this issue [1] has been approved.
>> This webrev has been reviewed by Stefan, but we need one more
>> reviewer. Could you review it?
>>
>> ?? http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.07/
>>
>>
>> Thanks,
>>
>> Yasumasa
>>
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8196862
>>
>>
>>
>> 2018-02-06 22:33 GMT+09:00 Yasumasa Suenaga :
>>> Hi Stefan,
>>>
>>>> This looks good to me, will do some more testing while waiting for a
>>>> second reviewer and I can sponsor the change once it's ready to go.
>>>
>>>
>>> Thanks! I'm waiting for second reviewer.
>>>
>>>>> What should I do to get CSR approve?
>>>>
>>>> In the bug system under "More" you can choose "Create CSR" which is the
>>>> first step. More information can be found on the wiki:
>>>> https://wiki.openjdk.java.net/display/csr/CSR+FAQs
>>>
>>>
>>> I filed new CSR:
>>> ?? https://bugs.openjdk.java.net/browse/JDK-8196862
>>>
>>>
>>> Yasumasa
>>>
>>>
>>>
>>> On 2018/02/06 21:55, Stefan Johansson wrote:
>>>>
>>>>
>>>>
>>>> On 2018-02-06 06:10, Yasumasa Suenaga wrote:
>>>>>
>>>>> Hi Stefan,
>>>>>
>>>>>> I agree, for G1 this should not be controlled. Maybe I was a bit
>>>>>> unclear, I
>>>>>> was wondering why we want to control it for CMS.
>>>>>
>>>>> I said to remove -XX:EnableConcGCPerfCounter in two years ago. I've
>>>>> missed it :-)
>>>>>
>>>>>
>>>>> http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2016-March/017125.html
>>>>>
>>>>> So I uploaded new webrev. This change includes copyright year updates.
>>>>>
>>>>> ??? http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.06/
>>>>
>>>> Thanks Yasumasa,
>>>>
>>>> This looks good to me, will do some more testing while waiting for a
>>>> second reviewer and I can sponsor the change once it's ready to go.
>>>>>
>>>>>
>>>>> This change passes all tests on submit repo, and
>>>>> :hotspot_serviceability :jdk_tools tests on my laptop.
>>>>>
>>>>>
>>>>> http://java.se.oracle.com:10065/mdash/jobs/mach5-one-ysuenaga-JDK-8153333-20180206-0222-10428
>>>>>
>>>>>
>>>>>> If we do the change for CMS, we should
>>>>>> probably also do a CSR, but that should be fairly straight forward.
>>>>>
>>>>> What should I do to get CSR approve?
>>>>
>>>> In the bug system under "More" you can choose "Create CSR" which is the
>>>> first step. More information can be found on the wiki:
>>>> https://wiki.openjdk.java.net/display/csr/CSR+FAQs
>>>>
>>>> Cheers,
>>>> Stefan
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Yasumasa
>>>>>
>>>>>
>>>>> 2018-02-06 0:33 GMT+09:00 Stefan Johansson :
>>>>>>
>>>>>>
>>>>>> On 2018-02-03 06:40, Yasumasa Suenaga wrote:
>>>>>>>
>>>>>>> On 2018/02/02 23:38, Stefan Johansson wrote:
>>>>>>>>
>>>>>>>> Hi Yasumasa,
>>>>>>>>
>>>>>>>> The changes doesn't apply clean on the latest jdk/hs, can you provide
>>>>>>>> an
>>>>>>>> updated webrev?
>>>>>>>
>>>>>>>
>>>>>>> I uploaded webrev for jdk-hs:
>>>>>>> ??? cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.05/
>>>>>>>
>>>>>> Thanks, I've kicked off a testing job now to verify nothing unexpected
>>>>>> fails.
>>>>>>>
>>>>>>>
>>>>>>>> The testing done by the submit repo doesn't cover the tests you have
>>>>>>>> update so I plan to take the change for a spin and make sure the
>>>>>>>> correct
>>>>>>>> tests are run and verified in Mach 5.
>>>>>>>
>>>>>>>
>>>>>>> I've also tested hotspot/jtreg/:hotspot_serviceability and
>>>>>>> jdk/:jdk_tools
>>>>>>> on my laptop.
>>>>>>> I did not see any errors / failures which are related to this change.
>>>>>>
>>>>>> I also ran some local tests on this and it looks good.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Also a question about the change. Why do we need a special flag for
>>>>>>>> CMS?
>>>>>>>> I see that the original bug report refers to the flag as being a way
>>>>>>>> to turn
>>>>>>>> on and off the feature but the current implementation only consider
>>>>>>>> the flag
>>>>>>>> for CMS.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2016-March/016774.html
>>>>>>>
>>>>>>> Originally, STW phases (Remark and Cleanup) at G1 are not counted in
>>>>>>> jstat
>>>>>>> FGC column.
>>>>>>> So I think we need not to control the behavior of PerfCounter for G1.
>>>>>>>
>>>>>> I agree, for G1 this should not be controlled. Maybe I was a bit
>>>>>> unclear, I
>>>>>> was wondering why we want to control it for CMS. I think either we
>>>>>> should
>>>>>> change the behavior without guarding it by a flag or just skip updating
>>>>>> CMS
>>>>>> (and leave the pauses in FGC). If we do the change for CMS, we should
>>>>>> probably also do a CSR, but that should be fairly straight forward.
>>>>>>
>>>>>> I also found the old review thread where Jon M had the same comment
>>>>>> (removing the flag) and it looks like all agreed on that:
>>>>>>
>>>>>> http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2016-March/017118.html
>>>>>>
>>>>>> Thanks,
>>>>>> Stefan
>>>>>>
>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Yasumasa
>>>>>>>
>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Stefan
>>>>>>>>
>>>>>>>> On 2018-02-01 14:58, Yasumasa Suenaga wrote:
>>>>>>>>>
>>>>>>>>> PING: Could you review and sponsor it?
>>>>>>>>>
>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.04/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> This change has been passed Mach 5 via submit repo:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://java.se.oracle.com:10065/mdash/jobs/mach5-one-ysuenaga-JDK-8153333-20180201-0805-10101
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Yasumasa
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 2017/11/01 22:02, Yasumasa Suenaga wrote:
>>>>>>>>>>
>>>>>>>>>> PING: Could you review and sponsor it?
>>>>>>>>>>
>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.04/
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Also I need JPRT results of this change.
>>>>>>>>>> Could you cooperate?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> Yasumasa
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 2017/09/27 0:08, Yasumasa Suenaga wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi all,
>>>>>>>>>>>
>>>>>>>>>>> I uploaded new webrev to be adapted to jdk10/hs:
>>>>>>>>>>>
>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.04/
>>>>>>>>>>>
>>>>>>>>>>> I want to check this patch via JPRT, but I cannot access it.
>>>>>>>>>>> Could you cooperate?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> yasumasa
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 2017/09/21 7:46, Yasumasa Suenaga wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> PING:
>>>>>>>>>>>>
>>>>>>>>>>>> Have you checked this issue?
>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.03/hotspot/
>>>>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.03/jdk/
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Yasumasa
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 2017/07/01 23:44, Yasumasa Suenaga wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> PING:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Have you checked this issue?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Yasumasa
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 2017/06/14 13:22, Yasumasa Suenaga wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I changed PerfCounter to show CGC STW phase in jstat in
>>>>>>>>>>>>>> JDK-8151674.
>>>>>>>>>>>>>> However, it occurred several jtreg test failure, so it was
>>>>>>>>>>>>>> back-outed.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I want to resume to work for this issue.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.03/hotspot/
>>>>>>>>>>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.03/jdk/
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> These changes are work fine on jtreg test as below:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ???? hotspot/test/serviceability/tmtools/jstat
>>>>>>>>>>>>>> ???? jdk/test/sun/tools
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Since JDK 9, default GC algorithm is set to G1.
>>>>>>>>>>>>>> So I think this change is useful to watch GC behavior through
>>>>>>>>>>>>>> jstat.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I cannot access JPRT. Could you help?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Yasumasa
>>>>>>>>>>>>>>
>>>>
>>>
From thomas.schatzl at oracle.com Thu Mar 8 08:59:16 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 08 Mar 2018 09:59:16 +0100
Subject: RFR (S): 8196485: FromCardCache default card index can cause crashes
Message-ID: <1520499556.3121.8.camel@oracle.com>
Hi all,
can I have reviews for the following change that fixes a potential
crash due to missing remembered set entries on huge (2TB+) heaps, or
heaps that cross the 2TB address boundary (set via HeapBaseAddress)?
The reason is that in the FromCardCache that is used to filter out
repeated additions of the same card G1 uses 32 bits to represent that
card, with a default value of 2^32-1.
So if the first card we add to the remembered set has the index -1, G1
assumes that we already added that value and wrongly bails out.
2TB+ because 2^32 + 2^9 (card size) = 2^41 which is 2TB.
Note that some assertions in that code already catch this issue.
The fix is to extend the size of a FromCardCacheEntry to 64 bits, which
allows 2^73 byte sized heaps - which hopefully is sufficient for some
time :)
On my machine the passing test takes 8s (in debug mode), so I added it
to the regular tests run everytime.
CR:
https://bugs.openjdk.java.net/browse/JDK-8196485
Webrev:
http://cr.openjdk.java.net/~tschatzl/8196485/webrev/
Testing:
hs-tier1+2, new jtreg test asserting without the patch, running through
with the patch.
Thanks,
Thomas
From stefan.johansson at oracle.com Thu Mar 8 09:15:46 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Thu, 8 Mar 2018 10:15:46 +0100
Subject: RFR [L][4/7]: 8180415: Rebuild remembered sets during the
concurrent cycle
In-Reply-To: <1520413176.2346.9.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262478.2532.91.camel@oracle.com> <1520413176.2346.9.camel@oracle.com>
Message-ID: <1f345c49-7793-7925-2c15-281f24d28e74@oracle.com>
Thanks for addressing my initial comments Thomas,
On 2018-03-07 09:59, Thomas Schatzl wrote:
> Hi all,
>
> Stefan had some comments about the HeapRegionType parameter in the
> G1RemSetTrackingPolicy::update_at_allocate() method - that one is not
> really required when placing the call to this method correctly and just
> using the HeapRegion's type directly.
>
> Changing this removes another 40 LOC of changes.
>
> There has been another bug introduced by me during cleaning up for
> final review: G1RemSetTrackingPolicy::update_at_free() is empty in this
> change, which is wrong for this change - in this change we still do not
> free the remembered sets during the cleanup pause, only in the
> Concurrent Cleanup phase. When doing this concurrently, an assert
> triggers when setting the remembered set state to empty outside a
> safepoint.
> The fix is to make the remembered set untracked during the Cleanup
> phase still.
>
> New webrevs:
> http://cr.openjdk.java.net/~tschatzl/8180415/webrev.0_to_1 (diff)
> http://cr.openjdk.java.net/~tschatzl/8180415/webrev.1 (full)
The change looks good. Just some additional comments:
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
1255???? GCTraceTime(Debug, gc)("Complete Remembered Set Tracking");
...
1291???? GCTraceTime(Debug, gc)("Finalize Concurrent Mark Cleanup");
Please add the "phases" tag to the above logging to be more consistent
with the remark and other pauses.
---
src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp
52 template inline void G1AdjustClosure::adjust_pointer(T* p)
In this method the comments should be updated since we no longer return
anything.
---
src/hotspot/share/gc/g1/g1RemSet.cpp
757???????? HeapRegion* start_region = hr->humongous_start_region();
start_region is only used to get bottom and crate an oop, so maybe
instead create the oop directly, like:
oop humongous = oop(hr->humongous_start_region()->bottom());
?761???????? // A humongous object is live (with respect to the
scanning) either
?762???????? // a) it is marked on the bitmap as such
?763???????? // b) its TARS is larger than nTAMS, i.e. has been
allocated during marking.
?764???????? if
(_cm->next_mark_bitmap()->is_marked(start_region->bottom()) ||
?765?????????? (top_at_rebuild_start > hr->next_top_at_mark_start())) {
Break this check out to get something like: is_live(humongous, tars, ntams).
There is also the marked_bytes counting in this method that makes the
code a bit harder to follow. I've discussed this with Thomas offline and
he has an idea of how to avoid this.
---
Also in G1FullCollector::phase3_adjust_pointers() there is a GCTraceTime
that needs updating, since we no longer rebuild remember sets.
Thanks,
Stefan
> Thanks,
> Thomas
>
> On Mon, 2018-03-05 at 16:07 +0100, Thomas Schatzl wrote:
>> Hi all,
>>
>> can I have reviews for this change that implements the bulk of the
>> "rebuild remembered sets concurrently" mechanism?
>>
>> This change modifies the management of remembered sets so that those
>> are only maintained when they are useful. This roughly means:
>> - always maintain remembered sets for young gen regions
>> - (almost) always maintain remembered sets for humongous regions (for
>> eager reclaim) as long as they meet the eager reclaim criteria.
>> - never create remembered sets for archive regions
>> - do not create remembered sets for any regions during full gc
>> - do not create remembered sets for regions with evacuation failure
>>
>> (The latter two decisions may not be optimal, but the idea was to
>> strictly only maintain remembered sets for regions we are going to
>> try
>> to evacuate soon)
>>
>> - create remembered sets for old gen regions after finishing marking
>> (starting at the Remark pause), iff
>>
>> - the liveness of these regions indicate so (liveness <=
>> G1MixedGCLiveThresholdPercent)
>> - any (non-objArray) humongous region that does not have a
>> remembered
>> set yet (eg. because of full gc)
>>
>> (Please see the new G1RemSetTrackingPolicy implementation for exact
>> details)
>>
>> During the following "Rebuild Remembered Set" phase, that replaces
>> the
>> "Create Live Data" phase, all non-young regions that may contain
>> outgoing pointers (i.e. excluding closed archive regions), G1 scans
>> the
>> live objects in the regions between bottom and TARS
>> ("top_at_rebuild_start" - yes, that's new :) for inter-region
>> references and add them to the appropriate remembered set.
>>
>> The TARS, as the name indicates, is the top-value at the start of
>> remark, and the regions contain live data between this value and
>> bottom
>> that needs to be scanned during this rebuild phase.
>>
>> The reason for a new indicator is that nTAMS is *not* sufficient:
>> during marking there might have been more allocations in the old gen
>> that also need to be scanned for new references.
>>
>> All references above TARS (and below the region's top) will be
>> handled
>> by the existing barrier mechanism.
>>
>> After rebuild, during the Cleanup pause, we create the new
>> (candidate)
>> collection set, eventually filtering out more regions, like humongous
>> ones that exceed the eager reclaim criteria.
>>
>> The current state of the remembered set for a given region is tracked
>> within the remembered set for that region (HeapRegionRememberedSet
>> class): a remembered set can be either Untracked, Updating or
>> Complete.
>> Untracked means that we do not manage a remembered set for this
>> region,
>> Complete means just that, and Updating means that we are currently in
>> the process of updating the remembered set. This distinction is
>> relevant for evacuation, e.g. we obviously must not evacuate not-
>> Complete remembered sets.
>>
>> Note that this change contains one single temporary ugly hack that
>> allows G1 to work until the next change :) - so in this change G1
>> determines whether there will be a mixed gc phase during the Cleanup
>> pause. It needs to determine this information at that time, instead
>> of
>> previously during concurrent cleanup, to, if there is no mixed gc
>> coming, drop all remembered sets to not maintain them further.
>>
>> For this reason, and to avoid duplicate recalculation that may yield
>> different results after dropping remembered sets, there is a new flag
>> mixed_gc_pending in CollectorState, making it even more complicated.
>> That one is going away in the next change, promised. :)
>>
>> Some imho useful messages about remembered set tracking are printed
>> using "gc, remset, tracking" log tags, both in debug and trace level.
>>
>> CR:
>> https://bugs.openjdk.java.net/browse/JDK-8180415
>> Webrev:
>> http://cr.openjdk.java.net/~tschatzl/8180415/webrev/index.html
>> Testing:
>> hs-tier 1-5, etc. etc.
>>
>> Thanks,
>> Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From rkennke at redhat.com Thu Mar 8 10:25:42 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 8 Mar 2018 11:25:42 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <5A9EBD6E.3070005@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
Message-ID: <2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
Wouldn't that lead to mis-aligned accesses when you try to copy an array
of, e.g., bytes, but shoehorn it to pointer-size? Or am I misunderstanding?
An idea would be to copy equal-sized elements using the corresponding
Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
short version, boolean and byte would use the byte version (or is
boolean sometimes int?!), float and int would use the int version and
long and double the long version. WDYT?
Roman
> My spontaneous idea was to have an overload for type erased void* that
> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
> which AFAIK is conservatively atomic regardless of what the precise
> element type is.
>
> But if you have better ideas, I am open for suggestions.
>
> Thanks,
> /Erik
>
> On 2018-03-06 17:03, Roman Kennke wrote:
>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when we can
>>> just as well call typeArrayOop::copy_array() and have it do the right
>>> thing? Or go even further and also do it for oop-arraycopy?
>> Something like:
>>
>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>
>> This wouldn't compile because of bunch of missing
>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>> jdouble, jboolean, etc, which in turn would be missing the same
>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>> specific stuff... and my question before I go there is: do we want all
>> that? Or can you think of a better way to solve it?
>>
>> Roman
>>
>>> Roman
>>>
>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
>>>> of the passed in elements.
>>>> In this case, it looks like the address has been type erased to void*,
>>>> and hence lost what the element size was. There is currently no
>>>> overload
>>>> accepted for type erased element - only accurate elements {jbyte,
>>>> jshort, jint, jlong}.
>>>>
>>>> So it looks like an overload must be added to accept type erased void*
>>>> elements and make that call conjoint_memory_atomic when the
>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>> Hi David,
>>>>>>
>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>>>>>> should probably be used here.
>>>>> If that code implements a Java array copy then yes it is required to
>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>>>
>>>>> David
>>>>>
>>>>>> Thanks,
>>>>>> /Erik
>>>>>>
>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>> Hi Roman,
>>>>>>>
>>>>>>> Not a review as I'm not familiar enough with the Access API, but in
>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>> arraycopy is atomic?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> David
>>>>>>>
>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>> not for
>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>> resolve
>>>>>>>> src and dst arrays.
>>>>>>>>
>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>> Access API,
>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>>>>>> src
>>>>>>>> and dst oop operands, but it's called like that. The only reason
>>>>>>>> why
>>>>>>>> this does not blow up (I think) is that because nobody calls it,
>>>>>>>> the
>>>>>>>> compiler doesn't even get there.
>>>>>>>>
>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>> calls into
>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>> cannot be
>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>>>> should
>>>>>>>> be covered with this change.
>>>>>>>>
>>>>>>>> It should be possible to use the same Access API for Java-array <->
>>>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>>>>>> separate change though.
>>>>>>>>
>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>
>>>>>>>> Tests: tier1 ok
>>>>>>>>
>>>>>>>> Please review!
>>>>>>>> Thanks, Roman
>>>>>>>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From thomas.schatzl at oracle.com Thu Mar 8 11:49:20 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 08 Mar 2018 12:49:20 +0100
Subject: RFR [L][4/7]: 8180415: Rebuild remembered sets during the
concurrent cycle
In-Reply-To: <1f345c49-7793-7925-2c15-281f24d28e74@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262478.2532.91.camel@oracle.com> <1520413176.2346.9.camel@oracle.com>
<1f345c49-7793-7925-2c15-281f24d28e74@oracle.com>
Message-ID: <1520509760.3121.15.camel@oracle.com>
Hi Stefan,
On Thu, 2018-03-08 at 10:15 +0100, Stefan Johansson wrote:
> Thanks for addressing my initial comments Thomas,
>
> On 2018-03-07 09:59, Thomas Schatzl wrote:
> > Hi all,
> >
> > Stefan had some comments about the HeapRegionType parameter in
> > the G1RemSetTrackingPolicy::update_at_allocate() method - that one
> > is not really required when placing the call to this method
> > correctly and just using the HeapRegion's type directly.
> >
> > Changing this removes another 40 LOC of changes.
> >
> > There has been another bug introduced by me during cleaning up for
> > final review: G1RemSetTrackingPolicy::update_at_free() is empty in
> > this change, which is wrong for this change - in this change we
> > still do not free the remembered sets during the cleanup pause,
> > only in the Concurrent Cleanup phase. When doing this concurrently,
> > an assert triggers when setting the remembered set state to empty
> > outside a safepoint.
> > The fix is to make the remembered set untracked during the Cleanup
> > phase still.
> >
> > New webrevs:
> > http://cr.openjdk.java.net/~tschatzl/8180415/webrev.0_to_1 (diff)
> > http://cr.openjdk.java.net/~tschatzl/8180415/webrev.1 (full)
> The change looks good. Just some additional comments:
> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
> 1255 GCTraceTime(Debug, gc)("Complete Remembered Set Tracking");
> ...
> 1291 GCTraceTime(Debug, gc)("Finalize Concurrent Mark Cleanup");
>
> Please add the "phases" tag to the above logging to be more
> consistent with the remark and other pauses.
> ---
> src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp
> 52 template inline void G1AdjustClosure::adjust_pointer(T*
> p)
>
> In this method the comments should be updated since we no longer
> return anything.
> ---
> src/hotspot/share/gc/g1/g1RemSet.cpp
> 757 HeapRegion* start_region = hr->humongous_start_region();
>
> start_region is only used to get bottom and crate an oop, so maybe
> instead create the oop directly, like:
> oop humongous = oop(hr->humongous_start_region()->bottom());
>
> 761 // A humongous object is live (with respect to the
> scanning) either
> 762 // a) it is marked on the bitmap as such
> 763 // b) its TARS is larger than nTAMS, i.e. has been
> allocated during marking.
> 764 if (_cm->next_mark_bitmap()->is_marked(start_region-
> >bottom()) ||
> 765 (top_at_rebuild_start > hr->next_top_at_mark_start()))
> {
>
> Break this check out to get something like: is_live(humongous, tars,
> ntams).
Fixed.
> There is also the marked_bytes counting in this method that makes the
> code a bit harder to follow. I've discussed this with Thomas offline
> and he has an idea of how to avoid this.
As discussed I would like to postpone this for now as it is much harder
than it looks and warrants its own CR (actually two or three).
> Also in G1FullCollector::phase3_adjust_pointers() there is a
> GCTraceTime that needs updating, since we no longer rebuild remember
> sets.
All done.
New webrevs:
http://cr.openjdk.java.net/~tschatzl/8180415/webrev.1_to_2/ (diff)
http://cr.openjdk.java.net/~tschatzl/8180415/webrev.2/ (full)
Thomas
From thomas.schatzl at oracle.com Thu Mar 8 11:59:44 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 08 Mar 2018 12:59:44 +0100
Subject: RFR [S][5/7]: 8197573: Remove concurrent cleanup and secondary
free list handling
In-Reply-To: <1520262995.2532.99.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262995.2532.99.camel@oracle.com>
Message-ID: <1520510384.3121.17.camel@oracle.com>
Hi,
On Mon, 2018-03-05 at 16:16 +0100, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this change that removes the concurrent
> cleanup phase and the secondary free list handling entirely. It moves
> leftover work into the Cleanup pause.
>
> In the previous change the remembered set scrubbing, which took in
> cases where it mattered like 95%+ of time, has been removed because
> it
> is not required any more.
>
> The reasons for removal are:
> - due to JDK-8180415 *freeing* remembered sets (as opposed to
> calculating occupancy) is really fast, so this phase has never been
> very long for a long time.
> - it adds a lock in the LAB allocation path
>
> It also allows us to remove the "mixed_gc_pending" flag in the
> CollectorState, as there is no further time to wait until G1 can
> schedule the "last young gc".
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8197573
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197573/webrev/index.html
> Testing:
> hs-tier 1-3, ....
>
> (I consider this an "S" changeset because it is mostly removal of
> code).
>
Some ripple-through after latest changes to JDK-8180415 requires an
update of the webrevs:
http://cr.openjdk.java.net/~tschatzl/8197573/webrev.0_to_1 (diff)
http://cr.openjdk.java.net/~tschatzl/8197573/webrev.1 (full)
I also found some more opportunity to do minor cleanup after Stefan's
last remark about log messages...
Thanks,
Thomas
From rkennke at redhat.com Thu Mar 8 12:27:31 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 8 Mar 2018 13:27:31 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <5A9EBD6E.3070005@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
Message-ID: <1c75416f-d27e-c7a2-537d-743a77407812@redhat.com>
The following changeset addresses all the comments that have been
brought up so far in review. It also makes the arraycopy word-atomic. It
casts pointers to elements of same size to their respective counterparts
in Copy::conjoint_XXX_atomic(), i.e. jboolean* -> jbyte*, jchar* ->
jshort*, jfloat* -> jint* and jdouble* -> jlong*.
Differential:
http://cr.openjdk.java.net/~rkennke/8198445/webrev.01.diff/
Full:
http://cr.openjdk.java.net/~rkennke/8198445/webrev.01/
Still passes tier1 tests.
OK to go?
Roman
> Hi Roman,
>
> My spontaneous idea was to have an overload for type erased void* that
> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
> which AFAIK is conservatively atomic regardless of what the precise
> element type is.
>
> But if you have better ideas, I am open for suggestions.
>
> Thanks,
> /Erik
>
> On 2018-03-06 17:03, Roman Kennke wrote:
>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when we can
>>> just as well call typeArrayOop::copy_array() and have it do the right
>>> thing? Or go even further and also do it for oop-arraycopy?
>> Something like:
>>
>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>
>> This wouldn't compile because of bunch of missing
>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>> jdouble, jboolean, etc, which in turn would be missing the same
>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>> specific stuff... and my question before I go there is: do we want all
>> that? Or can you think of a better way to solve it?
>>
>> Roman
>>
>>> Roman
>>>
>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
>>>> of the passed in elements.
>>>> In this case, it looks like the address has been type erased to void*,
>>>> and hence lost what the element size was. There is currently no
>>>> overload
>>>> accepted for type erased element - only accurate elements {jbyte,
>>>> jshort, jint, jlong}.
>>>>
>>>> So it looks like an overload must be added to accept type erased void*
>>>> elements and make that call conjoint_memory_atomic when the
>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>> Hi David,
>>>>>>
>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>>>>>> should probably be used here.
>>>>> If that code implements a Java array copy then yes it is required to
>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>>>
>>>>> David
>>>>>
>>>>>> Thanks,
>>>>>> /Erik
>>>>>>
>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>> Hi Roman,
>>>>>>>
>>>>>>> Not a review as I'm not familiar enough with the Access API, but in
>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>> arraycopy is atomic?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> David
>>>>>>>
>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>> not for
>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>> resolve
>>>>>>>> src and dst arrays.
>>>>>>>>
>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>> Access API,
>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>>>>>> src
>>>>>>>> and dst oop operands, but it's called like that. The only reason
>>>>>>>> why
>>>>>>>> this does not blow up (I think) is that because nobody calls it,
>>>>>>>> the
>>>>>>>> compiler doesn't even get there.
>>>>>>>>
>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>> calls into
>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>> cannot be
>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>>>> should
>>>>>>>> be covered with this change.
>>>>>>>>
>>>>>>>> It should be possible to use the same Access API for Java-array <->
>>>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>>>>>> separate change though.
>>>>>>>>
>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>
>>>>>>>> Tests: tier1 ok
>>>>>>>>
>>>>>>>> Please review!
>>>>>>>> Thanks, Roman
>>>>>>>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From stefan.johansson at oracle.com Thu Mar 8 12:28:56 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Thu, 8 Mar 2018 13:28:56 +0100
Subject: RFR [S][5/7]: 8197573: Remove concurrent cleanup and secondary
free list handling
In-Reply-To: <1520510384.3121.17.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262995.2532.99.camel@oracle.com> <1520510384.3121.17.camel@oracle.com>
Message-ID:
On 2018-03-08 12:59, Thomas Schatzl wrote:
> Hi,
>
> On Mon, 2018-03-05 at 16:16 +0100, Thomas Schatzl wrote:
>> Hi all,
>>
>> can I have reviews for this change that removes the concurrent
>> cleanup phase and the secondary free list handling entirely. It moves
>> leftover work into the Cleanup pause.
>>
>> In the previous change the remembered set scrubbing, which took in
>> cases where it mattered like 95%+ of time, has been removed because
>> it
>> is not required any more.
>>
>> The reasons for removal are:
>> - due to JDK-8180415 *freeing* remembered sets (as opposed to
>> calculating occupancy) is really fast, so this phase has never been
>> very long for a long time.
>> - it adds a lock in the LAB allocation path
>>
>> It also allows us to remove the "mixed_gc_pending" flag in the
>> CollectorState, as there is no further time to wait until G1 can
>> schedule the "last young gc".
>>
>> CR:
>> https://bugs.openjdk.java.net/browse/JDK-8197573
>> Webrev:
>> http://cr.openjdk.java.net/~tschatzl/8197573/webrev/index.html
>> Testing:
>> hs-tier 1-3, ....
>>
>> (I consider this an "S" changeset because it is mostly removal of
>> code).
>>
> Some ripple-through after latest changes to JDK-8180415 requires an
> update of the webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197573/webrev.0_to_1 (diff)
> http://cr.openjdk.java.net/~tschatzl/8197573/webrev.1 (full)
Looks lovely, just some minor things:
src/hotspot/share/gc/g1/concurrentMarkThread.cpp
436?????????? log_info(gc, marking)("Concurrent Mark Abort");
This line was removed, and it looks like will never log a concurrent
mark abort now. Looks like this could be added to
G1ConcurrentMark::concurrent_cycle_end() where we trace a potential cm
failure.
---
src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
106?? _g1h->free_humongous_region(hr, &dummy_free_list);
Should be safe to call free_humongous_region with locked = true here,
since this will be the only thread working on that region.
115?? _g1h->card_table()->clear(MemRegion(hr->bottom(), hr->end()));
Pre-existing, but since you have added the clear_cardtable() function we
could use it here as well, seems to be the only place where the old
"scheme" is used.
---
> I also found some more opportunity to do minor cleanup after Stefan's
> last remark about log messages...
Nice, and you also restructured the code exactly like I planned to
comment :)
Thanks,
Stefan
> Thanks,
> Thomas
>
From stefan.johansson at oracle.com Thu Mar 8 12:52:56 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Thu, 8 Mar 2018 13:52:56 +0100
Subject: RFR [XS][6/7]: 8197928: Only enqueue deferred cards with
references into regions that have a tracked remembered set during GC
In-Reply-To: <1520263515.2532.106.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520263515.2532.106.camel@oracle.com>
Message-ID:
Hi Thomas,
On 2018-03-05 16:25, Thomas Schatzl wrote:
> Hi all,
>
> can I have reviews for this tiny change that optimizes evacuation a
> little: in particular, when updating the remembered sets (enqueuing
> cards), we do not need to do this for regions where we do not track the
> remembered sets.
>
> The suggested implementation is rather primitive, I have not noticed
> pause time impact on doing so (of course it can lessen the concurrent
> work later).
>
> An alternative implementation I considered has been to create a per-
> region map with a single flag that contains the "needs-update/does-not-
> need-update" information, like the _fast_in_cset_state table.
>
> However creating such a table requires G1 to iterate over all regions
> before evacuation, and that would be something that needs to be added
> as G1 does not do that yet.
>
> Another would be to move remembered set state/remembered sets outside
> of the region, so it can be accessed quickly during GC.
>
> In any case I thought this implementation is better than not doing it,
> hoping for some input here. :)
I agree, let's start out with this approach and we can re-visit this
later if needed.
Reviewed,
Stefan
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8197928
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197928/webrev/
> Testing:
> hs-tier1-5, ...
>
> Thanks,
> Thomas
>
From erik.osterlund at oracle.com Thu Mar 8 13:13:13 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Thu, 8 Mar 2018 14:13:13 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
Message-ID: <5AA136E9.9080100@oracle.com>
Hi Roman,
On 2018-03-08 11:25, Roman Kennke wrote:
> Wouldn't that lead to mis-aligned accesses when you try to copy an array
> of, e.g., bytes, but shoehorn it to pointer-size? Or am I misunderstanding?
No it would not. The element type is void, not void*. Because the
element type is type erased. And that would map to
Copy::conjoint_memory_atomic, which is precisely what typeArrayKlass.cpp
maps such an arraycopy to today. Assuming elements are aligned to their
natural size (which they are), Copy::conjoint_memory_atomic is
guaranteed to be at least as atomic as you need your elements to be, up
to an element size of 8.
> An idea would be to copy equal-sized elements using the corresponding
> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
> short version, boolean and byte would use the byte version (or is
> boolean sometimes int?!), float and int would use the int version and
> long and double the long version. WDYT?
I'm not sure I see what the advantage of that would be.
Thanks,
/Erik
> Roman
>
>
>> My spontaneous idea was to have an overload for type erased void* that
>> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
>> which AFAIK is conservatively atomic regardless of what the precise
>> element type is.
>>
>> But if you have better ideas, I am open for suggestions.
>>
>> Thanks,
>> /Erik
>>
>> On 2018-03-06 17:03, Roman Kennke wrote:
>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when we can
>>>> just as well call typeArrayOop::copy_array() and have it do the right
>>>> thing? Or go even further and also do it for oop-arraycopy?
>>> Something like:
>>>
>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>
>>> This wouldn't compile because of bunch of missing
>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>> jdouble, jboolean, etc, which in turn would be missing the same
>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>> specific stuff... and my question before I go there is: do we want all
>>> that? Or can you think of a better way to solve it?
>>>
>>> Roman
>>>
>>>> Roman
>>>>
>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the size
>>>>> of the passed in elements.
>>>>> In this case, it looks like the address has been type erased to void*,
>>>>> and hence lost what the element size was. There is currently no
>>>>> overload
>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>> jshort, jint, jlong}.
>>>>>
>>>>> So it looks like an overload must be added to accept type erased void*
>>>>> elements and make that call conjoint_memory_atomic when the
>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>
>>>>> Thanks,
>>>>> /Erik
>>>>>
>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>> Hi David,
>>>>>>>
>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that comment is
>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC decorator
>>>>>>> should probably be used here.
>>>>>> If that code implements a Java array copy then yes it is required to
>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>>>>
>>>>>> David
>>>>>>
>>>>>>> Thanks,
>>>>>>> /Erik
>>>>>>>
>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>> Hi Roman,
>>>>>>>>
>>>>>>>> Not a review as I'm not familiar enough with the Access API, but in
>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the changed
>>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>>> arraycopy is atomic?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> David
>>>>>>>>
>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>> not for
>>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>>> resolve
>>>>>>>>> src and dst arrays.
>>>>>>>>>
>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>> Access API,
>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not take
>>>>>>>>> src
>>>>>>>>> and dst oop operands, but it's called like that. The only reason
>>>>>>>>> why
>>>>>>>>> this does not blow up (I think) is that because nobody calls it,
>>>>>>>>> the
>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>
>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>> calls into
>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>> cannot be
>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>>>>> should
>>>>>>>>> be covered with this change.
>>>>>>>>>
>>>>>>>>> It should be possible to use the same Access API for Java-array <->
>>>>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that in a
>>>>>>>>> separate change though.
>>>>>>>>>
>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>
>>>>>>>>> Tests: tier1 ok
>>>>>>>>>
>>>>>>>>> Please review!
>>>>>>>>> Thanks, Roman
>>>>>>>>>
>
From thomas.schatzl at oracle.com Thu Mar 8 13:31:52 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 08 Mar 2018 14:31:52 +0100
Subject: RFR [S][5/7]: 8197573: Remove concurrent cleanup and secondary
free list handling
In-Reply-To:
References: <1520258985.2532.40.camel@oracle.com>
<1520262995.2532.99.camel@oracle.com> <1520510384.3121.17.camel@oracle.com>
Message-ID: <1520515912.3121.23.camel@oracle.com>
Hi,
On Thu, 2018-03-08 at 13:28 +0100, Stefan Johansson wrote:
> On 2018-03-08 12:59, Thomas Schatzl wrote:
> > Hi,
> >
> > On Mon, 2018-03-05 at 16:16 +0100, Thomas Schatzl wrote:
> > > Hi all,
> > >
> > > can I have reviews for this change that removes the concurrent
> > > cleanup phase and the secondary free list handling entirely. It
> > > moves leftover work into the Cleanup pause.
> > >
> > > In the previous change the remembered set scrubbing, which took
> > > in cases where it mattered like 95%+ of time, has been removed
> > > because it is not required any more.
> > >
> > > The reasons for removal are:
> > > - due to JDK-8180415 *freeing* remembered sets (as opposed to
> > > calculating occupancy) is really fast, so this phase has never
> > > been very long for a long time.
> > > - it adds a lock in the LAB allocation path
> > >
> > > It also allows us to remove the "mixed_gc_pending" flag in the
> > > CollectorState, as there is no further time to wait until G1 can
> > > schedule the "last young gc".
> > >
> > > CR:
> > > https://bugs.openjdk.java.net/browse/JDK-8197573
> > > Webrev:
> > > http://cr.openjdk.java.net/~tschatzl/8197573/webrev/index.html
> > > Testing:
> > > hs-tier 1-3, ....
> > >
> > > (I consider this an "S" changeset because it is mostly removal of
> > > code).
> > >
> >
> > Some ripple-through after latest changes to JDK-8180415 requires an
> > update of the webrevs:
> > http://cr.openjdk.java.net/~tschatzl/8197573/webrev.0_to_1 (diff)
> > http://cr.openjdk.java.net/~tschatzl/8197573/webrev.1 (full)
>
> Looks lovely, just some minor things:
> src/hotspot/share/gc/g1/concurrentMarkThread.cpp
> 436 log_info(gc, marking)("Concurrent Mark Abort");
>
> This line was removed, and it looks like will never log a concurrent
> mark abort now. Looks like this could be added to
> G1ConcurrentMark::concurrent_cycle_end() where we trace a potential
> cm failure.
Nice catch!
> ---
> src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
> 106 _g1h->free_humongous_region(hr, &dummy_free_list);
>
> Should be safe to call free_humongous_region with locked = true
> here, since this will be the only thread working on that region.
Fixed.
>
> 115 _g1h->card_table()->clear(MemRegion(hr->bottom(), hr->end()));
>
> Pre-existing, but since you have added the clear_cardtable() function
> we could use it here as well, seems to be the only place where the
> old "scheme" is used.
Done.
> ---
>
> > I also found some more opportunity to do minor cleanup after
> > Stefan's
> > last remark about log messages...
>
> Nice, and you also restructured the code exactly like I planned to
> comment :)
:)
New webrevs:
http://cr.openjdk.java.net/~tschatzl/8197573/webrev.1_to_2/ (diff)
http://cr.openjdk.java.net/~tschatzl/8197573/webrev.2/ (full)
Thanks,
Thomas
From thomas.schatzl at oracle.com Thu Mar 8 13:33:33 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 08 Mar 2018 14:33:33 +0100
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
Message-ID: <1520516013.3121.24.camel@oracle.com>
Hi,
with the rebuild remsets concurrently changes the last user of the gc
time stamps (create live data) has gone away.
This change removes all of the corresponding code I could find.
Could you review it?
CR:
https://bugs.openjdk.java.net/browse/JDK-8199326
Webrev:
http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
Testing:
hs-tier1
Thanks,
Thomas
From stefan.johansson at oracle.com Thu Mar 8 15:18:19 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Thu, 8 Mar 2018 16:18:19 +0100
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
In-Reply-To: <1520516013.3121.24.camel@oracle.com>
References: <1520516013.3121.24.camel@oracle.com>
Message-ID: <7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
Hi Thomas,
On 2018-03-08 14:33, Thomas Schatzl wrote:
> Hi,
>
> with the rebuild remsets concurrently changes the last user of the gc
> time stamps (create live data) has gone away.
>
> This change removes all of the corresponding code I could find.
>
> Could you review it?
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8199326
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
Looks like you pasted the wrong link, and I couldn't find the correct
one either.
Stefan
> Testing:
> hs-tier1
>
> Thanks,
> Thomas
>
From thomas.schatzl at oracle.com Thu Mar 8 15:46:20 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 08 Mar 2018 16:46:20 +0100
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
In-Reply-To: <7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
References: <1520516013.3121.24.camel@oracle.com>
<7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
Message-ID: <1520523980.3121.29.camel@oracle.com>
On Thu, 2018-03-08 at 16:18 +0100, Stefan Johansson wrote:
> Hi Thomas,
>
> On 2018-03-08 14:33, Thomas Schatzl wrote:
> > Hi,
> >
> > with the rebuild remsets concurrently changes the last user of
> > the gc
> > time stamps (create live data) has gone away.
> >
> > This change removes all of the corresponding code I could find.
> >
> > Could you review it?
> >
> > CR:
> > https://bugs.openjdk.java.net/browse/JDK-8199326
> > Webrev:
> > http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
>
> Looks like you pasted the wrong link, and I couldn't find the
> correct
> one either.
Sorry. The correct link is:
http://cr.openjdk.java.net/~tschatzl/8199326/webrev
Thomas
From rkennke at redhat.com Thu Mar 8 20:12:16 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 8 Mar 2018 21:12:16 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <5AA136E9.9080100@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
Message-ID: <3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
> Hi Roman,
>
> On 2018-03-08 11:25, Roman Kennke wrote:
>> Wouldn't that lead to mis-aligned accesses when you try to copy an array
>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>> misunderstanding?
>
> No it would not. The element type is void, not void*. Because the
> element type is type erased. And that would map to
> Copy::conjoint_memory_atomic, which is precisely what typeArrayKlass.cpp
> maps such an arraycopy to today. Assuming elements are aligned to their
> natural size (which they are), Copy::conjoint_memory_atomic is
> guaranteed to be at least as atomic as you need your elements to be, up
> to an element size of 8.
Ah, ok. Alright, so here comes rev.02:
Differential:
http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
Full:
http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
Still passes tier1 tests.
Ok now?
Cheers, Roman
>
>> An idea would be to copy equal-sized elements using the corresponding
>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>> short version, boolean and byte would use the byte version (or is
>> boolean sometimes int?!), float and int would use the int version and
>> long and double the long version. WDYT?
>
> I'm not sure I see what the advantage of that would be.
>
> Thanks,
> /Erik
>
>> Roman
>>
>>
>>> My spontaneous idea was to have an overload for type erased void* that
>>> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
>>> which AFAIK is conservatively atomic regardless of what the precise
>>> element type is.
>>>
>>> But if you have better ideas, I am open for suggestions.
>>>
>>> Thanks,
>>> /Erik
>>>
>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>> we can
>>>>> just as well call typeArrayOop::copy_array() and have it do the right
>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>> Something like:
>>>>
>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>
>>>> This wouldn't compile because of bunch of missing
>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>> specific stuff... and my question before I go there is: do we want all
>>>> that? Or can you think of a better way to solve it?
>>>>
>>>> Roman
>>>>
>>>>> Roman
>>>>>
>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the
>>>>>> size
>>>>>> of the passed in elements.
>>>>>> In this case, it looks like the address has been type erased to
>>>>>> void*,
>>>>>> and hence lost what the element size was. There is currently no
>>>>>> overload
>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>> jshort, jint, jlong}.
>>>>>>
>>>>>> So it looks like an overload must be added to accept type erased
>>>>>> void*
>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>
>>>>>> Thanks,
>>>>>> /Erik
>>>>>>
>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>> Hi David,
>>>>>>>>
>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>> comment is
>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>> decorator
>>>>>>>> should probably be used here.
>>>>>>> If that code implements a Java array copy then yes it is required to
>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> /Erik
>>>>>>>>
>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>> Hi Roman,
>>>>>>>>>
>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>> but in
>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>> changed
>>>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>>>> arraycopy is atomic?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>> not for
>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>>>> resolve
>>>>>>>>>> src and dst arrays.
>>>>>>>>>>
>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>> Access API,
>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not
>>>>>>>>>> take
>>>>>>>>>> src
>>>>>>>>>> and dst oop operands, but it's called like that. The only reason
>>>>>>>>>> why
>>>>>>>>>> this does not blow up (I think) is that because nobody calls it,
>>>>>>>>>> the
>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>
>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>> calls into
>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>> cannot be
>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>>>>>> should
>>>>>>>>>> be covered with this change.
>>>>>>>>>>
>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>> Java-array <->
>>>>>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that
>>>>>>>>>> in a
>>>>>>>>>> separate change though.
>>>>>>>>>>
>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>
>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>
>>>>>>>>>> Please review!
>>>>>>>>>> Thanks, Roman
>>>>>>>>>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From thomas.schatzl at oracle.com Fri Mar 9 08:41:08 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Fri, 09 Mar 2018 09:41:08 +0100
Subject: PING: RFR: JDK-8153333: [REDO] STW phases at Concurrent GC
should count in PerfCounter
In-Reply-To:
References:
<2f4e0901-1602-6276-e7fd-84e168e7b317@gmail.com>
<3210723e-c5f9-4277-a97a-be61e10e6b3d@oracle.com>
<89a1a161-874d-4743-e52b-7ab202fd8976@gmail.com>
<9799a2ad-6727-cae9-312b-fd9de13c8203@oracle.com>
<9183dfd3-522f-fd73-a681-5ea957f1d717@gmail.com>
Message-ID: <1520584868.3872.6.camel@oracle.com>
Hi Yasumasa,
On Wed, 2018-03-07 at 21:18 +0900, Yasumasa Suenaga wrote:
> PING: Could you review it?
>
> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.08/
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8153333
> CSR: https://bugs.openjdk.java.net/browse/JDK-8196862
>
> This change has passed Mach5 on submit repo.
> Also it has passed hotspot/jtreg/:hotspot_serviceability and
> jdk/:jdk_tools jtreg tests.
>
> We need one more reviewer.
- one really minor issue I think: in the description in
JstatGcCauseResults.java, the descriptions of the new concurrent
collections, between "GCT" and "Total Garbage collection time." there
should probably be one space less to align with the "main" gc phase
times.
- in gcCapacityOutput1.awk, gcNewCapacityOutput1.awk, there are some
additional newlines (line 10/11).
No need for re-review from me, and for the change in
JstatGcCauseResults.java I am not completely sure my suggestion is
good.
Stefan Johansson already mentioned he will sponsor.
Thanks,
Thomas
From jini.george at oracle.com Fri Mar 9 09:29:02 2018
From: jini.george at oracle.com (Jini George)
Date: Fri, 9 Mar 2018 14:59:02 +0530
Subject: RFR: JDK-8175312: SA: clhsdb: Provide an improved heap summary
for 'universe' for G1GC
In-Reply-To:
References:
<38d71740-0b66-3ce8-26ed-a0f2b9f9e91c@oracle.com>
<5e8c582e-b32f-daf7-0e0c-1e6606ceaf3a@oracle.com>
Message-ID:
Here is the revised webrev:
http://cr.openjdk.java.net/~jgeorge/8175312/webrev.02/
I have made modifications to have the 'universe' command display details
like:
hsdb> universe
Heap Parameters:
garbage-first heap [0x0000000725200000, 0x00000007c0000000] region size
1024K
G1 Heap:
regions = 2478
capacity = 2598371328 (2478.0MB)
used = 5242880 (5.0MB)
free = 2593128448 (2473.0MB)
0.20177562550443906% used
G1 Young Generation:
Eden Space:
regions = 5
capacity = 8388608 (8.0MB)
used = 5242880 (5.0MB)
free = 3145728 (3.0MB)
62.5% used
Survivor Space:
regions = 0
capacity = 0 (0.0MB)
used = 0 (0.0MB)
free = 0 (0.0MB)
0.0% used
G1 Old Generation:
regions = 0
capacity = 155189248 (148.0MB)
used = 0 (0.0MB)
free = 155189248 (148.0MB)
0.0% used
I did not add the metaspace details since that did not seem to be in
line with the 'universe' output for other GCs. I have added a new
command "g1regiondetails" to display the region details, and have
modified the tests accordingly.
hsdb> g1regiondetails
Region Details:
Region: 0x0000000725200000,0x0000000725200000,0x0000000725300000:Free
Region: 0x0000000725300000,0x0000000725300000,0x0000000725400000:Free
Region: 0x0000000725400000,0x0000000725400000,0x0000000725500000:Free
Region: 0x0000000725500000,0x0000000725500000,0x0000000725600000:Free
Region: 0x0000000725600000,0x0000000725600000,0x0000000725700000:Free
Region: 0x0000000725700000,0x0000000725700000,0x0000000725800000:Free
...
Thanks,
Jini.
On 2/28/2018 12:56 PM, Jini George wrote:
> Thank you very much, Stefan. My answers inline.
>
> On 2/27/2018 3:30 PM, Stefan Johansson wrote:
>> Hi Jini,
>
>>>> JIRA ID:https://bugs.openjdk.java.net/browse/JDK-8175312
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.00/index.html
>>>>
>> It looks like a file is missing, did you forget to add it to the
>> changeset?
>
> Indeed, I had missed that! I added the missing file in the following
> webrev:
>
> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.01/
>
>> ---
>> open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java:36:
>> error: cannot find symbol
>> import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
>> ---
>>
>> Otherwise the change looks good, but I would like to see the output
>> live. For a big heap this will print a lot of data, just wondering if
>> the universe command is the correct choice for this kind of output. I
>> like having the possibility to print all regions, so I want the change
>> but maybe it should be a different command and 'universe' just prints
>> a little more than before. Something like our logging heap-summary at
>> shutdown:
>> garbage-first heap?? total 16384K, used 3072K [0x00000000ff000000,
>> 0x0000000100000000)
>> ??region size 1024K, 4 young (4096K), 0 survivors (0K)
>> Metaspace?????? used 6731K, capacity 6825K, committed 7040K, reserved
>> 1056768K
>> ??class space??? used 559K, capacity 594K, committed 640K, reserved
>> 1048576K
>
> Ok, will add this, and could probably have the region details displayed
> under a new command called "g1regiondetails", or some such, and send out
> a new webrev.
>
> Thanks,
> Jini.
>
>>
>> Thanks,
>> Stefan
>>>> Modifications have been made to display the regions like:
>>>>
>>>> ...
>>>> Region: 0x00000005c5400000,0x00000005c5600000,0x00000005c5600000:Old
>>>> Region: 0x00000005c5600000,0x00000005c5800000,0x00000005c5800000:Old
>>>> Region: 0x00000005c5800000,0x00000005c5a00000,0x00000005c5a00000:Old
>>>> Region: 0x00000005c5a00000,0x00000005c5c00000,0x00000005c5c00000:Old
>>>> Region: 0x00000005c5c00000,0x00000005c5c00000,0x00000005c5e00000:Free
>>>> Region: 0x00000005c5e00000,0x00000005c5e00000,0x00000005c6000000:Free
>>>> Region: 0x00000005c6000000,0x00000005c6200000,0x00000005c6200000:Old
>>>> ...
>>>>
>>>> The jtreg test at this point does not include any testing for the
>>>> display of archived or pinned regions. The testing for this will be
>>>> added once JDK-8174994 is resolved.
>>>>
>>>> The SA tests pass with jprt and Mach5.
>>>>
>>>> Thanks,
>>>> Jini.
>>
From yasuenag at gmail.com Fri Mar 9 12:12:42 2018
From: yasuenag at gmail.com (Yasumasa Suenaga)
Date: Fri, 9 Mar 2018 21:12:42 +0900
Subject: PING: RFR: JDK-8153333: [REDO] STW phases at Concurrent GC should
count in PerfCounter
In-Reply-To: <1520584868.3872.6.camel@oracle.com>
References:
<2f4e0901-1602-6276-e7fd-84e168e7b317@gmail.com>
<3210723e-c5f9-4277-a97a-be61e10e6b3d@oracle.com>
<89a1a161-874d-4743-e52b-7ab202fd8976@gmail.com>
<9799a2ad-6727-cae9-312b-fd9de13c8203@oracle.com>
<9183dfd3-522f-fd73-a681-5ea957f1d717@gmail.com>
<1520584868.3872.6.camel@oracle.com>
Message-ID:
Hi Thomas,
> - one really minor issue I think: in the description in
> JstatGcCauseResults.java, the descriptions of the new concurrent
> collections, between "GCT" and "Total Garbage collection time." there
> should probably be one space less to align with the "main" gc phase
> times.
>
> - in gcCapacityOutput1.awk, gcNewCapacityOutput1.awk, there are some
> additional newlines (line 10/11).
Thanks!
I will fix them.
Yasumasa
On 2018/03/09 17:41, Thomas Schatzl wrote:
> Hi Yasumasa,
>
> On Wed, 2018-03-07 at 21:18 +0900, Yasumasa Suenaga wrote:
>> PING: Could you review it?
>>
>> http://cr.openjdk.java.net/~ysuenaga/JDK-8153333/webrev.08/
>>
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8153333
>> CSR: https://bugs.openjdk.java.net/browse/JDK-8196862
>>
>> This change has passed Mach5 on submit repo.
>> Also it has passed hotspot/jtreg/:hotspot_serviceability and
>> jdk/:jdk_tools jtreg tests.
>>
>> We need one more reviewer.
>
> - one really minor issue I think: in the description in
> JstatGcCauseResults.java, the descriptions of the new concurrent
> collections, between "GCT" and "Total Garbage collection time." there
> should probably be one space less to align with the "main" gc phase
> times.
>
> - in gcCapacityOutput1.awk, gcNewCapacityOutput1.awk, there are some
> additional newlines (line 10/11).
>
> No need for re-review from me, and for the change in
> JstatGcCauseResults.java I am not completely sure my suggestion is
> good.
>
> Stefan Johansson already mentioned he will sponsor.
>
> Thanks,
> Thomas
>
From erik.osterlund at oracle.com Fri Mar 9 14:36:27 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Fri, 9 Mar 2018 15:36:27 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
Message-ID: <5AA29BEB.3020402@oracle.com>
Hi Roman,
I would love to avoid using the switch to enumerate all different Java
types you could possibly have.
How about this? (was easier to cook something together than explain in
detail what I had in mind)
Webrev:
http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
The idea is to let Access recognize arraycopy with element type "void",
and then perform a conservative byte arraycopy, that when
ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
using Copy::conjoint_memory_atomic().
Thanks,
/Erik
On 2018-03-08 21:12, Roman Kennke wrote:
> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>> Hi Roman,
>>
>> On 2018-03-08 11:25, Roman Kennke wrote:
>>> Wouldn't that lead to mis-aligned accesses when you try to copy an array
>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>> misunderstanding?
>> No it would not. The element type is void, not void*. Because the
>> element type is type erased. And that would map to
>> Copy::conjoint_memory_atomic, which is precisely what typeArrayKlass.cpp
>> maps such an arraycopy to today. Assuming elements are aligned to their
>> natural size (which they are), Copy::conjoint_memory_atomic is
>> guaranteed to be at least as atomic as you need your elements to be, up
>> to an element size of 8.
> Ah, ok. Alright, so here comes rev.02:
>
> Differential:
> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
> Full:
> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>
> Still passes tier1 tests.
>
> Ok now?
>
> Cheers, Roman
>
>
>>> An idea would be to copy equal-sized elements using the corresponding
>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>> short version, boolean and byte would use the byte version (or is
>>> boolean sometimes int?!), float and int would use the int version and
>>> long and double the long version. WDYT?
>> I'm not sure I see what the advantage of that would be.
>>
>> Thanks,
>> /Erik
>>
>>> Roman
>>>
>>>
>>>> My spontaneous idea was to have an overload for type erased void* that
>>>> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>> element type is.
>>>>
>>>> But if you have better ideas, I am open for suggestions.
>>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>> we can
>>>>>> just as well call typeArrayOop::copy_array() and have it do the right
>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>> Something like:
>>>>>
>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>
>>>>> This wouldn't compile because of bunch of missing
>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>> specific stuff... and my question before I go there is: do we want all
>>>>> that? Or can you think of a better way to solve it?
>>>>>
>>>>> Roman
>>>>>
>>>>>> Roman
>>>>>>
>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the
>>>>>>> size
>>>>>>> of the passed in elements.
>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>> void*,
>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>> overload
>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>> jshort, jint, jlong}.
>>>>>>>
>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>> void*
>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> /Erik
>>>>>>>
>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>> Hi David,
>>>>>>>>>
>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>> comment is
>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>> decorator
>>>>>>>>> should probably be used here.
>>>>>>>> If that code implements a Java array copy then yes it is required to
>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit atomicity?
>>>>>>>>
>>>>>>>> David
>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> /Erik
>>>>>>>>>
>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>> Hi Roman,
>>>>>>>>>>
>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>> but in
>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>> changed
>>>>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> David
>>>>>>>>>>
>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>> not for
>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>>>>> resolve
>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>
>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>> Access API,
>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not
>>>>>>>>>>> take
>>>>>>>>>>> src
>>>>>>>>>>> and dst oop operands, but it's called like that. The only reason
>>>>>>>>>>> why
>>>>>>>>>>> this does not blow up (I think) is that because nobody calls it,
>>>>>>>>>>> the
>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>
>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>> calls into
>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>> cannot be
>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(), which
>>>>>>>>>>> should
>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>
>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>> Java-array <->
>>>>>>>>>>> native-array bulk transfers, which currently use the rather ugly
>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that
>>>>>>>>>>> in a
>>>>>>>>>>> separate change though.
>>>>>>>>>>>
>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>
>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>
>>>>>>>>>>> Please review!
>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>
>
From shade at redhat.com Mon Mar 12 13:12:37 2018
From: shade at redhat.com (Aleksey Shipilev)
Date: Mon, 12 Mar 2018 14:12:37 +0100
Subject: Epsilon GC JEP updates (was: Re: EpsilonGC and throughput.)
In-Reply-To: <1515429904.2381.208.camel@oracle.com>
References: <3d50e13e-3324-7058-3c8c-725a52207074@oracle.com>
<1162631c-1ebc-f562-f096-d1ac861a42a4@redhat.com>
<37071ceb-d21b-cf96-2dea-87da409b2e68@oracle.com>
<1513781182.2415.29.camel@oracle.com>
<07b29153-f01f-f1b5-18bc-9c38caaaf7eb@redhat.com>
<1513805149.2542.112.camel@oracle.com>
<304ef832-5e17-b53e-8b31-7c26fcb8c593@redhat.com>
<1515429904.2381.208.camel@oracle.com>
Message-ID:
Hey Thomas,
Updated the JEP here:
https://bugs.openjdk.java.net/browse/JDK-8174901
On 01/08/2018 05:45 PM, Thomas Schatzl wrote:
> I apologize for my somewhat inappropriate words, this has been due to
> some frustration; also for the long delay that were due to the winter
> holidays.
It took me quite some time to recover from this, and I am still slightly bitter. If we want
contributions to OpenJDK, then we all have to understand this kind of thing really dissuades people
from contributing. I have got quite a few personal "raised eyebrows" replies on this, one person
calling the whole thing right away hostile.
I can imagine much less thick-skinned contributors just walking away. I know the intent wasn't that,
but what matters here is not the intent, but the appearance too (I fell into the same trap before
numerous times, and learned to keep it together -- call this thread a karmic justice).
> It also helps if the JEP is written in a way to make it interesting for
> the community to read it, and respond. The less thinking a reader has
> to do to answer whether he is impacted or not, and whether and by how
> much it would simplify the life of himself or in general Java users,
> the more people will feel urged to get this in (or at least not
> deterred).
Come to think about it, the public discussion this JEP is getting is positive, and there is no need
to urge more people to get it in at this point. Lots of people read it, and surprisingly quite a lot
of them tried the prototype, at least for fun, but also for performance work too.
> "Motivation
> ----------
> JEP text: "Java implementations are well known for a broad choice of
> highly configurable GC implementations."
>
> Potential answer to "Why should this work be done?". Or does the
> sentence indicate we need another GC because we already have so many,
> and another does not hurt? I am asking this in full seriousness, I
> really do not know. Or is this only an introductory sentence without
> meaning?
This statement underpins there is no single all-purpose GC in OpenJDK.
"The variety of available collectors caters for different needs in the end, even if their
configurability make their functionality intersect. It is sometimes easier to maintain a separate
implementation, rather than piling on another configuration option on the existing GC implementation."
> Let's go into these benefits in more detail:
>
> JEP text: "Performance testing. ..."
>
> Benefit. Maybe it would be useful to list a few of these performance
> artifacts here ("... , e.g. barrier code, concurrent threads").
I added some. We (in Shenandoah development land), and others (in Shenandoah/ZGC/Zing comparison
land) have used Epsilon as the ultimate latency baseline. New text captures that bit:
"Having a GC that does almost nothing is a useful tool to do differential performance analysis for
other, real GCs. Having a no-op GC can help to filter out GC-induced performance artifacts, like GC
workers scheduling, GC barriers costs, GC cycles triggered at unfortunate times, locality changes,
etc. Moreover, there are latency artifacts that are not GC-induced (e.g. scheduling hiccups,
compiler transition hiccups, etc), and removing the GC-induced artifacts help to contrast those. For
example, having the no-op GC allows to estimate the natural "background" latency baseline for
low-latency GC work."
> An alternative could be a developer just nop'ing out the relevant GC
> interface section. That is somewhat cumbersome, but for how many users
> is this a problem? Spell that out in the appropriate Alternatives
> section.
Spelled: "The developers might just no-op out the existing GC implementation to get the baseline
implementation for testing. The problem with this is inconvenience: the developers would need to
make sure such the implementation is still correct, that it provides enough performance to be a good
baseline, that it is hooked up into the other runtime facilities (heap dumping, thread stack
walking, MXBeans) to amend the differential analysis. The implementations for other platforms would
require much more work. Having the ready-to-go no-op implementation in the mainline solves this
inconvenience."
> JEP text: "Functional testing. For Java code testing, a way to
> establish a threshold for allocated memory is useful to assert memory
> pressure invariants. Today, we have to pick up the allocation data from
> MXBeans, or even resort to parsing GC logs. Having a GC that accepts
> only the bounded number of allocations, and fails on heap exhaustion,
> simplifies testing."
>
> Benefit. For regression testing, in how many cases do you think it is
> sufficient (or in what circumstances) to get a fail/no-fail answer
> only?
> This seems to pass work on a failure to the dev, them needing to write
> another test that also prints and monitors the memory usage increases
> over time anyway.
> How much work, given that you already need to monitor memory usage is
> the test to fail when heap usage goes above a threshold then?
I don't quite believe debugging the test like this would involve tracking the memory allocated so
far, because that is not readily actionable. Even if it is, Epsilon prints the messages when n% of
the heap was allocated, which actually improves developer's experience, because as a dev I don't
need to copy-paste MXBeans blocks anymore.
But what is more actionable is the actual heap dump. And this is where Epsilon comes handy: you just
set -Xmx1g -XX:HeapDumpOnOutOfMemoryError, and run the test. If the test fails, you get the ready
heap dump that tell you what the test had ever allocated to blow the allocation limit, down to every
single object.
I added the example: "For example, knowing that test should allocate no more than 1 GB of memory, we
can configure no-op GC with -Xmx1g, and let it crash with a heap dump if that constraint is violated."
> "VM interface testing. For VM development purposes, having a simple GC
> helps to understand the absolute minimum required from the VM-GC
> interface to have a functional allocator. This serves as proof that the
> VM-GC interface is sane, which is important in lieu of JEP 304
> ("Garbage Collector Interface")."
>
> Benefit. Who are the (main) benefactors for that - probably developers?
> For a developer, how much is that benefit if there are already 5 or 6
> implementations of that interface?
The benefit is simple: for no-op GC, the implemented GC interface should be in epsilon-neighborhood
of zero. It is not right now, by the way, in both native and codegen parts:
https://builds.shipilev.net/patch-openjdk-epsilon-jdk/
I added: "For no-op GC, the interface should not have anything implemented, and good interface means
Epsilon's BarrierSet would just use no-op barrier implementations from the default implementation".
> "Last-drop performance improvements. For ultra-latency-sensitive
> applications, where developers are conscious about memory allocations
> and know the application memory footprint exactly, or even have
> (almost) completely garbage-free applications. In those applications,
> GC cycles may be considered an implementation bug that wastes CPU
> cycles for no good reason."
I split this section in three: "Extremely short lived jobs", "Last-drop latency improvements", and
"Last-drop throughput improvements", because it seems more logical that way.
> It may be useful to investigate the problem of these power users in
> more detail, and see if we could provide a (more?) complete solution
> for them.
The problem with this is, those power users consider whatever tricks they managed to tame the
misbehaving GC their competitive advantage (think HFT), and are not really inclined to share. (Some
did not manage, and they moved out of Java, to our disadvantage). The bits and pieces I got are
"give us the no-op GC, and we shall figure out how to manage our memory ourselves, thank you very
much". And in many cases, from the little glimpses that were shared behind the curtains, those guys
seem to really know what they doing. All I'm saying here is that we have no alternative than to take
it on faith, which I am willing to do.
> "Extremely short lived jobs are one example of this."
>
> I do not understand the use of Epsilon in such use case. The
> alternative I can see would be to restart the VM after every short
> lived job (something for the Alternatives section). That seems strange
> to me, depending on the definition of a "short lived job", particularly
> if nothing survives after execution of that short lived job, a GC will
> be extremely fast.
This relies on per-supposition that GC is fast, because heap is a graveyard. It is not always the case.
I have demonstrated one example:
http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2017-December/021042.html
Added: "A short-lived job might rely on exiting quickly to free the resources (e.g. heap memory). In
this case, accepting the GC cycle to futilely clean up the heap is a waste of time, because the heap
would be freed on exit anyway. Note that the GC cycle might take a while, because it would depend on
the amount of live data in the heap, which can be a lot."
> "There are also cases when restarting the JVM -- letting load balancers
> figure out failover -- is sometimes a better recovery strategy than
> accepting a GC cycle."
>
> I really can't find a good example where a GC, particularly in the
> situation that has been described so far, also for these short-lived
> jobs, where a GC (on an almost empty heap) is not at least as fast as a
> restart.
Again, this relies on per-supposition that GC is fast, because heap is a graveyard. It is, again,
not always the case.
The real-world systems I know of, the latency of node restart does not matter as much: it is more
important to reliably fail the node to let balancer act. In other words, the "global"
detect-and-evade latency is more important than "local" restart latency.
Accepting the GC cycle makes the availability logic harder: you now have to disambiguate between the
normal 100ms execution in the business logic, and the first 100ms of multi-second GC pause. Which
probably means timeout to be several-sigma larger than the usual business logic wait time, which
prolongs the recovery. Instead, you might just crash, and let balancer figure out where to restart
the processing right away.
I understand this goes against our own intuition how the systems should be built. Of course, we want
our GCs to never push users to come up with these contraptions, but the sad reality is that they are
doing that, because the world and GC implementations in this world are not perfect.
And you would not find that in our spectrum of well-behaved workloads. Talking to people who
maintain large real-world systems can be sobering for understanding what they have to deal with. For
example, one customer asked me to come up with this contraption for their high-availability
in-memory grid -- they are ready for JVM to crash, and it fact they would like it to crash instead
of stalling!
https://bugs.openjdk.java.net/browse/JDK-8181143
> It would make for a very good paragraph explaining this use case in the
> alternatives section.
>
> Another problem with these two sentences to me is (and I am by no means
> a "FaaS power user") that I believe that waiting for the VM to
> crash/shut down to steer the load balancers is not a good strategy.
> Maybe you can give some more information about this use case?
JEP does not advocate for using this strategy. It just reports what users are doing in the wild. So,
discussion around this seems to go outside the scope of the JEP.
> In the earlier email I only directly asked for performance numbers
> because in order to streamline this discussion, and given that you are
> a well-known performance and benchmark guru (afaik you were "R"eviewer
> long before me joining) it seemed a logical request. If you can't find
> numbers, there is also the reference ("Barriers, Friendlier Still" or
> so from Blackburn et al I think) I got that is also mentioned iirc in
> the very good Jones GC book.
> "Real" newbies I would just ask to perform this test.
See here:
https://shipilev.net/jvm-anatomy-park/13-intergenerational-barriers/
I considered it a bad taste to link my blog to the JEP, but I can do this anyway.
> "Alternatives
> ------------
> Again, try to make these alternative review balanced, and in context of
> the users the benefit is for.
I have rewritten that part with most things we have discussed, and tried to discuss why those
alternatives are not exactly better. I might still be missing some salient alternatives, because I
ran out of steam...
Thanks,
-Aleksey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL:
From erik.helin at oracle.com Mon Mar 12 13:07:21 2018
From: erik.helin at oracle.com (Erik Helin)
Date: Mon, 12 Mar 2018 14:07:21 +0100
Subject: RFR: 8199027: Make protected members private in G1Policy
Message-ID: <01235743-3518-3d21-2a6b-8af7d5a7ef98@oracle.com>
Hi all,
this tiny patch removes the (unnecessary) use of `protected` visibility
from the class G1Policy, the members that were protected can just be
private.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8199027
Patch:
http://cr.openjdk.java.net/~ehelin/8199027/00/
Testing:
- make run-test-tier1
Thanks,
Erik
From stefan.johansson at oracle.com Mon Mar 12 13:44:19 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 12 Mar 2018 14:44:19 +0100
Subject: RFR: 8199027: Make protected members private in G1Policy
In-Reply-To: <01235743-3518-3d21-2a6b-8af7d5a7ef98@oracle.com>
References: <01235743-3518-3d21-2a6b-8af7d5a7ef98@oracle.com>
Message-ID: <08517c41-ba15-e176-82d2-71b01c08ac34@oracle.com>
Looks good,
StefanJ
On 2018-03-12 14:07, Erik Helin wrote:
> Hi all,
>
> this tiny patch removes the (unnecessary) use of `protected`
> visibility from the class G1Policy, the members that were protected
> can just be private.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8199027
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8199027/00/
>
> Testing:
> - make run-test-tier1
>
> Thanks,
> Erik
From stefan.johansson at oracle.com Mon Mar 12 15:22:33 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 12 Mar 2018 16:22:33 +0100
Subject: RFR: JDK-8175312: SA: clhsdb: Provide an improved heap summary
for 'universe' for G1GC
In-Reply-To:
References:
<38d71740-0b66-3ce8-26ed-a0f2b9f9e91c@oracle.com>
<5e8c582e-b32f-daf7-0e0c-1e6606ceaf3a@oracle.com>
Message-ID: <59c7ec4f-f9dc-7c25-e7bf-f3fc304b5c60@oracle.com>
Hi Jini,
This looks good. I'm totally fine with skipping metaspace if that isn't
displayed for the other GCs.
Cheers,
Stefan
On 2018-03-09 10:29, Jini George wrote:
> Here is the revised webrev:
>
> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.02/
>
> I have made modifications to have the 'universe' command display
> details like:
>
> hsdb> universe
> Heap Parameters:
> garbage-first heap [0x0000000725200000, 0x00000007c0000000] region
> size 1024K
> G1 Heap:
> ?? regions? = 2478
> ?? capacity = 2598371328 (2478.0MB)
> ?? used???? = 5242880 (5.0MB)
> ?? free???? = 2593128448 (2473.0MB)
> ?? 0.20177562550443906% used
> G1 Young Generation:
> Eden Space:
> ?? regions? = 5
> ?? capacity = 8388608 (8.0MB)
> ?? used???? = 5242880 (5.0MB)
> ?? free???? = 3145728 (3.0MB)
> ?? 62.5% used
> Survivor Space:
> ?? regions? = 0
> ?? capacity = 0 (0.0MB)
> ?? used???? = 0 (0.0MB)
> ?? free???? = 0 (0.0MB)
> ?? 0.0% used
> G1 Old Generation:
> ?? regions? = 0
> ?? capacity = 155189248 (148.0MB)
> ?? used???? = 0 (0.0MB)
> ?? free???? = 155189248 (148.0MB)
> ?? 0.0% used
>
>
> I did not add the metaspace details since that did not seem to be in
> line with the 'universe' output for other GCs. I have added a new
> command "g1regiondetails" to display the region details, and have
> modified the tests accordingly.
>
> hsdb> g1regiondetails
> Region Details:
> Region: 0x0000000725200000,0x0000000725200000,0x0000000725300000:Free
> Region: 0x0000000725300000,0x0000000725300000,0x0000000725400000:Free
> Region: 0x0000000725400000,0x0000000725400000,0x0000000725500000:Free
> Region: 0x0000000725500000,0x0000000725500000,0x0000000725600000:Free
> Region: 0x0000000725600000,0x0000000725600000,0x0000000725700000:Free
> Region: 0x0000000725700000,0x0000000725700000,0x0000000725800000:Free
> ...
>
> Thanks,
> Jini.
>
>
> On 2/28/2018 12:56 PM, Jini George wrote:
>> Thank you very much, Stefan. My answers inline.
>>
>> On 2/27/2018 3:30 PM, Stefan Johansson wrote:
>>> Hi Jini,
>>
>>>>> JIRA ID:https://bugs.openjdk.java.net/browse/JDK-8175312
>>>>> Webrev:
>>>>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.00/index.html
>>>>>
>>> It looks like a file is missing, did you forget to add it to the
>>> changeset?
>>
>> Indeed, I had missed that! I added the missing file in the following
>> webrev:
>>
>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.01/
>>
>>> ---
>>> open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java:36:
>>> error: cannot find symbol
>>> import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
>>> ---
>>>
>>> Otherwise the change looks good, but I would like to see the output
>>> live. For a big heap this will print a lot of data, just wondering
>>> if the universe command is the correct choice for this kind of
>>> output. I like having the possibility to print all regions, so I
>>> want the change but maybe it should be a different command and
>>> 'universe' just prints a little more than before. Something like our
>>> logging heap-summary at shutdown:
>>> garbage-first heap?? total 16384K, used 3072K [0x00000000ff000000,
>>> 0x0000000100000000)
>>> ??region size 1024K, 4 young (4096K), 0 survivors (0K)
>>> Metaspace?????? used 6731K, capacity 6825K, committed 7040K,
>>> reserved 1056768K
>>> ??class space??? used 559K, capacity 594K, committed 640K, reserved
>>> 1048576K
>>
>> Ok, will add this, and could probably have the region details
>> displayed under a new command called "g1regiondetails", or some such,
>> and send out a new webrev.
>>
>> Thanks,
>> Jini.
>>
>>>
>>> Thanks,
>>> Stefan
>>>>> Modifications have been made to display the regions like:
>>>>>
>>>>> ...
>>>>> Region: 0x00000005c5400000,0x00000005c5600000,0x00000005c5600000:Old
>>>>> Region: 0x00000005c5600000,0x00000005c5800000,0x00000005c5800000:Old
>>>>> Region: 0x00000005c5800000,0x00000005c5a00000,0x00000005c5a00000:Old
>>>>> Region: 0x00000005c5a00000,0x00000005c5c00000,0x00000005c5c00000:Old
>>>>> Region: 0x00000005c5c00000,0x00000005c5c00000,0x00000005c5e00000:Free
>>>>> Region: 0x00000005c5e00000,0x00000005c5e00000,0x00000005c6000000:Free
>>>>> Region: 0x00000005c6000000,0x00000005c6200000,0x00000005c6200000:Old
>>>>> ...
>>>>>
>>>>> The jtreg test at this point does not include any testing for the
>>>>> display of archived or pinned regions. The testing for this will
>>>>> be added once JDK-8174994 is resolved.
>>>>>
>>>>> The SA tests pass with jprt and Mach5.
>>>>>
>>>>> Thanks,
>>>>> Jini.
>>>
From stefan.johansson at oracle.com Mon Mar 12 15:48:30 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 12 Mar 2018 16:48:30 +0100
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
In-Reply-To: <1520523980.3121.29.camel@oracle.com>
References: <1520516013.3121.24.camel@oracle.com>
<7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
<1520523980.3121.29.camel@oracle.com>
Message-ID:
Hi Thomas,
On 2018-03-08 16:46, Thomas Schatzl wrote:
> On Thu, 2018-03-08 at 16:18 +0100, Stefan Johansson wrote:
>> Hi Thomas,
>>
>> On 2018-03-08 14:33, Thomas Schatzl wrote:
>>> Hi,
>>>
>>> with the rebuild remsets concurrently changes the last user of
>>> the gc
>>> time stamps (create live data) has gone away.
>>>
>>> This change removes all of the corresponding code I could find.
>>>
>>> Could you review it?
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8199326
>>> Webrev:
>>> http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
>> Looks like you pasted the wrong link, and I couldn't find the
>> correct
>> one either.
> Sorry. The correct link is:
> http://cr.openjdk.java.net/~tschatzl/8199326/webrev
Thanks for doing this cleanup, I found one more reference to the GC
timestamp in g1CollectedHeap.hpp:
?296?? // Clear RSets after a compaction. It also resets the GC time
stamps.
?297?? void clear_rsets_post_compaction();
You can actually remove those two lines completely if you like. I forgot
the declaration when removing this method in the fix for:
8177544: Restructure G1 Full GC code
Otherwise the change looks good and if you don't want to remove the
declaration in this patch we can create a separate clean up for this.
Cheers,
Stefan
>
> Thomas
>
From jini.george at oracle.com Mon Mar 12 15:52:09 2018
From: jini.george at oracle.com (Jini George)
Date: Mon, 12 Mar 2018 21:22:09 +0530
Subject: RFR: JDK-8175312: SA: clhsdb: Provide an improved heap summary
for 'universe' for G1GC
In-Reply-To: <59c7ec4f-f9dc-7c25-e7bf-f3fc304b5c60@oracle.com>
References:
<38d71740-0b66-3ce8-26ed-a0f2b9f9e91c@oracle.com>
<5e8c582e-b32f-daf7-0e0c-1e6606ceaf3a@oracle.com>
<59c7ec4f-f9dc-7c25-e7bf-f3fc304b5c60@oracle.com>
Message-ID:
Thank you very much, Stefan. Could one more reviewer please take a look
at it ?
- Jini.
On 3/12/2018 8:52 PM, Stefan Johansson wrote:
> Hi Jini,
>
> This looks good. I'm totally fine with skipping metaspace if that isn't
> displayed for the other GCs.
>
> Cheers,
> Stefan
>
> On 2018-03-09 10:29, Jini George wrote:
>> Here is the revised webrev:
>>
>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.02/
>>
>> I have made modifications to have the 'universe' command display
>> details like:
>>
>> hsdb> universe
>> Heap Parameters:
>> garbage-first heap [0x0000000725200000, 0x00000007c0000000] region
>> size 1024K
>> G1 Heap:
>> ?? regions? = 2478
>> ?? capacity = 2598371328 (2478.0MB)
>> ?? used???? = 5242880 (5.0MB)
>> ?? free???? = 2593128448 (2473.0MB)
>> ?? 0.20177562550443906% used
>> G1 Young Generation:
>> Eden Space:
>> ?? regions? = 5
>> ?? capacity = 8388608 (8.0MB)
>> ?? used???? = 5242880 (5.0MB)
>> ?? free???? = 3145728 (3.0MB)
>> ?? 62.5% used
>> Survivor Space:
>> ?? regions? = 0
>> ?? capacity = 0 (0.0MB)
>> ?? used???? = 0 (0.0MB)
>> ?? free???? = 0 (0.0MB)
>> ?? 0.0% used
>> G1 Old Generation:
>> ?? regions? = 0
>> ?? capacity = 155189248 (148.0MB)
>> ?? used???? = 0 (0.0MB)
>> ?? free???? = 155189248 (148.0MB)
>> ?? 0.0% used
>>
>>
>> I did not add the metaspace details since that did not seem to be in
>> line with the 'universe' output for other GCs. I have added a new
>> command "g1regiondetails" to display the region details, and have
>> modified the tests accordingly.
>>
>> hsdb> g1regiondetails
>> Region Details:
>> Region: 0x0000000725200000,0x0000000725200000,0x0000000725300000:Free
>> Region: 0x0000000725300000,0x0000000725300000,0x0000000725400000:Free
>> Region: 0x0000000725400000,0x0000000725400000,0x0000000725500000:Free
>> Region: 0x0000000725500000,0x0000000725500000,0x0000000725600000:Free
>> Region: 0x0000000725600000,0x0000000725600000,0x0000000725700000:Free
>> Region: 0x0000000725700000,0x0000000725700000,0x0000000725800000:Free
>> ...
>>
>> Thanks,
>> Jini.
>>
>>
>> On 2/28/2018 12:56 PM, Jini George wrote:
>>> Thank you very much, Stefan. My answers inline.
>>>
>>> On 2/27/2018 3:30 PM, Stefan Johansson wrote:
>>>> Hi Jini,
>>>
>>>>>> JIRA ID:https://bugs.openjdk.java.net/browse/JDK-8175312
>>>>>> Webrev:
>>>>>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.00/index.html
>>>>>>
>>>> It looks like a file is missing, did you forget to add it to the
>>>> changeset?
>>>
>>> Indeed, I had missed that! I added the missing file in the following
>>> webrev:
>>>
>>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.01/
>>>
>>>> ---
>>>> open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java:36:
>>>> error: cannot find symbol
>>>> import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
>>>> ---
>>>>
>>>> Otherwise the change looks good, but I would like to see the output
>>>> live. For a big heap this will print a lot of data, just wondering
>>>> if the universe command is the correct choice for this kind of
>>>> output. I like having the possibility to print all regions, so I
>>>> want the change but maybe it should be a different command and
>>>> 'universe' just prints a little more than before. Something like our
>>>> logging heap-summary at shutdown:
>>>> garbage-first heap?? total 16384K, used 3072K [0x00000000ff000000,
>>>> 0x0000000100000000)
>>>> ??region size 1024K, 4 young (4096K), 0 survivors (0K)
>>>> Metaspace?????? used 6731K, capacity 6825K, committed 7040K,
>>>> reserved 1056768K
>>>> ??class space??? used 559K, capacity 594K, committed 640K, reserved
>>>> 1048576K
>>>
>>> Ok, will add this, and could probably have the region details
>>> displayed under a new command called "g1regiondetails", or some such,
>>> and send out a new webrev.
>>>
>>> Thanks,
>>> Jini.
>>>
>>>>
>>>> Thanks,
>>>> Stefan
>>>>>> Modifications have been made to display the regions like:
>>>>>>
>>>>>> ...
>>>>>> Region: 0x00000005c5400000,0x00000005c5600000,0x00000005c5600000:Old
>>>>>> Region: 0x00000005c5600000,0x00000005c5800000,0x00000005c5800000:Old
>>>>>> Region: 0x00000005c5800000,0x00000005c5a00000,0x00000005c5a00000:Old
>>>>>> Region: 0x00000005c5a00000,0x00000005c5c00000,0x00000005c5c00000:Old
>>>>>> Region: 0x00000005c5c00000,0x00000005c5c00000,0x00000005c5e00000:Free
>>>>>> Region: 0x00000005c5e00000,0x00000005c5e00000,0x00000005c6000000:Free
>>>>>> Region: 0x00000005c6000000,0x00000005c6200000,0x00000005c6200000:Old
>>>>>> ...
>>>>>>
>>>>>> The jtreg test at this point does not include any testing for the
>>>>>> display of archived or pinned regions. The testing for this will
>>>>>> be added once JDK-8174994 is resolved.
>>>>>>
>>>>>> The SA tests pass with jprt and Mach5.
>>>>>>
>>>>>> Thanks,
>>>>>> Jini.
>>>>
>
From yumin.qi at gmail.com Tue Mar 13 00:54:44 2018
From: yumin.qi at gmail.com (yumin qi)
Date: Mon, 12 Mar 2018 17:54:44 -0700
Subject: RFR: JDK-8175312: SA: clhsdb: Provide an improved heap summary
for 'universe' for G1GC
In-Reply-To:
References:
<38d71740-0b66-3ce8-26ed-a0f2b9f9e91c@oracle.com>
<5e8c582e-b32f-daf7-0e0c-1e6606ceaf3a@oracle.com>
<59c7ec4f-f9dc-7c25-e7bf-f3fc304b5c60@oracle.com>
Message-ID:
Jini,
Looks good. One minor comment:
+ public void printG1HeapSummary(G1CollectedHeap heap) {+
G1CollectedHeap g1h = (G1CollectedHeap) heap;
'heap' has been cast to 'G1CollectedHeap' at call site, so seems no need
to convert here again.
Thanks
Yumin
On Mon, Mar 12, 2018 at 8:52 AM, Jini George wrote:
> Thank you very much, Stefan. Could one more reviewer please take a look at
> it ?
>
> - Jini.
>
>
> On 3/12/2018 8:52 PM, Stefan Johansson wrote:
>
>> Hi Jini,
>>
>> This looks good. I'm totally fine with skipping metaspace if that isn't
>> displayed for the other GCs.
>>
>> Cheers,
>> Stefan
>>
>> On 2018-03-09 10:29, Jini George wrote:
>>
>>> Here is the revised webrev:
>>>
>>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.02/
>>>
>>> I have made modifications to have the 'universe' command display details
>>> like:
>>>
>>> hsdb> universe
>>> Heap Parameters:
>>> garbage-first heap [0x0000000725200000, 0x00000007c0000000] region size
>>> 1024K
>>> G1 Heap:
>>> regions = 2478
>>> capacity = 2598371328 (2478.0MB)
>>> used = 5242880 (5.0MB)
>>> free = 2593128448 (2473.0MB)
>>> 0.20177562550443906% used
>>> G1 Young Generation:
>>> Eden Space:
>>> regions = 5
>>> capacity = 8388608 (8.0MB)
>>> used = 5242880 (5.0MB)
>>> free = 3145728 (3.0MB)
>>> 62.5% used
>>> Survivor Space:
>>> regions = 0
>>> capacity = 0 (0.0MB)
>>> used = 0 (0.0MB)
>>> free = 0 (0.0MB)
>>> 0.0% used
>>> G1 Old Generation:
>>> regions = 0
>>> capacity = 155189248 (148.0MB)
>>> used = 0 (0.0MB)
>>> free = 155189248 (148.0MB)
>>> 0.0% used
>>>
>>>
>>> I did not add the metaspace details since that did not seem to be in
>>> line with the 'universe' output for other GCs. I have added a new command
>>> "g1regiondetails" to display the region details, and have modified the
>>> tests accordingly.
>>>
>>> hsdb> g1regiondetails
>>> Region Details:
>>> Region: 0x0000000725200000,0x0000000725200000,0x0000000725300000:Free
>>> Region: 0x0000000725300000,0x0000000725300000,0x0000000725400000:Free
>>> Region: 0x0000000725400000,0x0000000725400000,0x0000000725500000:Free
>>> Region: 0x0000000725500000,0x0000000725500000,0x0000000725600000:Free
>>> Region: 0x0000000725600000,0x0000000725600000,0x0000000725700000:Free
>>> Region: 0x0000000725700000,0x0000000725700000,0x0000000725800000:Free
>>> ...
>>>
>>> Thanks,
>>> Jini.
>>>
>>>
>>> On 2/28/2018 12:56 PM, Jini George wrote:
>>>
>>>> Thank you very much, Stefan. My answers inline.
>>>>
>>>> On 2/27/2018 3:30 PM, Stefan Johansson wrote:
>>>>
>>>>> Hi Jini,
>>>>>
>>>>
>>>> JIRA ID:https://bugs.openjdk.java.net/browse/JDK-8175312
>>>>>>> Webrev: http://cr.openjdk.java.net/~jgeorge/8175312/webrev.00/index.
>>>>>>> html
>>>>>>>
>>>>>>> It looks like a file is missing, did you forget to add it to the
>>>>> changeset?
>>>>>
>>>>
>>>> Indeed, I had missed that! I added the missing file in the following
>>>> webrev:
>>>>
>>>> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.01/
>>>>
>>>> ---
>>>>> open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java:36:
>>>>> error: cannot find symbol
>>>>> import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
>>>>> ---
>>>>>
>>>>> Otherwise the change looks good, but I would like to see the output
>>>>> live. For a big heap this will print a lot of data, just wondering if the
>>>>> universe command is the correct choice for this kind of output. I like
>>>>> having the possibility to print all regions, so I want the change but maybe
>>>>> it should be a different command and 'universe' just prints a little more
>>>>> than before. Something like our logging heap-summary at shutdown:
>>>>> garbage-first heap total 16384K, used 3072K [0x00000000ff000000,
>>>>> 0x0000000100000000)
>>>>> region size 1024K, 4 young (4096K), 0 survivors (0K)
>>>>> Metaspace used 6731K, capacity 6825K, committed 7040K, reserved
>>>>> 1056768K
>>>>> class space used 559K, capacity 594K, committed 640K, reserved
>>>>> 1048576K
>>>>>
>>>>
>>>> Ok, will add this, and could probably have the region details displayed
>>>> under a new command called "g1regiondetails", or some such, and send out a
>>>> new webrev.
>>>>
>>>> Thanks,
>>>> Jini.
>>>>
>>>>
>>>>> Thanks,
>>>>> Stefan
>>>>>
>>>>>> Modifications have been made to display the regions like:
>>>>>>>
>>>>>>> ...
>>>>>>> Region: 0x00000005c5400000,0x00000005c5600000,0x00000005c5600000:Old
>>>>>>> Region: 0x00000005c5600000,0x00000005c5800000,0x00000005c5800000:Old
>>>>>>> Region: 0x00000005c5800000,0x00000005c5a00000,0x00000005c5a00000:Old
>>>>>>> Region: 0x00000005c5a00000,0x00000005c5c00000,0x00000005c5c00000:Old
>>>>>>> Region: 0x00000005c5c00000,0x00000005c5c00000,0x00000005c5e00000:
>>>>>>> Free
>>>>>>> Region: 0x00000005c5e00000,0x00000005c5e00000,0x00000005c6000000:
>>>>>>> Free
>>>>>>> Region: 0x00000005c6000000,0x00000005c6200000,0x00000005c6200000:Old
>>>>>>> ...
>>>>>>>
>>>>>>> The jtreg test at this point does not include any testing for the
>>>>>>> display of archived or pinned regions. The testing for this will be added
>>>>>>> once JDK-8174994 is resolved.
>>>>>>>
>>>>>>> The SA tests pass with jprt and Mach5.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Jini.
>>>>>>>
>>>>>>
>>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From rkennke at redhat.com Tue Mar 13 10:02:38 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 13 Mar 2018 11:02:38 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <5AA29BEB.3020402@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
Message-ID: <0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
Hi Erik,
thanks for doing this! It looks good to me!
I'm putting this up here again, with commit msg fixed:
http://cr.openjdk.java.net/~rkennke/8198445/webrev.03/
Can I get (final?) reviews? And then I'd put it through the new submit
repo and push it?
Thanks, Roman
> Hi Roman,
>
> I would love to avoid using the switch to enumerate all different Java
> types you could possibly have.
> How about this? (was easier to cook something together than explain in
> detail what I had in mind)
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
>
> The idea is to let Access recognize arraycopy with element type "void",
> and then perform a conservative byte arraycopy, that when
> ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
> using Copy::conjoint_memory_atomic().
>
> Thanks,
> /Erik
>
> On 2018-03-08 21:12, Roman Kennke wrote:
>> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>>> Hi Roman,
>>>
>>> On 2018-03-08 11:25, Roman Kennke wrote:
>>>> Wouldn't that lead to mis-aligned accesses when you try to copy an
>>>> array
>>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>>> misunderstanding?
>>> No it would not. The element type is void, not void*. Because the
>>> element type is type erased. And that would map to
>>> Copy::conjoint_memory_atomic, which is precisely what typeArrayKlass.cpp
>>> maps such an arraycopy to today. Assuming elements are aligned to their
>>> natural size (which they are), Copy::conjoint_memory_atomic is
>>> guaranteed to be at least as atomic as you need your elements to be, up
>>> to an element size of 8.
>> Ah, ok. Alright, so here comes rev.02:
>>
>> Differential:
>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
>> Full:
>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>>
>> Still passes tier1 tests.
>>
>> Ok now?
>>
>> Cheers, Roman
>>
>>
>>>> An idea would be to copy equal-sized elements using the corresponding
>>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>>> short version, boolean and byte would use the byte version (or is
>>>> boolean sometimes int?!), float and int would use the int version and
>>>> long and double the long version. WDYT?
>>> I'm not sure I see what the advantage of that would be.
>>>
>>> Thanks,
>>> /Erik
>>>
>>>> Roman
>>>>
>>>>
>>>>> My spontaneous idea was to have an overload for type erased void* that
>>>>> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
>>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>>> element type is.
>>>>>
>>>>> But if you have better ideas, I am open for suggestions.
>>>>>
>>>>> Thanks,
>>>>> /Erik
>>>>>
>>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>>> we can
>>>>>>> just as well call typeArrayOop::copy_array() and have it do the
>>>>>>> right
>>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>>> Something like:
>>>>>>
>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>>
>>>>>> This wouldn't compile because of bunch of missing
>>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>>> specific stuff... and my question before I go there is: do we want
>>>>>> all
>>>>>> that? Or can you think of a better way to solve it?
>>>>>>
>>>>>> Roman
>>>>>>
>>>>>>> Roman
>>>>>>>
>>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the
>>>>>>>> size
>>>>>>>> of the passed in elements.
>>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>>> void*,
>>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>>> overload
>>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>>> jshort, jint, jlong}.
>>>>>>>>
>>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>>> void*
>>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> /Erik
>>>>>>>>
>>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>>> Hi David,
>>>>>>>>>>
>>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>>> comment is
>>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>>> decorator
>>>>>>>>>> should probably be used here.
>>>>>>>>> If that code implements a Java array copy then yes it is
>>>>>>>>> required to
>>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit
>>>>>>>>> atomicity?
>>>>>>>>>
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> /Erik
>>>>>>>>>>
>>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>>> Hi Roman,
>>>>>>>>>>>
>>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>>> but in
>>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>>> changed
>>>>>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> David
>>>>>>>>>>>
>>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>>> not for
>>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>>>>>> resolve
>>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>>
>>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>>> Access API,
>>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not
>>>>>>>>>>>> take
>>>>>>>>>>>> src
>>>>>>>>>>>> and dst oop operands, but it's called like that. The only
>>>>>>>>>>>> reason
>>>>>>>>>>>> why
>>>>>>>>>>>> this does not blow up (I think) is that because nobody calls
>>>>>>>>>>>> it,
>>>>>>>>>>>> the
>>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>>
>>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>>> calls into
>>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>>> cannot be
>>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(),
>>>>>>>>>>>> which
>>>>>>>>>>>> should
>>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>>
>>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>>> Java-array <->
>>>>>>>>>>>> native-array bulk transfers, which currently use the rather
>>>>>>>>>>>> ugly
>>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that
>>>>>>>>>>>> in a
>>>>>>>>>>>> separate change though.
>>>>>>>>>>>>
>>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>>
>>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>>
>>>>>>>>>>>> Please review!
>>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From martin.doerr at sap.com Tue Mar 13 10:33:55 2018
From: martin.doerr at sap.com (Doerr, Martin)
Date: Tue, 13 Mar 2018 10:33:55 +0000
Subject: RFR(S): 8198510: Enable UseDynamicNumberOfGCThreads by default
In-Reply-To: <23a06a29-d8c1-3f85-06be-93a8ca5380a7@oracle.com>
References: <96da428b596e4a729612b32415d2ed11@sap.com>
<23a06a29-d8c1-3f85-06be-93a8ca5380a7@oracle.com>
Message-ID:
Hi,
thank you very much for testing, reviewing and approving the CSR.
I've pushed it.
Best regards,
Martin
From: hotspot-gc-dev [mailto:hotspot-gc-dev-bounces at openjdk.java.net] On Behalf Of Stefan Johansson
Sent: Mittwoch, 7. M?rz 2018 10:29
To: hotspot-gc-dev at openjdk.java.net
Subject: Re: RFR(S): 8198510: Enable UseDynamicNumberOfGCThreads by default
Hi Martin,
On 2018-03-06 15:37, Doerr, Martin wrote:
Hi,
I'd like to solve the problem that an unnecessarily high number of GC threads get started in some situations. This wastes resources.
The proposal is to enable the existing flag UseDynamicNumberOfGCThreads by default.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8198510
CSR:
https://bugs.openjdk.java.net/browse/JDK-8198547
Webrev:
http://cr.openjdk.java.net/~mdoerr/8198510_gc_threads/webrev.01/
Change looks good and I also reviewed the CSR. So feel free to move it to proposed (or finalized if you want to fast-track it).
Thanks,
Stefan
Please review.
Thanks and best regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From per.liden at oracle.com Tue Mar 13 10:48:04 2018
From: per.liden at oracle.com (Per Liden)
Date: Tue, 13 Mar 2018 11:48:04 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
<0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
Message-ID:
Looks good to me.
(Erik and I discussed removing Runtime1::arraycopy() completely, and let
those few platforms that doesn't implement this in C1 fall back to the
VM implementation instead, but let's take that as a separate RFE).
/Per
On 03/13/2018 11:02 AM, Roman Kennke wrote:
> Hi Erik,
>
> thanks for doing this! It looks good to me!
>
> I'm putting this up here again, with commit msg fixed:
> http://cr.openjdk.java.net/~rkennke/8198445/webrev.03/
>
> Can I get (final?) reviews? And then I'd put it through the new submit
> repo and push it?
>
> Thanks, Roman
>
>
>> Hi Roman,
>>
>> I would love to avoid using the switch to enumerate all different Java
>> types you could possibly have.
>> How about this? (was easier to cook something together than explain in
>> detail what I had in mind)
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
>>
>> The idea is to let Access recognize arraycopy with element type "void",
>> and then perform a conservative byte arraycopy, that when
>> ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
>> using Copy::conjoint_memory_atomic().
>>
>> Thanks,
>> /Erik
>>
>> On 2018-03-08 21:12, Roman Kennke wrote:
>>> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>>>> Hi Roman,
>>>>
>>>> On 2018-03-08 11:25, Roman Kennke wrote:
>>>>> Wouldn't that lead to mis-aligned accesses when you try to copy an
>>>>> array
>>>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>>>> misunderstanding?
>>>> No it would not. The element type is void, not void*. Because the
>>>> element type is type erased. And that would map to
>>>> Copy::conjoint_memory_atomic, which is precisely what typeArrayKlass.cpp
>>>> maps such an arraycopy to today. Assuming elements are aligned to their
>>>> natural size (which they are), Copy::conjoint_memory_atomic is
>>>> guaranteed to be at least as atomic as you need your elements to be, up
>>>> to an element size of 8.
>>> Ah, ok. Alright, so here comes rev.02:
>>>
>>> Differential:
>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
>>> Full:
>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>>>
>>> Still passes tier1 tests.
>>>
>>> Ok now?
>>>
>>> Cheers, Roman
>>>
>>>
>>>>> An idea would be to copy equal-sized elements using the corresponding
>>>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>>>> short version, boolean and byte would use the byte version (or is
>>>>> boolean sometimes int?!), float and int would use the int version and
>>>>> long and double the long version. WDYT?
>>>> I'm not sure I see what the advantage of that would be.
>>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>>> Roman
>>>>>
>>>>>
>>>>>> My spontaneous idea was to have an overload for type erased void* that
>>>>>> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
>>>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>>>> element type is.
>>>>>>
>>>>>> But if you have better ideas, I am open for suggestions.
>>>>>>
>>>>>> Thanks,
>>>>>> /Erik
>>>>>>
>>>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>>>> we can
>>>>>>>> just as well call typeArrayOop::copy_array() and have it do the
>>>>>>>> right
>>>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>>>> Something like:
>>>>>>>
>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>>>
>>>>>>> This wouldn't compile because of bunch of missing
>>>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>>>> specific stuff... and my question before I go there is: do we want
>>>>>>> all
>>>>>>> that? Or can you think of a better way to solve it?
>>>>>>>
>>>>>>> Roman
>>>>>>>
>>>>>>>> Roman
>>>>>>>>
>>>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the
>>>>>>>>> size
>>>>>>>>> of the passed in elements.
>>>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>>>> void*,
>>>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>>>> overload
>>>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>>>> jshort, jint, jlong}.
>>>>>>>>>
>>>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>>>> void*
>>>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> /Erik
>>>>>>>>>
>>>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>>>> Hi David,
>>>>>>>>>>>
>>>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>>>> comment is
>>>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>>>> decorator
>>>>>>>>>>> should probably be used here.
>>>>>>>>>> If that code implements a Java array copy then yes it is
>>>>>>>>>> required to
>>>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit
>>>>>>>>>> atomicity?
>>>>>>>>>>
>>>>>>>>>> David
>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> /Erik
>>>>>>>>>>>
>>>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>>>> Hi Roman,
>>>>>>>>>>>>
>>>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>>>> but in
>>>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>>>> changed
>>>>>>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> David
>>>>>>>>>>>>
>>>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>>>> not for
>>>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>>>>>>> resolve
>>>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>>>
>>>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>>>> Access API,
>>>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not
>>>>>>>>>>>>> take
>>>>>>>>>>>>> src
>>>>>>>>>>>>> and dst oop operands, but it's called like that. The only
>>>>>>>>>>>>> reason
>>>>>>>>>>>>> why
>>>>>>>>>>>>> this does not blow up (I think) is that because nobody calls
>>>>>>>>>>>>> it,
>>>>>>>>>>>>> the
>>>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>>>
>>>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>>>> calls into
>>>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>>>> cannot be
>>>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(),
>>>>>>>>>>>>> which
>>>>>>>>>>>>> should
>>>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>>>
>>>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>>>> Java-array <->
>>>>>>>>>>>>> native-array bulk transfers, which currently use the rather
>>>>>>>>>>>>> ugly
>>>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that
>>>>>>>>>>>>> in a
>>>>>>>>>>>>> separate change though.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>>>
>>>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>>>
>>>>>>>>>>>>> Please review!
>>>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>>>
>>>
>>
>
>
From erik.osterlund at oracle.com Tue Mar 13 10:52:08 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Tue, 13 Mar 2018 11:52:08 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
<0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
Message-ID:
Hi Roman,
Ideally I'd like to get rid of Runtime1::arraycopy. It seems like a
medium slow path of C1 never used by any platforms other than S390 and
PPC, which look like the only platforms that lack a generic arraycopy
stub from the StubRoutines. I think that S390 and PPC could easily just
jump to the C1 arraycopy stub instead and take the slowpath to the
normal native arraycopy that enters through the JNI interface instead.
If the performance of this C1 arraycopy path on S390 and PPC are
crucial, then they should probably implement stubs for it like the other
platforms. If the performance of this is not crucial (I suspect this is
the case), then it should not harm to take the normal entry through JNI
for generic arraycopy using C1.
But I think trying to get rid of that path could be a follow-up RFE instead.
Looks good.
Thanks,
/Erik
On 2018-03-13 11:02, Roman Kennke wrote:
> Hi Erik,
>
> thanks for doing this! It looks good to me!
>
> I'm putting this up here again, with commit msg fixed:
> http://cr.openjdk.java.net/~rkennke/8198445/webrev.03/
>
> Can I get (final?) reviews? And then I'd put it through the new submit
> repo and push it?
>
> Thanks, Roman
>
>
>> Hi Roman,
>>
>> I would love to avoid using the switch to enumerate all different Java
>> types you could possibly have.
>> How about this? (was easier to cook something together than explain in
>> detail what I had in mind)
>>
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
>>
>> The idea is to let Access recognize arraycopy with element type "void",
>> and then perform a conservative byte arraycopy, that when
>> ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
>> using Copy::conjoint_memory_atomic().
>>
>> Thanks,
>> /Erik
>>
>> On 2018-03-08 21:12, Roman Kennke wrote:
>>> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>>>> Hi Roman,
>>>>
>>>> On 2018-03-08 11:25, Roman Kennke wrote:
>>>>> Wouldn't that lead to mis-aligned accesses when you try to copy an
>>>>> array
>>>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>>>> misunderstanding?
>>>> No it would not. The element type is void, not void*. Because the
>>>> element type is type erased. And that would map to
>>>> Copy::conjoint_memory_atomic, which is precisely what typeArrayKlass.cpp
>>>> maps such an arraycopy to today. Assuming elements are aligned to their
>>>> natural size (which they are), Copy::conjoint_memory_atomic is
>>>> guaranteed to be at least as atomic as you need your elements to be, up
>>>> to an element size of 8.
>>> Ah, ok. Alright, so here comes rev.02:
>>>
>>> Differential:
>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
>>> Full:
>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>>>
>>> Still passes tier1 tests.
>>>
>>> Ok now?
>>>
>>> Cheers, Roman
>>>
>>>
>>>>> An idea would be to copy equal-sized elements using the corresponding
>>>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>>>> short version, boolean and byte would use the byte version (or is
>>>>> boolean sometimes int?!), float and int would use the int version and
>>>>> long and double the long version. WDYT?
>>>> I'm not sure I see what the advantage of that would be.
>>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>>> Roman
>>>>>
>>>>>
>>>>>> My spontaneous idea was to have an overload for type erased void* that
>>>>>> when called with ARRAYCOPY_ATOMIC maps to Copy::conjoint_memory_atomic
>>>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>>>> element type is.
>>>>>>
>>>>>> But if you have better ideas, I am open for suggestions.
>>>>>>
>>>>>> Thanks,
>>>>>> /Erik
>>>>>>
>>>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>>>> we can
>>>>>>>> just as well call typeArrayOop::copy_array() and have it do the
>>>>>>>> right
>>>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>>>> Something like:
>>>>>>>
>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>>>
>>>>>>> This wouldn't compile because of bunch of missing
>>>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>>>> specific stuff... and my question before I go there is: do we want
>>>>>>> all
>>>>>>> that? Or can you think of a better way to solve it?
>>>>>>>
>>>>>>> Roman
>>>>>>>
>>>>>>>> Roman
>>>>>>>>
>>>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over the
>>>>>>>>> size
>>>>>>>>> of the passed in elements.
>>>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>>>> void*,
>>>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>>>> overload
>>>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>>>> jshort, jint, jlong}.
>>>>>>>>>
>>>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>>>> void*
>>>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> /Erik
>>>>>>>>>
>>>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>>>> Hi David,
>>>>>>>>>>>
>>>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>>>> comment is
>>>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>>>> decorator
>>>>>>>>>>> should probably be used here.
>>>>>>>>>> If that code implements a Java array copy then yes it is
>>>>>>>>>> required to
>>>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit
>>>>>>>>>> atomicity?
>>>>>>>>>>
>>>>>>>>>> David
>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> /Erik
>>>>>>>>>>>
>>>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>>>> Hi Roman,
>>>>>>>>>>>>
>>>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>>>> but in
>>>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>>>> changed
>>>>>>>>>>>> code need updating - probably deleting. I assume the Access API
>>>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> David
>>>>>>>>>>>>
>>>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>>>> not for
>>>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too, e.g.
>>>>>>>>>>>>> resolve
>>>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>>>
>>>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>>>> Access API,
>>>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does not
>>>>>>>>>>>>> take
>>>>>>>>>>>>> src
>>>>>>>>>>>>> and dst oop operands, but it's called like that. The only
>>>>>>>>>>>>> reason
>>>>>>>>>>>>> why
>>>>>>>>>>>>> this does not blow up (I think) is that because nobody calls
>>>>>>>>>>>>> it,
>>>>>>>>>>>>> the
>>>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>>>
>>>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>>>> calls into
>>>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>>>> cannot be
>>>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(),
>>>>>>>>>>>>> which
>>>>>>>>>>>>> should
>>>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>>>
>>>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>>>> Java-array <->
>>>>>>>>>>>>> native-array bulk transfers, which currently use the rather
>>>>>>>>>>>>> ugly
>>>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address that
>>>>>>>>>>>>> in a
>>>>>>>>>>>>> separate change though.
>>>>>>>>>>>>>
>>>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>>>
>>>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>>>
>>>>>>>>>>>>> Please review!
>>>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>>>
>
From rkennke at redhat.com Tue Mar 13 11:02:28 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 13 Mar 2018 12:02:28 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To:
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
<0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
Message-ID: <39a6ae41-9736-ea0a-99ef-af3e32c772b8@redhat.com>
Hi Erik & Per,
yes, I agree with getting rid of Runtime1::arraycopy(). Let's take it to
another RFE.
Let's try the newfangled submit repo and push (mostly) my first patch :-)
Thanks for reviewing!
Cheer, Roman
> Hi Roman,
>
> Ideally I'd like to get rid of Runtime1::arraycopy. It seems like a
> medium slow path of C1 never used by any platforms other than S390 and
> PPC, which look like the only platforms that lack a generic arraycopy
> stub from the StubRoutines. I think that S390 and PPC could easily just
> jump to the C1 arraycopy stub instead and take the slowpath to the
> normal native arraycopy that enters through the JNI interface instead.
>
> If the performance of this C1 arraycopy path on S390 and PPC are
> crucial, then they should probably implement stubs for it like the other
> platforms. If the performance of this is not crucial (I suspect this is
> the case), then it should not harm to take the normal entry through JNI
> for generic arraycopy using C1.
>
> But I think trying to get rid of that path could be a follow-up RFE
> instead.
>
> Looks good.
>
> Thanks,
> /Erik
>
> On 2018-03-13 11:02, Roman Kennke wrote:
>> Hi Erik,
>>
>> thanks for doing this! It looks good to me!
>>
>> I'm putting this up here again, with commit msg fixed:
>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.03/
>>
>> Can I get (final?) reviews? And then I'd put it through the new submit
>> repo and push it?
>>
>> Thanks, Roman
>>
>>
>>> Hi Roman,
>>>
>>> I would love to avoid using the switch to enumerate all different Java
>>> types you could possibly have.
>>> How about this? (was easier to cook something together than explain in
>>> detail what I had in mind)
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
>>>
>>> The idea is to let Access recognize arraycopy with element type "void",
>>> and then perform a conservative byte arraycopy, that when
>>> ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
>>> using Copy::conjoint_memory_atomic().
>>>
>>> Thanks,
>>> /Erik
>>>
>>> On 2018-03-08 21:12, Roman Kennke wrote:
>>>> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>>>>> Hi Roman,
>>>>>
>>>>> On 2018-03-08 11:25, Roman Kennke wrote:
>>>>>> Wouldn't that lead to mis-aligned accesses when you try to copy an
>>>>>> array
>>>>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>>>>> misunderstanding?
>>>>> No it would not. The element type is void, not void*. Because the
>>>>> element type is type erased. And that would map to
>>>>> Copy::conjoint_memory_atomic, which is precisely what
>>>>> typeArrayKlass.cpp
>>>>> maps such an arraycopy to today. Assuming elements are aligned to
>>>>> their
>>>>> natural size (which they are), Copy::conjoint_memory_atomic is
>>>>> guaranteed to be at least as atomic as you need your elements to
>>>>> be, up
>>>>> to an element size of 8.
>>>> Ah, ok. Alright, so here comes rev.02:
>>>>
>>>> Differential:
>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
>>>> Full:
>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>>>>
>>>> Still passes tier1 tests.
>>>>
>>>> Ok now?
>>>>
>>>> Cheers, Roman
>>>>
>>>>
>>>>>> An idea would be to copy equal-sized elements using the corresponding
>>>>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>>>>> short version, boolean and byte would use the byte version (or is
>>>>>> boolean sometimes int?!), float and int would use the int version and
>>>>>> long and double the long version. WDYT?
>>>>> I'm not sure I see what the advantage of that would be.
>>>>>
>>>>> Thanks,
>>>>> /Erik
>>>>>
>>>>>> Roman
>>>>>>
>>>>>>
>>>>>>> My spontaneous idea was to have an overload for type erased void*
>>>>>>> that
>>>>>>> when called with ARRAYCOPY_ATOMIC maps to
>>>>>>> Copy::conjoint_memory_atomic
>>>>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>>>>> element type is.
>>>>>>>
>>>>>>> But if you have better ideas, I am open for suggestions.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> /Erik
>>>>>>>
>>>>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>>>>> we can
>>>>>>>>> just as well call typeArrayOop::copy_array() and have it do the
>>>>>>>>> right
>>>>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>>>>> Something like:
>>>>>>>>
>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>>>>
>>>>>>>> This wouldn't compile because of bunch of missing
>>>>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>>>>> specific stuff... and my question before I go there is: do we want
>>>>>>>> all
>>>>>>>> that? Or can you think of a better way to solve it?
>>>>>>>>
>>>>>>>> Roman
>>>>>>>>
>>>>>>>>> Roman
>>>>>>>>>
>>>>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over
>>>>>>>>>> the
>>>>>>>>>> size
>>>>>>>>>> of the passed in elements.
>>>>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>>>>> void*,
>>>>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>>>>> overload
>>>>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>>>>> jshort, jint, jlong}.
>>>>>>>>>>
>>>>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>>>>> void*
>>>>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> /Erik
>>>>>>>>>>
>>>>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>>>>> Hi David,
>>>>>>>>>>>>
>>>>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>>>>> comment is
>>>>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>>>>> decorator
>>>>>>>>>>>> should probably be used here.
>>>>>>>>>>> If that code implements a Java array copy then yes it is
>>>>>>>>>>> required to
>>>>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit
>>>>>>>>>>> atomicity?
>>>>>>>>>>>
>>>>>>>>>>> David
>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> /Erik
>>>>>>>>>>>>
>>>>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>>>>> Hi Roman,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>>>>> but in
>>>>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>>>>> changed
>>>>>>>>>>>>> code need updating - probably deleting. I assume the Access
>>>>>>>>>>>>> API
>>>>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> David
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>>>>> not for
>>>>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too,
>>>>>>>>>>>>>> e.g.
>>>>>>>>>>>>>> resolve
>>>>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>>>>> Access API,
>>>>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does
>>>>>>>>>>>>>> not
>>>>>>>>>>>>>> take
>>>>>>>>>>>>>> src
>>>>>>>>>>>>>> and dst oop operands, but it's called like that. The only
>>>>>>>>>>>>>> reason
>>>>>>>>>>>>>> why
>>>>>>>>>>>>>> this does not blow up (I think) is that because nobody calls
>>>>>>>>>>>>>> it,
>>>>>>>>>>>>>> the
>>>>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>>>>> calls into
>>>>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>>>>> cannot be
>>>>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(),
>>>>>>>>>>>>>> which
>>>>>>>>>>>>>> should
>>>>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>>>>> Java-array <->
>>>>>>>>>>>>>> native-array bulk transfers, which currently use the rather
>>>>>>>>>>>>>> ugly
>>>>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address
>>>>>>>>>>>>>> that
>>>>>>>>>>>>>> in a
>>>>>>>>>>>>>> separate change though.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Please review!
>>>>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>>>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From thomas.schatzl at oracle.com Tue Mar 13 13:18:32 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 14:18:32 +0100
Subject: RFR: 8199027: Make protected members private in G1Policy
In-Reply-To: <01235743-3518-3d21-2a6b-8af7d5a7ef98@oracle.com>
References: <01235743-3518-3d21-2a6b-8af7d5a7ef98@oracle.com>
Message-ID: <1520947112.3100.17.camel@oracle.com>
Hi,
On Mon, 2018-03-12 at 14:07 +0100, Erik Helin wrote:
> Hi all,
>
> this tiny patch removes the (unnecessary) use of `protected`
> visibility
> from the class G1Policy, the members that were protected can just be
> private.
>
> Issue:
> https://bugs.openjdk.java.net/browse/JDK-8199027
>
> Patch:
> http://cr.openjdk.java.net/~ehelin/8199027/00/
looks good.
Thomas
From thomas.schatzl at oracle.com Tue Mar 13 13:41:10 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 14:41:10 +0100
Subject: RFR (XXXS): 8199516: Remove dead code overlooked during Full GC work
Message-ID: <1520948470.3100.21.camel@oracle.com>
Hi all,
can I have one review for this trivial change that removes some dead
code found during review of JDK-8199326 as remnants of Full GC
restructuring?
CR:
https://bugs.openjdk.java.net/browse/JDK-8199516
Webrev:
http://cr.openjdk.java.net/~tschatzl/8199516/webrev/
Testing:
local compilation
Thanks,
Thomas
From thomas.schatzl at oracle.com Tue Mar 13 13:42:13 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 14:42:13 +0100
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
In-Reply-To:
References: <1520516013.3121.24.camel@oracle.com>
<7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
<1520523980.3121.29.camel@oracle.com>
Message-ID: <1520948533.3100.22.camel@oracle.com>
Hi,
On Mon, 2018-03-12 at 16:48 +0100, Stefan Johansson wrote:
> Hi Thomas,
> [...]
> >
> > Sorry. The correct link is:
> > http://cr.openjdk.java.net/~tschatzl/8199326/webrev
>
> Thanks for doing this cleanup, I found one more reference to the GC
> timestamp in g1CollectedHeap.hpp:
> 296 // Clear RSets after a compaction. It also resets the GC
> time stamps.
> 297 void clear_rsets_post_compaction();
>
> You can actually remove those two lines completely if you like. I
> forgot the declaration when removing this method in the fix for:
> 8177544: Restructure G1 Full GC code
>
> Otherwise the change looks good and if you don't want to remove the
> declaration in this patch we can create a separate clean up for this.
>
thanks for your review. I posted a webrev for the removal of this
code as imho it does not completely fit here.
Thanks,
Thomas
From thomas.schatzl at oracle.com Tue Mar 13 13:52:33 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 14:52:33 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <0cd6cca6-cace-4e4f-7f9c-152e20757dfe@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
<8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
<1520412521.2346.4.camel@oracle.com>
<0cd6cca6-cace-4e4f-7f9c-152e20757dfe@oracle.com>
Message-ID: <1520949153.3100.27.camel@oracle.com>
Hi Stefan,
On Wed, 2018-03-07 at 11:12 +0100, Stefan Johansson wrote:
> Thanks Thomas,
>
> This looks good to me, reviewed.
thanks for your review; unfortunately rebasing the changes to latest
caused some additional work.
In this particular case, contents of g1RegionMarkStatsCache had to be
distributed to .cpp and .inline.hpp files (recent .inline.hpp include
fixes), and I preemptively removed the use of one VALUE_OBJ_CLASS_SPEC.
Webrevs:
http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1_to_2/index.html
(diff)
http://cr.openjdk.java.net/~tschatzl/8197850/webrev.2/index.html (full)
Testing:
hs-tier 1-5
Thanks,
Thomas
>
> Stefan
>
> On 2018-03-07 09:48, Thomas Schatzl wrote:
> > Hi,
> >
> > On Tue, 2018-03-06 at 15:03 +0100, Stefan Johansson wrote:
> > > On 2018-03-06 14:33, Thomas Schatzl wrote:
> > > > On Tue, 2018-03-06 at 13:31 +0100, Stefan Johansson wrote:
> > > > > Hi Thomas,
> > > > >
> > > > > On 2018-03-05 15:41, Thomas Schatzl wrote:
> > > > > > Hi all,
> > > > > >
> > > > > > ...
> > > > > >
> > > > > > CR:
> > > > > > https://bugs.openjdk.java.net/browse/JDK-8197850
> > > > > > Webrev:
> > > > > > http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.h
> > > > > > tml
> > > > >
> > > > > Look good, just some minor things.
> > > > >
> > > > > src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
> > > > > 394 _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
> > > > > max_regions, mtGC))
> > > > >
> > > > > max_regions is passed into the constructor but everywhere
> > > > > else in
> > > > > G1ConcurrentMark we use g1h->max_regions(). I would consider
> > > > > either
> > > > > calling g1h->max_regions() in the constructor too, or save
> > > > > the
> > > > > value
> > > > > in a member and use it everywhere.
> > > >
> > > > Done using option 1), use g1h->max_regions() everywhere.
> > >
> > > Thanks.
> > > > > ---
> > > > > src/hotspot/share/gc/g1/g1_globals.hpp
> > > > > 262 experimental(size_t, G1RegionMarkStatsCacheSize,
> > > > > 1024,
> > > > > ...
> > > > > 265 range(128, (max_juint / 2) + 1)
> > > > >
> > > > > Do we need this flag or should we scale it against the number
> > > > > of
> > > > > regions? If we want to keep it I think we should have a
> > > > > somewhat
> > > > > more restrictive range.
> > > >
> > > > I would not want this to scale according to the number of heap
> > > > regions,
> > > > because that is going to have a significant impact on pause
> > > > times
> > > > when
> > > > all of the thread's caches are evicted (The O(#regions) part).
> > >
> > > True, just a thought since 1024 is roughly half the number
> > > regions
> > > we aim for maybe this could be used together with a reasonable
> > > upper
> > > bound.
> > >
> > > > The flag has only been added (rather late, admittedly) to fix
> > > > potential issues with marking time with really large heaps with
> > > > tens of thousands of regions.
> > > > Let me do some more measurements, I will get back to you with
> > > > them
> > > > before giving you a new webrev.
> > >
> > > Sound good.
> >
> > I did some measurements with 100k regions, and I think we can just
> > remove the flag. There is always logging available (gc+mark+stats)
> > that
> > shows cache hit ratio to diagnose issues.
> >
> > > > > ---
> > > > > src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
> > > > >
> > > > > In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when
> > > > > clearing. I don't see a problem with it right now, but it
> > > > > feels a
> > > > > bit wrong since index 0 is a valid region index. Maybe we
> > > > > could
> > > > > use another cleared marker.
> > > >
> > > > Unfortunately there is none (one could use something like -1,
> > > > but
> > > > that one is valid too), and it seems a waste of memory to
> > > > reserve
> > > > more space for it.
> > > >
> > > > I see your point that this is a bit ugly, but there should
> > > > never be
> > > > any issue because of the initialization of the value part of an
> > > > entry with zero. It simply has no impact on totals if you add
> > > > zero.
> > > >
> > > > The code could initialize the cache with region indices from 0
> > > > to
> > > > cache size - 1, which are valid values given the hash function,
> > > > what do you think?
> > > >
> > > > However that would slow down clearing a little (the compiler
> > > > will
> > > > just compile it to a memset() in the loop right now).
> > >
> > > You are correct that -1 is a valid index, but we seldom see heaps
> > > with so many regions. I'm fine with leaving it as is, if you
> > > dislike
> > > using -1 and if it will slow down clearing.
> >
> > Just a bit. It seems as bad to use -1 or another random value, so I
> > kept it.
> >
> > Webrevs:
> > http://cr.openjdk.java.net/~tschatzl/8197850/webrev.0_to_1/index.ht
> > ml
> > (diff)
> > http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1/index.html
> > (full)
> >
> > Testing:
> > This change ran, with some changes to 8180415 due to internal
> > comments
> > (I will post in a few minutes) through hs-tier 1-5 over night.
> >
> > Thanks,
> > Thomas
>
>
From stefan.johansson at oracle.com Tue Mar 13 14:06:00 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Tue, 13 Mar 2018 15:06:00 +0100
Subject: RFR (XXXS): 8199516: Remove dead code overlooked during Full GC
work
In-Reply-To: <1520948470.3100.21.camel@oracle.com>
References: <1520948470.3100.21.camel@oracle.com>
Message-ID:
Looks good, thanks for cleaning this up.
Cheers,
Stefan
On 2018-03-13 14:41, Thomas Schatzl wrote:
> Hi all,
>
> can I have one review for this trivial change that removes some dead
> code found during review of JDK-8199326 as remnants of Full GC
> restructuring?
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8199516
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8199516/webrev/
> Testing:
> local compilation
>
> Thanks,
> Thomas
>
From stefan.johansson at oracle.com Tue Mar 13 14:26:04 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Tue, 13 Mar 2018 15:26:04 +0100
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
In-Reply-To: <1520948533.3100.22.camel@oracle.com>
References: <1520516013.3121.24.camel@oracle.com>
<7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
<1520523980.3121.29.camel@oracle.com>
<1520948533.3100.22.camel@oracle.com>
Message-ID: <420307e0-ea36-70c8-1c9c-f98f9a732c16@oracle.com>
On 2018-03-13 14:42, Thomas Schatzl wrote:
> Hi,
>
> On Mon, 2018-03-12 at 16:48 +0100, Stefan Johansson wrote:
>> Hi Thomas,
>> [...]
>>> Sorry. The correct link is:
>>> http://cr.openjdk.java.net/~tschatzl/8199326/webrev
>> Thanks for doing this cleanup, I found one more reference to the GC
>> timestamp in g1CollectedHeap.hpp:
>> 296 // Clear RSets after a compaction. It also resets the GC
>> time stamps.
>> 297 void clear_rsets_post_compaction();
>>
>> You can actually remove those two lines completely if you like. I
>> forgot the declaration when removing this method in the fix for:
>> 8177544: Restructure G1 Full GC code
>>
>> Otherwise the change looks good and if you don't want to remove the
>> declaration in this patch we can create a separate clean up for this.
>>
> thanks for your review. I posted a webrev for the removal of this
> code as imho it does not completely fit here.
I agree, then consider this fix reviewed.
Thanks,
Stefan
> Thanks,
> Thomas
>
From sangheon.kim at oracle.com Tue Mar 13 14:30:32 2018
From: sangheon.kim at oracle.com (sangheon.kim)
Date: Tue, 13 Mar 2018 07:30:32 -0700
Subject: RFR (XXXS): 8199516: Remove dead code overlooked during Full GC
work
In-Reply-To: <1520948470.3100.21.camel@oracle.com>
References: <1520948470.3100.21.camel@oracle.com>
Message-ID: <3e6d979c-4bce-f5cf-d465-17d742ee8ad7@oracle.com>
Hi Thomas,
Looks good to me too.
Thanks,
Sangheon
On 03/13/2018 06:41 AM, Thomas Schatzl wrote:
> Hi all,
>
> can I have one review for this trivial change that removes some dead
> code found during review of JDK-8199326 as remnants of Full GC
> restructuring?
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8199516
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8199516/webrev/
> Testing:
> local compilation
>
> Thanks,
> Thomas
>
From thomas.schatzl at oracle.com Tue Mar 13 14:54:51 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 15:54:51 +0100
Subject: RFR [L][4/7]: 8180415: Rebuild remembered sets during the
concurrent cycle
In-Reply-To: <1520509760.3121.15.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520262478.2532.91.camel@oracle.com> <1520413176.2346.9.camel@oracle.com>
<1f345c49-7793-7925-2c15-281f24d28e74@oracle.com>
<1520509760.3121.15.camel@oracle.com>
Message-ID: <1520952891.3100.36.camel@oracle.com>
Hi all,
while working on some follow-up changes and discussing with StefanJ,
there some issues came up:
- the amount of marked bytes for humongous objects has been calculated
incorrectly, regardless of TAMS value it always considered humongous
objects as below tams.
There is no actual impact except in gc+liveness log messages in that
even if the humongous object were allocated during marking, it looked
like it had been allocated before marking.
This has been found by the sanity check at the end of the rebuilding in
later changes where it has been made to work with humongous regions too
due to other changes.
- StefanJ mentioned that gc+remset+tracking log messages should have a
gc id. Added.
New webrevs:
http://cr.openjdk.java.net/~tschatzl/8180415/webrev.2_to_3 (diff)
http://cr.openjdk.java.net/~tschatzl/8180415/webrev.3 (full)
Thanks,
Thomas
On Thu, 2018-03-08 at 12:49 +0100, Thomas Schatzl wrote:
> Hi Stefan,
>
> On Thu, 2018-03-08 at 10:15 +0100, Stefan Johansson wrote:
> > Thanks for addressing my initial comments Thomas,
> >
> > On 2018-03-07 09:59, Thomas Schatzl wrote:
> > > Hi all,
> > >
> > > Stefan had some comments about the HeapRegionType parameter in
> > > the G1RemSetTrackingPolicy::update_at_allocate() method - that
> > > one
> > > is not really required when placing the call to this method
> > > correctly and just using the HeapRegion's type directly.
> > >
> > > Changing this removes another 40 LOC of changes.
> > >
> > > There has been another bug introduced by me during cleaning up
> > > for
> > > final review: G1RemSetTrackingPolicy::update_at_free() is empty
> > > in
> > > this change, which is wrong for this change - in this change we
> > > still do not free the remembered sets during the cleanup pause,
> > > only in the Concurrent Cleanup phase. When doing this
> > > concurrently,
> > > an assert triggers when setting the remembered set state to empty
> > > outside a safepoint.
> > > The fix is to make the remembered set untracked during the
> > > Cleanup
> > > phase still.
> > >
> > > New webrevs:
> > > http://cr.openjdk.java.net/~tschatzl/8180415/webrev.0_to_1 (diff)
> > > http://cr.openjdk.java.net/~tschatzl/8180415/webrev.1 (full)
> >
> > The change looks good. Just some additional comments:
> > src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
> > 1255 GCTraceTime(Debug, gc)("Complete Remembered Set
> > Tracking");
> > ...
> > 1291 GCTraceTime(Debug, gc)("Finalize Concurrent Mark
> > Cleanup");
> >
> > Please add the "phases" tag to the above logging to be more
> > consistent with the remark and other pauses.
> > ---
> > src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp
> > 52 template inline void
> > G1AdjustClosure::adjust_pointer(T*
> > p)
> >
> > In this method the comments should be updated since we no longer
> > return anything.
> > ---
> > src/hotspot/share/gc/g1/g1RemSet.cpp
> > 757 HeapRegion* start_region = hr-
> > >humongous_start_region();
> >
> > start_region is only used to get bottom and crate an oop, so maybe
> > instead create the oop directly, like:
> > oop humongous = oop(hr->humongous_start_region()->bottom());
> >
> > 761 // A humongous object is live (with respect to the
> > scanning) either
> > 762 // a) it is marked on the bitmap as such
> > 763 // b) its TARS is larger than nTAMS, i.e. has been
> > allocated during marking.
> > 764 if (_cm->next_mark_bitmap()->is_marked(start_region-
> > > bottom()) ||
> >
> > 765 (top_at_rebuild_start > hr-
> > >next_top_at_mark_start()))
> > {
> >
> > Break this check out to get something like: is_live(humongous,
> > tars,
> > ntams).
>
> Fixed.
>
> > There is also the marked_bytes counting in this method that makes
> > the
> > code a bit harder to follow. I've discussed this with Thomas
> > offline
> > and he has an idea of how to avoid this.
>
> As discussed I would like to postpone this for now as it is much
> harder
> than it looks and warrants its own CR (actually two or three).
>
> > Also in G1FullCollector::phase3_adjust_pointers() there is a
> > GCTraceTime that needs updating, since we no longer rebuild
> > remember
> > sets.
>
> All done.
>
> New webrevs:
> http://cr.openjdk.java.net/~tschatzl/8180415/webrev.1_to_2/ (diff)
> http://cr.openjdk.java.net/~tschatzl/8180415/webrev.2/ (full)
>
> Thomas
>
From thomas.schatzl at oracle.com Tue Mar 13 15:03:21 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 16:03:21 +0100
Subject: RFR [M][7/7]: 8197932: Better split work in rebuild remembered
sets phase
In-Reply-To: <1520265115.2532.126.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520265115.2532.126.camel@oracle.com>
Message-ID: <1520953401.3100.41.camel@oracle.com>
Hi all,
On Mon, 2018-03-05 at 16:51 +0100, Thomas Schatzl wrote:
> Hi all,
>
> (last one for now :)) (resend because I forgot to change the
> subject)
>
> please have a look at this change that improves TTSP during the
> rebuild remembered set phase.
>
>
[...]
the assert at the end of the rebuilding has an issue in this change,
in particular if in the last iteration, we have yielded, and during
that yield point a GC eagerly reclaimed the region, the assert at the
end of the rebuilding fails.
The correct fix is to update the wrong assert to re-check the TARS that
is updated by the eager reclaim.
Webrevs:
http://cr.openjdk.java.net/~tschatzl/8197932/webrev.0_to_1/ (diff)
http://cr.openjdk.java.net/~tschatzl/8197932/webrev.1/ (full)
testing:
hs-tier1-5
Thanks,
Thomas
From rkennke at redhat.com Tue Mar 13 15:40:24 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 13 Mar 2018 16:40:24 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <39a6ae41-9736-ea0a-99ef-af3e32c772b8@redhat.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
<0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
<39a6ae41-9736-ea0a-99ef-af3e32c772b8@redhat.com>
Message-ID:
The test came back with the below. Doesn't strike me as being related to
this change.
What to do now? Push it anyway? Re-submit the test? (If so, how?)
Roman
Build Details: 2018-03-13-1330406.roman.source
1 Failed Test
Test Tier Platform Keywords Description Task
java/lang/invoke/condy/CondyInterfaceWithOverpassMethods.java tier1
windows-x64 bug8186046 othervm testng Error: failed to clean up files
after test task
Mach5 Tasks Results Summary
NA: 0
FAILED: 0
PASSED: 74
UNABLE_TO_RUN: 0
KILLED: 0
EXECUTED_WITH_FAILURE: 1
Test
1 Executed with failure
jdk_open_test_jdk_tier1-windows-x64-66 Results: total: 1775,
passed: 1774; failed: 1
> Hi Erik & Per,
>
> yes, I agree with getting rid of Runtime1::arraycopy(). Let's take it to
> another RFE.
>
> Let's try the newfangled submit repo and push (mostly) my first patch :-)
>
> Thanks for reviewing!
> Cheer, Roman
>
>
>> Hi Roman,
>>
>> Ideally I'd like to get rid of Runtime1::arraycopy. It seems like a
>> medium slow path of C1 never used by any platforms other than S390 and
>> PPC, which look like the only platforms that lack a generic arraycopy
>> stub from the StubRoutines. I think that S390 and PPC could easily just
>> jump to the C1 arraycopy stub instead and take the slowpath to the
>> normal native arraycopy that enters through the JNI interface instead.
>>
>> If the performance of this C1 arraycopy path on S390 and PPC are
>> crucial, then they should probably implement stubs for it like the other
>> platforms. If the performance of this is not crucial (I suspect this is
>> the case), then it should not harm to take the normal entry through JNI
>> for generic arraycopy using C1.
>>
>> But I think trying to get rid of that path could be a follow-up RFE
>> instead.
>>
>> Looks good.
>>
>> Thanks,
>> /Erik
>>
>> On 2018-03-13 11:02, Roman Kennke wrote:
>>> Hi Erik,
>>>
>>> thanks for doing this! It looks good to me!
>>>
>>> I'm putting this up here again, with commit msg fixed:
>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.03/
>>>
>>> Can I get (final?) reviews? And then I'd put it through the new submit
>>> repo and push it?
>>>
>>> Thanks, Roman
>>>
>>>
>>>> Hi Roman,
>>>>
>>>> I would love to avoid using the switch to enumerate all different Java
>>>> types you could possibly have.
>>>> How about this? (was easier to cook something together than explain in
>>>> detail what I had in mind)
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
>>>>
>>>> The idea is to let Access recognize arraycopy with element type "void",
>>>> and then perform a conservative byte arraycopy, that when
>>>> ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
>>>> using Copy::conjoint_memory_atomic().
>>>>
>>>> Thanks,
>>>> /Erik
>>>>
>>>> On 2018-03-08 21:12, Roman Kennke wrote:
>>>>> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>>>>>> Hi Roman,
>>>>>>
>>>>>> On 2018-03-08 11:25, Roman Kennke wrote:
>>>>>>> Wouldn't that lead to mis-aligned accesses when you try to copy an
>>>>>>> array
>>>>>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>>>>>> misunderstanding?
>>>>>> No it would not. The element type is void, not void*. Because the
>>>>>> element type is type erased. And that would map to
>>>>>> Copy::conjoint_memory_atomic, which is precisely what
>>>>>> typeArrayKlass.cpp
>>>>>> maps such an arraycopy to today. Assuming elements are aligned to
>>>>>> their
>>>>>> natural size (which they are), Copy::conjoint_memory_atomic is
>>>>>> guaranteed to be at least as atomic as you need your elements to
>>>>>> be, up
>>>>>> to an element size of 8.
>>>>> Ah, ok. Alright, so here comes rev.02:
>>>>>
>>>>> Differential:
>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
>>>>> Full:
>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>>>>>
>>>>> Still passes tier1 tests.
>>>>>
>>>>> Ok now?
>>>>>
>>>>> Cheers, Roman
>>>>>
>>>>>
>>>>>>> An idea would be to copy equal-sized elements using the corresponding
>>>>>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>>>>>> short version, boolean and byte would use the byte version (or is
>>>>>>> boolean sometimes int?!), float and int would use the int version and
>>>>>>> long and double the long version. WDYT?
>>>>>> I'm not sure I see what the advantage of that would be.
>>>>>>
>>>>>> Thanks,
>>>>>> /Erik
>>>>>>
>>>>>>> Roman
>>>>>>>
>>>>>>>
>>>>>>>> My spontaneous idea was to have an overload for type erased void*
>>>>>>>> that
>>>>>>>> when called with ARRAYCOPY_ATOMIC maps to
>>>>>>>> Copy::conjoint_memory_atomic
>>>>>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>>>>>> element type is.
>>>>>>>>
>>>>>>>> But if you have better ideas, I am open for suggestions.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> /Erik
>>>>>>>>
>>>>>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>>>>>> we can
>>>>>>>>>> just as well call typeArrayOop::copy_array() and have it do the
>>>>>>>>>> right
>>>>>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>>>>>> Something like:
>>>>>>>>>
>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>>>>>
>>>>>>>>> This wouldn't compile because of bunch of missing
>>>>>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>>>>>> specific stuff... and my question before I go there is: do we want
>>>>>>>>> all
>>>>>>>>> that? Or can you think of a better way to solve it?
>>>>>>>>>
>>>>>>>>> Roman
>>>>>>>>>
>>>>>>>>>> Roman
>>>>>>>>>>
>>>>>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over
>>>>>>>>>>> the
>>>>>>>>>>> size
>>>>>>>>>>> of the passed in elements.
>>>>>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>>>>>> void*,
>>>>>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>>>>>> overload
>>>>>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>>>>>> jshort, jint, jlong}.
>>>>>>>>>>>
>>>>>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>>>>>> void*
>>>>>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> /Erik
>>>>>>>>>>>
>>>>>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>>>>>> Hi David,
>>>>>>>>>>>>>
>>>>>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>>>>>> comment is
>>>>>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>>>>>> decorator
>>>>>>>>>>>>> should probably be used here.
>>>>>>>>>>>> If that code implements a Java array copy then yes it is
>>>>>>>>>>>> required to
>>>>>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit
>>>>>>>>>>>> atomicity?
>>>>>>>>>>>>
>>>>>>>>>>>> David
>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> /Erik
>>>>>>>>>>>>>
>>>>>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>>>>>> Hi Roman,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>>>>>> but in
>>>>>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>> code need updating - probably deleting. I assume the Access
>>>>>>>>>>>>>> API
>>>>>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>> David
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>>>>>> not for
>>>>>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too,
>>>>>>>>>>>>>>> e.g.
>>>>>>>>>>>>>>> resolve
>>>>>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>>>>>> Access API,
>>>>>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does
>>>>>>>>>>>>>>> not
>>>>>>>>>>>>>>> take
>>>>>>>>>>>>>>> src
>>>>>>>>>>>>>>> and dst oop operands, but it's called like that. The only
>>>>>>>>>>>>>>> reason
>>>>>>>>>>>>>>> why
>>>>>>>>>>>>>>> this does not blow up (I think) is that because nobody calls
>>>>>>>>>>>>>>> it,
>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>>>>>> calls into
>>>>>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>>>>>> cannot be
>>>>>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(),
>>>>>>>>>>>>>>> which
>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>>>>>> Java-array <->
>>>>>>>>>>>>>>> native-array bulk transfers, which currently use the rather
>>>>>>>>>>>>>>> ugly
>>>>>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address
>>>>>>>>>>>>>>> that
>>>>>>>>>>>>>>> in a
>>>>>>>>>>>>>>> separate change though.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Please review!
>>>>>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>>>>>
>>>
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From thomas.schatzl at oracle.com Tue Mar 13 15:43:26 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 16:43:26 +0100
Subject: RFR [0/7]: Rebuild remembered sets concurrently
In-Reply-To: <1520258985.2532.40.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
Message-ID: <1520955806.3100.42.camel@oracle.com>
Hi,
after this round of updated due to rebasing, here is a new "complete"
webrev for reference:
http://cr.openjdk.java.net/~tschatzl/rebuild-all/webrev.1
Thanks,
Thomas
On Mon, 2018-03-05 at 15:09 +0100, Thomas Schatzl wrote:
> Hi all,
>
> I would like to ask for reviews for a significant change in how G1
> manages its remembered sets by rebuilding its remembered sets
> concurrently.
>
> Currently G1 maintains the remembered sets for all regions all the
> time. This has several drawbacks:
>
> - memory consumption for remembered sets is very high all the time,
> not
> only due to actually storing these remembered sets, but also due to
> additional memory wastage due to fragmentation.
> - the mechanism to combat this memory fragmentation (somewhat) has
> been
> to periodically "scrub" remembered sets, at high costs during the
> "Cleanup" pause.
> - maintenance of ultimately unused remembered sets decreases overall
> throughput.
>
> With these changes, G1 will only maintain remembered sets that will
> ever be considered for evacuation ("candidate collection set
> regions")
> only during marking and the following mixed gc phase.
>
> This not only to a very significant degree decreases average memory
> consumption (e.g. during the young-only phase mainly remembered sets
> for young-only regions are maintained), but also maximum memory
> consumption, as there is little fragmentation while remembered sets
> are
> maintained.
>
> There is no need for scrubbing the remembered sets any more either,
> making the Cleanup pause very fast. This allows us to actually remove
> some previously (very small) concurrent phase.
>
> As a beneficial side-effect we noticed that particularly mixed gc
> performance may increase significantly (up to like 40%-50% faster)
> due
> to improved remembered set memory locality.
>
> Particularly "big data" workloads where the remembered sets take a
> lot
> of memory and maintenance cpu resources benefit most, but we have
> also
> noticed significant throughput improvements when running with G1 in
> other cases.
>
> The only drawback we are aware of is that the delay from start of
> marking to the first mixed gc is longer. G1's mechanism to adaptively
> start marking seems to be able to manage this change nicely, but some
> people that already set a very high specific IHOP manually may
> experience full gcs.
>
> Due to the large benefits we do not intend to provide the original
> behavior, although it could be implemented as the decisions which
> regions to maintain the remembered sets are encapsulated into a
> single
> class.
>
> For more information look at my somewhat recent FOSDEM talk
> explaining
> this change in more details [1].
>
> For further review purposes this change will be split into seven
> distinct changesets that will be organized into a thread below this
> post, each tagged with a running number. Obviously they are dependent
> on each other.
>
> These are in order:
>
> 8197569: Refactor eager reclaim for concurrent remembered set
> rebuilding
> 8197570: Make rules for choosing collection set candidates more
> explicit
> 8197850: Calculate liveness in regions during marking
> 8180415: Rebuild remembered sets during concurrent mark (main change)
> 8197573: Remove concurrent cleanup and secondary free list handling
> 8197928: Only enqueue deferred cards with references into regions
> that
> have a tracked remembered set during GC
> 8197932: Better split work in rebuild remembered sets phase
>
> Each of those changesets will have its own webrev, and there will be
> notes about each of the changes. However, for reference a webrev
> containing all the changes can be found here:
>
> http://cr.openjdk.java.net/~tschatzl/rebuild-all/webrev/
>
> Testing: hs-tier1-5, internal perf tests
>
> Enjoy! :)
>
> Thomas
>
> [1] https://fosdem.org/2018/schedule/event/g1/
>
From thomas.schatzl at oracle.com Tue Mar 13 15:45:33 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Tue, 13 Mar 2018 16:45:33 +0100
Subject: RFR [1/7]: 8197569: Refactor eager reclaim for concurrent
remembered set rebuilding
In-Reply-To:
References: <1520258985.2532.40.camel@oracle.com>
<1520259499.2532.44.camel@oracle.com>
<8d58ae9c-1c18-c317-a40c-66241faa9a81@oracle.com>
<1520342273.2378.15.camel@oracle.com>
Message-ID: <1520955933.3100.43.camel@oracle.com>
Hi,
On Tue, 2018-03-06 at 14:49 +0100, Stefan Johansson wrote:
>
> On 2018-03-06 14:17, Thomas Schatzl wrote:
> > Hi Stefan,
> >
> > thanks for looking into this.
> >
> > On Mon, 2018-03-05 at 16:11 +0100, Stefan Johansson wrote:
> > > Thanks for splitting this change up Thomas,
> > >
> > > On 2018-03-05 15:18, Thomas Schatzl wrote:
> > > > Hi all,
> > > >
> > > > can I have some reviews for the following change that
> > > > refactors the[...]
> >
> > Either way is kind of fine for me right now, so let's see what
> > others say?
>
> I'm fine with this as well. Consider it reviewed :)
thanks Stefan and Kim for your reviews.
Thomas
From jesper.wilhelmsson at oracle.com Tue Mar 13 15:59:38 2018
From: jesper.wilhelmsson at oracle.com (jesper.wilhelmsson at oracle.com)
Date: Tue, 13 Mar 2018 16:59:38 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To:
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
<0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
<39a6ae41-9736-ea0a-99ef-af3e32c772b8@redhat.com>
Message-ID: <3677DC43-EF68-4746-A155-73C413D445DE@oracle.com>
Roman,
The first thing to do in this case is to search JBS for any known issue in this test. By searching for the test name for instance you will find this issue: JDK-8199515
https://bugs.openjdk.java.net/issues/?jql=text%20~%20%22java%2Flang%2Finvoke%2Fcondy%2FCondyInterfaceWithOverpassMethods.java%22
Obviously, without more information about your particular failure you can not be 100% sure that this is the same bug, but it's a good pice of information to provide to the Oracle engineer who you ask to look at your failure. If there is an error in your tier1 run you should NOT push unless someone that has investigated the issue gives you a GO.
In this case your failure is a known issue that is being worked on, JDK-8199515, and you can go ahead and push provided the change is reviewed and all those other checkboxes are ticked.
/Jesper
> On 13 Mar 2018, at 16:40, Roman Kennke wrote:
>
> The test came back with the below. Doesn't strike me as being related to
> this change.
>
> What to do now? Push it anyway? Re-submit the test? (If so, how?)
>
> Roman
>
> Build Details: 2018-03-13-1330406.roman.source
> 1 Failed Test
> Test Tier Platform Keywords Description Task
> java/lang/invoke/condy/CondyInterfaceWithOverpassMethods.java tier1
> windows-x64 bug8186046 othervm testng Error: failed to clean up files
> after test task
> Mach5 Tasks Results Summary
>
> NA: 0
> FAILED: 0
> PASSED: 74
> UNABLE_TO_RUN: 0
> KILLED: 0
> EXECUTED_WITH_FAILURE: 1
> Test
>
> 1 Executed with failure
> jdk_open_test_jdk_tier1-windows-x64-66 Results: total: 1775,
> passed: 1774; failed: 1
>
>
>
>> Hi Erik & Per,
>>
>> yes, I agree with getting rid of Runtime1::arraycopy(). Let's take it to
>> another RFE.
>>
>> Let's try the newfangled submit repo and push (mostly) my first patch :-)
>>
>> Thanks for reviewing!
>> Cheer, Roman
>>
>>
>>> Hi Roman,
>>>
>>> Ideally I'd like to get rid of Runtime1::arraycopy. It seems like a
>>> medium slow path of C1 never used by any platforms other than S390 and
>>> PPC, which look like the only platforms that lack a generic arraycopy
>>> stub from the StubRoutines. I think that S390 and PPC could easily just
>>> jump to the C1 arraycopy stub instead and take the slowpath to the
>>> normal native arraycopy that enters through the JNI interface instead.
>>>
>>> If the performance of this C1 arraycopy path on S390 and PPC are
>>> crucial, then they should probably implement stubs for it like the other
>>> platforms. If the performance of this is not crucial (I suspect this is
>>> the case), then it should not harm to take the normal entry through JNI
>>> for generic arraycopy using C1.
>>>
>>> But I think trying to get rid of that path could be a follow-up RFE
>>> instead.
>>>
>>> Looks good.
>>>
>>> Thanks,
>>> /Erik
>>>
>>> On 2018-03-13 11:02, Roman Kennke wrote:
>>>> Hi Erik,
>>>>
>>>> thanks for doing this! It looks good to me!
>>>>
>>>> I'm putting this up here again, with commit msg fixed:
>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.03/
>>>>
>>>> Can I get (final?) reviews? And then I'd put it through the new submit
>>>> repo and push it?
>>>>
>>>> Thanks, Roman
>>>>
>>>>
>>>>> Hi Roman,
>>>>>
>>>>> I would love to avoid using the switch to enumerate all different Java
>>>>> types you could possibly have.
>>>>> How about this? (was easier to cook something together than explain in
>>>>> detail what I had in mind)
>>>>>
>>>>> Webrev:
>>>>> http://cr.openjdk.java.net/~eosterlund/8198445/webrev.00/
>>>>>
>>>>> The idea is to let Access recognize arraycopy with element type "void",
>>>>> and then perform a conservative byte arraycopy, that when
>>>>> ARRAYCOPY_ATOMIC uses the natural atomicity of the element alignment by
>>>>> using Copy::conjoint_memory_atomic().
>>>>>
>>>>> Thanks,
>>>>> /Erik
>>>>>
>>>>> On 2018-03-08 21:12, Roman Kennke wrote:
>>>>>> Am 08.03.2018 um 14:13 schrieb Erik ?sterlund:
>>>>>>> Hi Roman,
>>>>>>>
>>>>>>> On 2018-03-08 11:25, Roman Kennke wrote:
>>>>>>>> Wouldn't that lead to mis-aligned accesses when you try to copy an
>>>>>>>> array
>>>>>>>> of, e.g., bytes, but shoehorn it to pointer-size? Or am I
>>>>>>>> misunderstanding?
>>>>>>> No it would not. The element type is void, not void*. Because the
>>>>>>> element type is type erased. And that would map to
>>>>>>> Copy::conjoint_memory_atomic, which is precisely what
>>>>>>> typeArrayKlass.cpp
>>>>>>> maps such an arraycopy to today. Assuming elements are aligned to
>>>>>>> their
>>>>>>> natural size (which they are), Copy::conjoint_memory_atomic is
>>>>>>> guaranteed to be at least as atomic as you need your elements to
>>>>>>> be, up
>>>>>>> to an element size of 8.
>>>>>> Ah, ok. Alright, so here comes rev.02:
>>>>>>
>>>>>> Differential:
>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02.diff/
>>>>>> Full:
>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.02/
>>>>>>
>>>>>> Still passes tier1 tests.
>>>>>>
>>>>>> Ok now?
>>>>>>
>>>>>> Cheers, Roman
>>>>>>
>>>>>>
>>>>>>>> An idea would be to copy equal-sized elements using the corresponding
>>>>>>>> Copy::conjoint_XXX_atomic() calls, e.g. char and short would use the
>>>>>>>> short version, boolean and byte would use the byte version (or is
>>>>>>>> boolean sometimes int?!), float and int would use the int version and
>>>>>>>> long and double the long version. WDYT?
>>>>>>> I'm not sure I see what the advantage of that would be.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> /Erik
>>>>>>>
>>>>>>>> Roman
>>>>>>>>
>>>>>>>>
>>>>>>>>> My spontaneous idea was to have an overload for type erased void*
>>>>>>>>> that
>>>>>>>>> when called with ARRAYCOPY_ATOMIC maps to
>>>>>>>>> Copy::conjoint_memory_atomic
>>>>>>>>> which AFAIK is conservatively atomic regardless of what the precise
>>>>>>>>> element type is.
>>>>>>>>>
>>>>>>>>> But if you have better ideas, I am open for suggestions.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> /Erik
>>>>>>>>>
>>>>>>>>> On 2018-03-06 17:03, Roman Kennke wrote:
>>>>>>>>>> Am 06.03.2018 um 14:35 schrieb Roman Kennke:
>>>>>>>>>>> Makes me wonder: why attempt to be smart in c1_Runtime1.cpp, when
>>>>>>>>>>> we can
>>>>>>>>>>> just as well call typeArrayOop::copy_array() and have it do the
>>>>>>>>>>> right
>>>>>>>>>>> thing? Or go even further and also do it for oop-arraycopy?
>>>>>>>>>> Something like:
>>>>>>>>>>
>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/8198445-1.patch
>>>>>>>>>>
>>>>>>>>>> This wouldn't compile because of bunch of missing
>>>>>>>>>> arraycopy_conjoint_atomic defintions for extra types like jfloat,
>>>>>>>>>> jdouble, jboolean, etc, which in turn would be missing the same
>>>>>>>>>> Copy::conjoint_jFluffs_atomic() which drags in a bunch of platform
>>>>>>>>>> specific stuff... and my question before I go there is: do we want
>>>>>>>>>> all
>>>>>>>>>> that? Or can you think of a better way to solve it?
>>>>>>>>>>
>>>>>>>>>> Roman
>>>>>>>>>>
>>>>>>>>>>> Roman
>>>>>>>>>>>
>>>>>>>>>>>> The ARRAYCOPY_ATOMIC decorator makes the arraycopy atomic over
>>>>>>>>>>>> the
>>>>>>>>>>>> size
>>>>>>>>>>>> of the passed in elements.
>>>>>>>>>>>> In this case, it looks like the address has been type erased to
>>>>>>>>>>>> void*,
>>>>>>>>>>>> and hence lost what the element size was. There is currently no
>>>>>>>>>>>> overload
>>>>>>>>>>>> accepted for type erased element - only accurate elements {jbyte,
>>>>>>>>>>>> jshort, jint, jlong}.
>>>>>>>>>>>>
>>>>>>>>>>>> So it looks like an overload must be added to accept type erased
>>>>>>>>>>>> void*
>>>>>>>>>>>> elements and make that call conjoint_memory_atomic when the
>>>>>>>>>>>> ARRAYCOPY_ATOMIC decorator is passed in.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> /Erik
>>>>>>>>>>>>
>>>>>>>>>>>> On 2018-03-06 13:56, David Holmes wrote:
>>>>>>>>>>>>> On 6/03/2018 10:54 PM, Erik ?sterlund wrote:
>>>>>>>>>>>>>> Hi David,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> It is atomic with the ARRAYCOPY_ATOMIC decorator. If that
>>>>>>>>>>>>>> comment is
>>>>>>>>>>>>>> correct (I do not know if it is), then the ARRAYCOPY_ATOMIC
>>>>>>>>>>>>>> decorator
>>>>>>>>>>>>>> should probably be used here.
>>>>>>>>>>>>> If that code implements a Java array copy then yes it is
>>>>>>>>>>>>> required to
>>>>>>>>>>>>> be 32-bit atomic. Do you need the decorator to get 32-bit
>>>>>>>>>>>>> atomicity?
>>>>>>>>>>>>>
>>>>>>>>>>>>> David
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>> /Erik
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 2018-03-06 13:48, David Holmes wrote:
>>>>>>>>>>>>>>> Hi Roman,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Not a review as I'm not familiar enough with the Access API,
>>>>>>>>>>>>>>> but in
>>>>>>>>>>>>>>> src/hotspot/share/c1/c1_Runtime1.cpp the comments above the
>>>>>>>>>>>>>>> changed
>>>>>>>>>>>>>>> code need updating - probably deleting. I assume the Access
>>>>>>>>>>>>>>> API
>>>>>>>>>>>>>>> arraycopy is atomic?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>> David
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 6/03/2018 9:56 PM, Roman Kennke wrote:
>>>>>>>>>>>>>>>> Currently, the Access API is only used for oop-arraycopy, but
>>>>>>>>>>>>>>>> not for
>>>>>>>>>>>>>>>> primitive arraycopy. GCs might want to intercept this too,
>>>>>>>>>>>>>>>> e.g.
>>>>>>>>>>>>>>>> resolve
>>>>>>>>>>>>>>>> src and dst arrays.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> There *is* an implementation of primitive arraycopy in the
>>>>>>>>>>>>>>>> Access API,
>>>>>>>>>>>>>>>> but it doesn't even compile, because Raw::arraycopy() does
>>>>>>>>>>>>>>>> not
>>>>>>>>>>>>>>>> take
>>>>>>>>>>>>>>>> src
>>>>>>>>>>>>>>>> and dst oop operands, but it's called like that. The only
>>>>>>>>>>>>>>>> reason
>>>>>>>>>>>>>>>> why
>>>>>>>>>>>>>>>> this does not blow up (I think) is that because nobody calls
>>>>>>>>>>>>>>>> it,
>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>> compiler doesn't even get there.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> This change fixes the Access API/impl and adds the relevant
>>>>>>>>>>>>>>>> calls into
>>>>>>>>>>>>>>>> it (in C1 and runtime land). C2 uses arraycopy stubs (which
>>>>>>>>>>>>>>>> cannot be
>>>>>>>>>>>>>>>> handled here) or calls out to the ArrayKlass::copy_array(),
>>>>>>>>>>>>>>>> which
>>>>>>>>>>>>>>>> should
>>>>>>>>>>>>>>>> be covered with this change.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> It should be possible to use the same Access API for
>>>>>>>>>>>>>>>> Java-array <->
>>>>>>>>>>>>>>>> native-array bulk transfers, which currently use the rather
>>>>>>>>>>>>>>>> ugly
>>>>>>>>>>>>>>>> typeArrayOop::XYZ_addr() + memcpy() pattern. I'll address
>>>>>>>>>>>>>>>> that
>>>>>>>>>>>>>>>> in a
>>>>>>>>>>>>>>>> separate change though.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> http://cr.openjdk.java.net/~rkennke/8198445/webrev.00/
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Tests: tier1 ok
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Please review!
>>>>>>>>>>>>>>>> Thanks, Roman
>>>>>>>>>>>>>>>>
>>>>
>>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From rkennke at redhat.com Tue Mar 13 16:15:50 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 13 Mar 2018 17:15:50 +0100
Subject: RFR: JDK-8198445: Access API for primitive/native arraycopy
In-Reply-To: <3677DC43-EF68-4746-A155-73C413D445DE@oracle.com>
References: <007e671a-a1ef-c3f0-4181-bb3a41733c7e@redhat.com>
<5A9E8F76.1050809@oracle.com>
<83de65bd-5d3f-78df-02d2-eb4c53aa0c62@oracle.com>
<5A9E95D8.6080602@oracle.com>
<2cc9a407-aba8-209a-7ef7-4ab26b88fef6@redhat.com>
<6d8435af-5bec-da70-fa8a-60d708937f44@redhat.com>
<5A9EBD6E.3070005@oracle.com>
<2612309c-868b-6094-5944-e9de54daf8d2@redhat.com>
<5AA136E9.9080100@oracle.com>
<3034e0b7-9894-80e6-afd4-171e31ad5836@redhat.com>
<5AA29BEB.3020402@oracle.com>
<0032c706-3171-1cee-20b0-baf67b438f31@redhat.com>
<39a6ae41-9736-ea0a-99ef-af3e32c772b8@redhat.com>
<3677DC43-EF68-4746-A155-73C413D445DE@oracle.com>
Message-ID:
Hi Jesper,
> The first thing to do in this case is to search JBS for any known issue
> in this test. By searching for the test name for instance you will find
> this issue: JDK-8199515
> https://bugs.openjdk.java.net/issues/?jql=text%20~%20%22java%2Flang%2Finvoke%2Fcondy%2FCondyInterfaceWithOverpassMethods.java%22
> "java/lang/invoke/condy/CondyInterfaceWithOverpassMethods.java">
>
> Obviously, without more information about your particular failure you
> can not be 100% sure that this is the same bug, but it's a good pice of
> information to provide to the Oracle engineer who you ask to look at
> your failure. If there is an error in your tier1 run you should NOT push
> unless someone that has investigated the issue gives you a GO.
Ok, this is good stuff to know. Thanks!
> In this case your failure is a known issue that is being worked on,
> JDK-8199515, and you can go ahead and push provided the change is
> reviewed and all those other checkboxes are ticked.
Yes, all checkboxes are ticked ;-) I just pushed the very first Hotspot
change *myself* :-) Yippie! This is great progress, thank you!!
Cheers,
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From rkennke at redhat.com Tue Mar 13 20:00:55 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Tue, 13 Mar 2018 21:00:55 +0100
Subject: RFR(XS): JDK-8199559: objArrayKlass::oop_iterate() and friends must
use base_raw() instead of base()
Message-ID: <36ef9c8e-7278-1613-989e-acc929f2d2ed@redhat.com>
Currently, objArrayKlass::oop_iterate() and related methods use base()
to get the actual starting address of the array. However, base()
resolves the oop via barriers. oop_iterate() is used solely by GC code,
which requires direct access to the array, no matter which copy, and
thus needs to use base_raw() instead.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8199559
Webrev:
http://cr.openjdk.java.net/~rkennke/8199559/webrev.00/
Can I please get a review?
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From sangheon.kim at oracle.com Tue Mar 13 21:39:21 2018
From: sangheon.kim at oracle.com (sangheon.kim)
Date: Tue, 13 Mar 2018 14:39:21 -0700
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <1520949153.3100.27.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
<8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
<1520412521.2346.4.camel@oracle.com>
<0cd6cca6-cace-4e4f-7f9c-152e20757dfe@oracle.com>
<1520949153.3100.27.camel@oracle.com>
Message-ID: <4c671223-0d99-ef72-682a-402374cdb988@oracle.com>
Hi Thomas,
On 03/13/2018 06:52 AM, Thomas Schatzl wrote:
> Hi Stefan,
>
> On Wed, 2018-03-07 at 11:12 +0100, Stefan Johansson wrote:
>> Thanks Thomas,
>>
>> This looks good to me, reviewed.
> thanks for your review; unfortunately rebasing the changes to latest
> caused some additional work.
>
> In this particular case, contents of g1RegionMarkStatsCache had to be
> distributed to .cpp and .inline.hpp files (recent .inline.hpp include
> fixes), and I preemptively removed the use of one VALUE_OBJ_CLASS_SPEC.
>
> Webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1_to_2/index.html
> (diff)
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.2/index.html (full)
Looks good, I have several minor comments.
===============================
src/hotspot/share/gc/g1/g1CardLiveData.cpp
292 assert(!hr->is_old() || marked_bytes ==
(_cm->liveness(hr->hrm_index()) * HeapWordSize),
Don't we need to print assert message for hr->is_old()?
===============================
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
4215 // Any worker id is fine here as we are in the VM thread and
single-threaded.
Would be better to add 'valid'?
// Any _valid_ worker id ...
===============================
src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
1840 log_debug(gc, stats)("Mark stats cache hits " SIZE_FORMAT " misses
" SIZE_FORMAT " ratio %1.3lf",
gc+stats is not registered at logPrefix.hpp, so currently GC ID is not
printed. I guess this is not intensional?
===============================
src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
25 #ifndef SHARE_VM_GC_G1_G1REGIONMARKSTATSCACHE_HPP
I'm okay leaving as is but we don't have 'VM' directory anymore. At some
point we would want to clean up these stuffs at once?
61 // logical and.
This seems incomplete sentence?
Thanks,
Sangheon
>
> Testing:
> hs-tier 1-5
>
> Thanks,
> Thomas
>
>
>
>> Stefan
>>
>> On 2018-03-07 09:48, Thomas Schatzl wrote:
>>> Hi,
>>>
>>> On Tue, 2018-03-06 at 15:03 +0100, Stefan Johansson wrote:
>>>> On 2018-03-06 14:33, Thomas Schatzl wrote:
>>>>> On Tue, 2018-03-06 at 13:31 +0100, Stefan Johansson wrote:
>>>>>> Hi Thomas,
>>>>>>
>>>>>> On 2018-03-05 15:41, Thomas Schatzl wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> ...
>>>>>>>
>>>>>>> CR:
>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8197850
>>>>>>> Webrev:
>>>>>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev/index.h
>>>>>>> tml
>>>>>> Look good, just some minor things.
>>>>>>
>>>>>> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
>>>>>> 394 _region_mark_stats(NEW_C_HEAP_ARRAY(G1RegionMarkStats,
>>>>>> max_regions, mtGC))
>>>>>>
>>>>>> max_regions is passed into the constructor but everywhere
>>>>>> else in
>>>>>> G1ConcurrentMark we use g1h->max_regions(). I would consider
>>>>>> either
>>>>>> calling g1h->max_regions() in the constructor too, or save
>>>>>> the
>>>>>> value
>>>>>> in a member and use it everywhere.
>>>>> Done using option 1), use g1h->max_regions() everywhere.
>>>> Thanks.
>>>>>> ---
>>>>>> src/hotspot/share/gc/g1/g1_globals.hpp
>>>>>> 262 experimental(size_t, G1RegionMarkStatsCacheSize,
>>>>>> 1024,
>>>>>> ...
>>>>>> 265 range(128, (max_juint / 2) + 1)
>>>>>>
>>>>>> Do we need this flag or should we scale it against the number
>>>>>> of
>>>>>> regions? If we want to keep it I think we should have a
>>>>>> somewhat
>>>>>> more restrictive range.
>>>>> I would not want this to scale according to the number of heap
>>>>> regions,
>>>>> because that is going to have a significant impact on pause
>>>>> times
>>>>> when
>>>>> all of the thread's caches are evicted (The O(#regions) part).
>>>> True, just a thought since 1024 is roughly half the number
>>>> regions
>>>> we aim for maybe this could be used together with a reasonable
>>>> upper
>>>> bound.
>>>>
>>>>> The flag has only been added (rather late, admittedly) to fix
>>>>> potential issues with marking time with really large heaps with
>>>>> tens of thousands of regions.
>>>>> Let me do some more measurements, I will get back to you with
>>>>> them
>>>>> before giving you a new webrev.
>>>> Sound good.
>>> I did some measurements with 100k regions, and I think we can just
>>> remove the flag. There is always logging available (gc+mark+stats)
>>> that
>>> shows cache hit ratio to diagnose issues.
>>>
>>>>>> ---
>>>>>> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
>>>>>>
>>>>>> In G1RegionMarkStatsCacheEntry _region_idx is set to 0 when
>>>>>> clearing. I don't see a problem with it right now, but it
>>>>>> feels a
>>>>>> bit wrong since index 0 is a valid region index. Maybe we
>>>>>> could
>>>>>> use another cleared marker.
>>>>> Unfortunately there is none (one could use something like -1,
>>>>> but
>>>>> that one is valid too), and it seems a waste of memory to
>>>>> reserve
>>>>> more space for it.
>>>>>
>>>>> I see your point that this is a bit ugly, but there should
>>>>> never be
>>>>> any issue because of the initialization of the value part of an
>>>>> entry with zero. It simply has no impact on totals if you add
>>>>> zero.
>>>>>
>>>>> The code could initialize the cache with region indices from 0
>>>>> to
>>>>> cache size - 1, which are valid values given the hash function,
>>>>> what do you think?
>>>>>
>>>>> However that would slow down clearing a little (the compiler
>>>>> will
>>>>> just compile it to a memset() in the loop right now).
>>>> You are correct that -1 is a valid index, but we seldom see heaps
>>>> with so many regions. I'm fine with leaving it as is, if you
>>>> dislike
>>>> using -1 and if it will slow down clearing.
>>> Just a bit. It seems as bad to use -1 or another random value, so I
>>> kept it.
>>>
>>> Webrevs:
>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.0_to_1/index.ht
>>> ml
>>> (diff)
>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1/index.html
>>> (full)
>>>
>>> Testing:
>>> This change ran, with some changes to 8180415 due to internal
>>> comments
>>> (I will post in a few minutes) through hs-tier 1-5 over night.
>>>
>>> Thanks,
>>> Thomas
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From sangheon.kim at oracle.com Tue Mar 13 21:40:11 2018
From: sangheon.kim at oracle.com (sangheon.kim)
Date: Tue, 13 Mar 2018 14:40:11 -0700
Subject: RFR (S): 8199326: Remove G1 gc time stamp logic
In-Reply-To: <1520523980.3121.29.camel@oracle.com>
References: <1520516013.3121.24.camel@oracle.com>
<7b19df2a-cac8-41d7-c3e9-d2cf893f9d85@oracle.com>
<1520523980.3121.29.camel@oracle.com>
Message-ID: <9ef3f6cb-4487-c03a-2d06-da6f5911972a@oracle.com>
Hi Thomas,
On 03/08/2018 07:46 AM, Thomas Schatzl wrote:
> On Thu, 2018-03-08 at 16:18 +0100, Stefan Johansson wrote:
>> Hi Thomas,
>>
>> On 2018-03-08 14:33, Thomas Schatzl wrote:
>>> Hi,
>>>
>>> with the rebuild remsets concurrently changes the last user of
>>> the gc
>>> time stamps (create live data) has gone away.
>>>
>>> This change removes all of the corresponding code I could find.
>>>
>>> Could you review it?
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8199326
>>> Webrev:
>>> http://cr.openjdk.java.net/~tschatzl/8197932/webrev/
>> Looks like you pasted the wrong link, and I couldn't find the
>> correct
>> one either.
> Sorry. The correct link is:
> http://cr.openjdk.java.net/~tschatzl/8199326/webrev
This looks good.
Thanks,
Sangheon
>
>
> Thomas
>
From thomas.schatzl at oracle.com Wed Mar 14 07:55:21 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 14 Mar 2018 08:55:21 +0100
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <4c671223-0d99-ef72-682a-402374cdb988@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
<8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
<1520412521.2346.4.camel@oracle.com>
<0cd6cca6-cace-4e4f-7f9c-152e20757dfe@oracle.com>
<1520949153.3100.27.camel@oracle.com>
<4c671223-0d99-ef72-682a-402374cdb988@oracle.com>
Message-ID: <1521014121.2381.11.camel@oracle.com>
Hi,
On Tue, 2018-03-13 at 14:39 -0700, sangheon.kim wrote:
> Hi Thomas,
>
> On 03/13/2018 06:52 AM, Thomas Schatzl wrote:
> > Hi Stefan,
> >
> > On Wed, 2018-03-07 at 11:12 +0100, Stefan Johansson wrote:
> > > Thanks Thomas,
> > >
> > >
[...]
> > In this particular case, contents of g1RegionMarkStatsCache had to
> > be distributed to .cpp and .inline.hpp files (recent .inline.hpp
> > include fixes), and I preemptively removed the use of one
> > VALUE_OBJ_CLASS_SPEC.
> >
> > Webrevs:
> > http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1_to_2/index.ht
> > ml
> > (diff)
> > http://cr.openjdk.java.net/~tschatzl/8197850/webrev.2/index.html
> > (full)
> Looks good, I have several minor comments.
>
> ===============================
> src/hotspot/share/gc/g1/g1CardLiveData.cpp
> 292 assert(!hr->is_old() || marked_bytes == (_cm-
> >liveness(hr->hrm_index()) * HeapWordSize),
> Don't we need to print assert message for hr->is_old()?
This is a pre-existing bug (or feature, depending on your POV) - for
humongous objects the regions are considered to be always full (by
definition), while obviously if there is only one live object in them,
they do not always fill all regions the humongous object is in.
Also, the marking attributes all of the humongous object size to the
starts region. There is need to distribute that.
So the assert does not hold for other type of regions at the moment.
This will be fixed with JDK-8178105 as far as my plan goes.
> ===============================
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp
> 4215 // Any worker id is fine here as we are in the VM thread
> and single-threaded.
>
> Would be better to add 'valid'?
> // Any valid worker id ...
Done.
> ===============================
> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
> 1840 log_debug(gc, stats)("Mark stats cache hits " SIZE_FORMAT "
> misses " SIZE_FORMAT " ratio %1.3lf",
> gc+stats is not registered at logPrefix.hpp, so currently GC ID is
> not printed. I guess this is not intensional?
This is a pre-existing issue. I filed JDK-8199598.
>
> ===============================
> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
> 25 #ifndef SHARE_VM_GC_G1_G1REGIONMARKSTATSCACHE_HPP
> I'm okay leaving as is but we don't have 'VM' directory anymore. At
> some point we would want to clean up these stuffs at once?
Yes.
> 61 // logical and.
> This seems incomplete sentence?
This refers to the logical and ("&") operation and seems correct.
New webrevs:
http://cr.openjdk.java.net/~tschatzl/8197850/webrev.2_to_3/ (diff)
http://cr.openjdk.java.net/~tschatzl/8197850/webrev.3/ (full)
Thanks,
Thomas
From thomas.schatzl at oracle.com Wed Mar 14 07:56:57 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 14 Mar 2018 08:56:57 +0100
Subject: RFR (XXXS): 8199516: Remove dead code overlooked during Full GC
work
In-Reply-To: <3e6d979c-4bce-f5cf-d465-17d742ee8ad7@oracle.com>
References: <1520948470.3100.21.camel@oracle.com>
<3e6d979c-4bce-f5cf-d465-17d742ee8ad7@oracle.com>
Message-ID: <1521014217.2381.12.camel@oracle.com>
Hi Sangheon and Stefan,
On Tue, 2018-03-13 at 07:30 -0700, sangheon.kim wrote:
> Hi Thomas,
>
> Looks good to me too.
>
> Thanks,
> Sangheon
>
thanks for your reviews.
Thomas
From erik.osterlund at oracle.com Wed Mar 14 10:16:35 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Wed, 14 Mar 2018 11:16:35 +0100
Subject: RFR(XS): JDK-8199559: objArrayKlass::oop_iterate() and friends
must use base_raw() instead of base()
In-Reply-To: <36ef9c8e-7278-1613-989e-acc929f2d2ed@redhat.com>
References: <36ef9c8e-7278-1613-989e-acc929f2d2ed@redhat.com>
Message-ID: <5AA8F683.2070801@oracle.com>
Hi Roman,
Looks good.
Thanks,
/Erik
On 2018-03-13 21:00, Roman Kennke wrote:
> Currently, objArrayKlass::oop_iterate() and related methods use base()
> to get the actual starting address of the array. However, base()
> resolves the oop via barriers. oop_iterate() is used solely by GC code,
> which requires direct access to the array, no matter which copy, and
> thus needs to use base_raw() instead.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8199559
> Webrev:
> http://cr.openjdk.java.net/~rkennke/8199559/webrev.00/
>
> Can I please get a review?
>
> Thanks, Roman
>
From thomas.schatzl at oracle.com Wed Mar 14 10:54:07 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Wed, 14 Mar 2018 11:54:07 +0100
Subject: RFR(XS): JDK-8199559: objArrayKlass::oop_iterate() and friends
must use base_raw() instead of base()
In-Reply-To: <36ef9c8e-7278-1613-989e-acc929f2d2ed@redhat.com>
References: <36ef9c8e-7278-1613-989e-acc929f2d2ed@redhat.com>
Message-ID: <1521024847.2380.0.camel@oracle.com>
Hi,
On Tue, 2018-03-13 at 21:00 +0100, Roman Kennke wrote:
> Currently, objArrayKlass::oop_iterate() and related methods use
> base()
> to get the actual starting address of the array. However, base()
> resolves the oop via barriers. oop_iterate() is used solely by GC
> code,
> which requires direct access to the array, no matter which copy, and
> thus needs to use base_raw() instead.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8199559
> Webrev:
> http://cr.openjdk.java.net/~rkennke/8199559/webrev.00/
>
> Can I please get a review?
looks good.
Thomas
From rkennke at redhat.com Wed Mar 14 14:30:33 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Wed, 14 Mar 2018 15:30:33 +0100
Subject: RFR: JDK-8199612: Replace remaining uses of G1BarrierSet::enqueue()
with appropriate Access API calls
Message-ID:
We still have 2 places where we call directly to
G1BarrierSet::enqueue(), those should use the appropriate Access API
instead.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8199612
Webrev:
http://cr.openjdk.java.net/~rkennke/8199612/webrev.00/
Passes: tier1_runtime tests, currently running all of tier1
Please review!
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From sangheon.kim at oracle.com Wed Mar 14 16:56:20 2018
From: sangheon.kim at oracle.com (sangheon.kim)
Date: Wed, 14 Mar 2018 09:56:20 -0700
Subject: RFR [L][3/7]: 8197850: Calculate liveness in regions during
marking
In-Reply-To: <1521014121.2381.11.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520260902.2532.66.camel@oracle.com>
<1520343234.2378.29.camel@oracle.com>
<8f7f25ef-f0c6-20f6-1584-b615dba234e1@oracle.com>
<1520412521.2346.4.camel@oracle.com>
<0cd6cca6-cace-4e4f-7f9c-152e20757dfe@oracle.com>
<1520949153.3100.27.camel@oracle.com>
<4c671223-0d99-ef72-682a-402374cdb988@oracle.com>
<1521014121.2381.11.camel@oracle.com>
Message-ID:
Hi Thomas,
On 03/14/2018 12:55 AM, Thomas Schatzl wrote:
> Hi,
>
> On Tue, 2018-03-13 at 14:39 -0700, sangheon.kim wrote:
>> Hi Thomas,
>>
>> On 03/13/2018 06:52 AM, Thomas Schatzl wrote:
>>> Hi Stefan,
>>>
>>> On Wed, 2018-03-07 at 11:12 +0100, Stefan Johansson wrote:
>>>> Thanks Thomas,
>>>>
>>>>
> [...]
>>> In this particular case, contents of g1RegionMarkStatsCache had to
>>> be distributed to .cpp and .inline.hpp files (recent .inline.hpp
>>> include fixes), and I preemptively removed the use of one
>>> VALUE_OBJ_CLASS_SPEC.
>>>
>>> Webrevs:
>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.1_to_2/index.ht
>>> ml
>>> (diff)
>>> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.2/index.html
>>> (full)
>> Looks good, I have several minor comments.
>>
>> ===============================
>> src/hotspot/share/gc/g1/g1CardLiveData.cpp
>> 292 assert(!hr->is_old() || marked_bytes == (_cm-
>>> liveness(hr->hrm_index()) * HeapWordSize),
>> Don't we need to print assert message for hr->is_old()?
> This is a pre-existing bug (or feature, depending on your POV) - for
> humongous objects the regions are considered to be always full (by
> definition), while obviously if there is only one live object in them,
> they do not always fill all regions the humongous object is in.
>
> Also, the marking attributes all of the humongous object size to the
> starts region. There is need to distribute that.
>
> So the assert does not hold for other type of regions at the moment.
>
> This will be fixed with JDK-8178105 as far as my plan goes.
Okay, thanks.
>
>> ===============================
>> src/hotspot/share/gc/g1/g1CollectedHeap.cpp
>> 4215 // Any worker id is fine here as we are in the VM thread
>> and single-threaded.
>>
>> Would be better to add 'valid'?
>> // Any valid worker id ...
> Done.
OK.
>
>> ===============================
>> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
>> 1840 log_debug(gc, stats)("Mark stats cache hits " SIZE_FORMAT "
>> misses " SIZE_FORMAT " ratio %1.3lf",
>> gc+stats is not registered at logPrefix.hpp, so currently GC ID is
>> not printed. I guess this is not intensional?
> This is a pre-existing issue. I filed JDK-8199598.
Thanks for filing a new one.
>
>> ===============================
>> src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp
>> 25 #ifndef SHARE_VM_GC_G1_G1REGIONMARKSTATSCACHE_HPP
>> I'm okay leaving as is but we don't have 'VM' directory anymore. At
>> some point we would want to clean up these stuffs at once?
> Yes.
OK
>
>> 61 // logical and.
>> This seems incomplete sentence?
> This refers to the logical and ("&") operation and seems correct.
My bad, sorry.
>
> New webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.2_to_3/ (diff)
> http://cr.openjdk.java.net/~tschatzl/8197850/webrev.3/ (full)
Looks good to me.
Thanks,
Sangheon
>
> Thanks,
> Thomas
>
From rkennke at redhat.com Wed Mar 14 18:13:51 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Wed, 14 Mar 2018 19:13:51 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
Message-ID: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
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/
What do you think?
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From rkennke at redhat.com Wed Mar 14 18:51:17 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Wed, 14 Mar 2018 19:51:17 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
Message-ID: <413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From rkennke at redhat.com Wed Mar 14 20:34:12 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Wed, 14 Mar 2018 21:34:12 +0100
Subject: RFR: JDK-8199612: Replace remaining uses of
G1BarrierSet::enqueue() with appropriate Access API calls
In-Reply-To:
References:
Message-ID: <08ea65a6-e682-ec80-f006-e974aec2e12b@redhat.com>
Am 14.03.2018 um 15:30 schrieb Roman Kennke:
> We still have 2 places where we call directly to
> G1BarrierSet::enqueue(), those should use the appropriate Access API
> instead.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8199612
> Webrev:
> http://cr.openjdk.java.net/~rkennke/8199612/webrev.00/
>
> Passes: tier1_runtime tests, currently running all of tier1
>
> Please review!
>
> Thanks, Roman
>
Apparently this is already being worked on elsewhere. I'm withdrawing
this RFR and bug-report.
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From Derek.White at cavium.com Wed Mar 14 22:22:07 2018
From: Derek.White at cavium.com (White, Derek)
Date: Wed, 14 Mar 2018 22:22:07 +0000
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
Message-ID:
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
From jini.george at oracle.com Thu Mar 15 04:21:13 2018
From: jini.george at oracle.com (Jini George)
Date: Thu, 15 Mar 2018 09:51:13 +0530
Subject: RFR: JDK-8175312: SA: clhsdb: Provide an improved heap summary
for 'universe' for G1GC
In-Reply-To:
References:
<38d71740-0b66-3ce8-26ed-a0f2b9f9e91c@oracle.com>
<5e8c582e-b32f-daf7-0e0c-1e6606ceaf3a@oracle.com>
<59c7ec4f-f9dc-7c25-e7bf-f3fc304b5c60@oracle.com>
Message-ID:
Thank you very much, Yumin. The modified webrev (after incorporating
your comment) is at:
http://cr.openjdk.java.net/~jgeorge/8175312/webrev.03/index.html
Thanks,
Jini.
On 3/13/2018 6:24 AM, yumin qi wrote:
> Jini,
>
> ? Looks good. One minor comment:
>
> + public void printG1HeapSummary(G1CollectedHeap heap) {
> + G1CollectedHeap g1h = (G1CollectedHeap) heap;
>
> ?'heap' has been cast to 'G1CollectedHeap' at call site, so seems no
> need to convert here again.
>
> Thanks
> Yumin
>
> On Mon, Mar 12, 2018 at 8:52 AM, Jini George > wrote:
>
> Thank you very much, Stefan. Could one more reviewer please take a
> look at it ?
>
> - Jini.
>
>
> On 3/12/2018 8:52 PM, Stefan Johansson wrote:
>
> Hi Jini,
>
> This looks good. I'm totally fine with skipping metaspace if
> that isn't displayed for the other GCs.
>
> Cheers,
> Stefan
>
> On 2018-03-09 10:29, Jini George wrote:
>
> Here is the revised webrev:
>
> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.02/
>
>
> I have made modifications to have the 'universe' command
> display details like:
>
> hsdb> universe
> Heap Parameters:
> garbage-first heap [0x0000000725200000, 0x00000007c0000000]
> region size 1024K
> G1 Heap:
> ?? regions? = 2478
> ?? capacity = 2598371328 (2478.0MB)
> ?? used???? = 5242880 (5.0MB)
> ?? free???? = 2593128448 (2473.0MB)
> ?? 0.20177562550443906% used
> G1 Young Generation:
> Eden Space:
> ?? regions? = 5
> ?? capacity = 8388608 (8.0MB)
> ?? used???? = 5242880 (5.0MB)
> ?? free???? = 3145728 (3.0MB)
> ?? 62.5% used
> Survivor Space:
> ?? regions? = 0
> ?? capacity = 0 (0.0MB)
> ?? used???? = 0 (0.0MB)
> ?? free???? = 0 (0.0MB)
> ?? 0.0% used
> G1 Old Generation:
> ?? regions? = 0
> ?? capacity = 155189248 (148.0MB)
> ?? used???? = 0 (0.0MB)
> ?? free???? = 155189248 (148.0MB)
> ?? 0.0% used
>
>
> I did not add the metaspace details since that did not seem
> to be in line with the 'universe' output for other GCs. I
> have added a new command "g1regiondetails" to display the
> region details, and have modified the tests accordingly.
>
> hsdb> g1regiondetails
> Region Details:
> Region:
> 0x0000000725200000,0x0000000725200000,0x0000000725300000:Free
> Region:
> 0x0000000725300000,0x0000000725300000,0x0000000725400000:Free
> Region:
> 0x0000000725400000,0x0000000725400000,0x0000000725500000:Free
> Region:
> 0x0000000725500000,0x0000000725500000,0x0000000725600000:Free
> Region:
> 0x0000000725600000,0x0000000725600000,0x0000000725700000:Free
> Region:
> 0x0000000725700000,0x0000000725700000,0x0000000725800000:Free
> ...
>
> Thanks,
> Jini.
>
>
> On 2/28/2018 12:56 PM, Jini George wrote:
>
> Thank you very much, Stefan. My answers inline.
>
> On 2/27/2018 3:30 PM, Stefan Johansson wrote:
>
> Hi Jini,
>
>
> JIRA
> ID:https://bugs.openjdk.java.net/browse/JDK-8175312
>
> Webrev:
> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.00/index.html
>
>
> It looks like a file is missing, did you forget to
> add it to the changeset?
>
>
> Indeed, I had missed that! I added the missing file in
> the following webrev:
>
> http://cr.openjdk.java.net/~jgeorge/8175312/webrev.01/
>
>
> ---
> open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java:36:
> error: cannot find symbol
> import sun.jvm.hotspot.gc.shared.PrintRegionClosure;
> ---
>
> Otherwise the change looks good, but I would like to
> see the output live. For a big heap this will print
> a lot of data, just wondering if the universe
> command is the correct choice for this kind of
> output. I like having the possibility to print all
> regions, so I want the change but maybe it should be
> a different command and 'universe' just prints a
> little more than before. Something like our logging
> heap-summary at shutdown:
> garbage-first heap?? total 16384K, used 3072K
> [0x00000000ff000000, 0x0000000100000000)
> ??region size 1024K, 4 young (4096K), 0 survivors (0K)
> Metaspace?????? used 6731K, capacity 6825K,
> committed 7040K, reserved 1056768K
> ??class space??? used 559K, capacity 594K,
> committed 640K, reserved 1048576K
>
>
> Ok, will add this, and could probably have the region
> details displayed under a new command called
> "g1regiondetails", or some such, and send out a new webrev.
>
> Thanks,
> Jini.
>
>
> Thanks,
> Stefan
>
> Modifications have been made to display the
> regions like:
>
> ...
> Region:
> 0x00000005c5400000,0x00000005c5600000,0x00000005c5600000:Old
> Region:
> 0x00000005c5600000,0x00000005c5800000,0x00000005c5800000:Old
> Region:
> 0x00000005c5800000,0x00000005c5a00000,0x00000005c5a00000:Old
> Region:
> 0x00000005c5a00000,0x00000005c5c00000,0x00000005c5c00000:Old
> Region:
> 0x00000005c5c00000,0x00000005c5c00000,0x00000005c5e00000:Free
> Region:
> 0x00000005c5e00000,0x00000005c5e00000,0x00000005c6000000:Free
> Region:
> 0x00000005c6000000,0x00000005c6200000,0x00000005c6200000:Old
> ...
>
> The jtreg test at this point does not
> include any testing for the display of
> archived or pinned regions. The testing for
> this will be added once JDK-8174994 is resolved.
>
> The SA tests pass with jprt and Mach5.
>
> Thanks,
> Jini.
>
>
>
>
From rkennke at redhat.com Thu Mar 15 10:20:32 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 15 Mar 2018 11:20:32 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To:
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
Message-ID: <531380d5-df59-b235-0b72-0748b1ce9d5d@redhat.com>
Hi Derek,
I did not provide an implementation for G1 because I am not in the
position to decide for G1 to use pinning or GCLocker. Nor do I know well
G1 enough that I could be confident to get it right.
The implementation should be fairly simple though: in Shenandoah we
simply set a flag in the heap region containing the object, and when we
get to build the collection set, skip the regions with the pinned flag set.
The JNI code should still call GCLocker::lock_critical() and
unlock_critical(). As long as the GC does not participate in the
protocol, this amounts to counting up and down.
It *is* possible to use both mechanisms in one GC even. For a while, in
Shenandoah, we considered to use pinning for concurrent phases, but use
the GCLocker protocol in full-GC, but we opted against it, because the
coordination between GCLocker, control thread, GC workers and mutators
seemed to error/deadlock-prone, and, TBH, critical arrays are not very
common and don't seem worth the hassle.
I hope that clarifies the idea a bit?
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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From per.liden at oracle.com Thu Mar 15 12:50:33 2018
From: per.liden at oracle.com (Per Liden)
Date: Thu, 15 Mar 2018 13:50:33 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
Message-ID: <75a17e6e-a8dd-3d79-26d8-7ae4eda08ce9@oracle.com>
Hi Roman,
On 03/14/2018 07:51 PM, Roman Kennke wrote:
> 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/
It seems your patch both grabs the GCLocker _and_ pins the object? I
would have assumed that the default implementation of pin_objct() would
be the one calling the GCLocker if pinning isn't supported by the GC.
Also, it seems that this patch doesn't take "critical native" functions
into account, i.e. those special functions which grabs the GCLocker
"lazily" when a safepoint happens. See
SafepointSynchronize::check_for_lazy_critical_native().
cheers,
Per
>
> Roman
>
From stefan.johansson at oracle.com Thu Mar 15 13:05:01 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Thu, 15 Mar 2018 14:05:01 +0100
Subject: RFR: 8199674: Improve G1 Full GC array marking
Message-ID: <64527c58-0876-47c8-cdf8-09dadfb08bf9@oracle.com>
Hi,
Please review this change to improve the Full GC marking code.
Links
JBS: https://bugs.openjdk.java.net/browse/JDK-8199674
Webrev: http://cr.openjdk.java.net/~sjohanss/8199674/00/
Summary
Currently when marking an object array it is split up to avoid one
worker doing all the work. The code iterates over a chunk of the array
and then push a task for the rest of the array to the marking stack. The
problem with this is that if the iteration it self don't find any new
pointers to follow, the next thing to do is to handle the next chunk in
the array. This make work-stealing problematic and the performance far
from optimal.
There are many schemes that can be used to improve the situation and we
might want to dig into this more at some point. The fix I propose here
is simple and easy but gives good improvements to the micro benchmarks
I've tested it on. The fix is to push the task for the rest of the array
onto the mark stack before doing the iteration of the current chunk.
Testing
Functional testing through mach5 and local performance testing. Created
two small JMH benchmarks that create a big object array, one fills it
with object the other one is completely empty.
Baseline:
Benchmark????????????????? Mode? Cnt??? Score??? Error? Units
SystemGCOneBigEmpty.bench??? ss?? 25?? 179.740 ??? 8.497? ms/op
SystemGCOneBigFull.bench???? ss?? 25? 5220.095 ? 192.680? ms/op
With patch applied:
Benchmark????????????????? Mode? Cnt??? Score???? Error? Units
SystemGCOneBigEmpty.bench??? ss?? 25?? 111.854 ?? 7.596? ms/op
SystemGCOneBigFull.bench???? ss?? 25? 1713.544 ? 36.956? ms/op
These benchmarks measure the whole time of the Full GC and not only the
marking times but the improvement is still pretty clear.
Thanks,
Stefan
From shade at redhat.com Thu Mar 15 13:11:11 2018
From: shade at redhat.com (Aleksey Shipilev)
Date: Thu, 15 Mar 2018 14:11:11 +0100
Subject: RFR: 8199674: Improve G1 Full GC array marking
In-Reply-To: <64527c58-0876-47c8-cdf8-09dadfb08bf9@oracle.com>
References: <64527c58-0876-47c8-cdf8-09dadfb08bf9@oracle.com>
Message-ID: <2cb74c0a-76bb-eca0-b0ef-8d41a6676965@redhat.com>
On 03/15/2018 02:05 PM, Stefan Johansson wrote:
> JBS: https://bugs.openjdk.java.net/browse/JDK-8199674
> Webrev: http://cr.openjdk.java.net/~sjohanss/8199674/00/
Yes, of course. It is silly to do this in other order :)
I'll add a new line in-between here, because those blocks are logically separate:
115 array->oop_iterate_range(mark_closure(), beg_index, end_index);
116 if (VerifyDuringGC) {
-Aleksey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL:
From rkennke at redhat.com Thu Mar 15 13:13:24 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 15 Mar 2018 14:13:24 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <75a17e6e-a8dd-3d79-26d8-7ae4eda08ce9@oracle.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
<75a17e6e-a8dd-3d79-26d8-7ae4eda08ce9@oracle.com>
Message-ID:
Am 15.03.2018 um 13:50 schrieb Per Liden:
> Hi Roman,
>
> On 03/14/2018 07:51 PM, Roman Kennke wrote:
>> 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/
>
> It seems your patch both grabs the GCLocker _and_ pins the object? I
> would have assumed that the default implementation of pin_objct() would
> be the one calling the GCLocker if pinning isn't supported by the GC.
As I explained to Derek, this is kindof intentional. Calling into
GCLocker::lock_critical() and GCLocker::unlock_critical() does nothing
in the way of waiting or blocking or otherwise harmful, as long as the
GC does not participate in the protocol. This way a GC could infact use
both mechanisms, e.g. using pinning and ignore GCLocker for the pauses
around concurrent phases, and ignore pinning and use GCLocker for
full-GC pauses.
> Also, it seems that this patch doesn't take "critical native" functions
> into account, i.e. those special functions which grabs the GCLocker
> "lazily" when a safepoint happens. See
> SafepointSynchronize::check_for_lazy_critical_native().
I am not sure that I'd have to do anything there? What's this supposed
to do? Prevent to reach a GC safepoint as long as such a function is in
progress? With what purpose? Can you give me an example?
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From thomas.schatzl at oracle.com Thu Mar 15 13:17:01 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Thu, 15 Mar 2018 14:17:01 +0100
Subject: RFR: 8199674: Improve G1 Full GC array marking
In-Reply-To: <64527c58-0876-47c8-cdf8-09dadfb08bf9@oracle.com>
References: <64527c58-0876-47c8-cdf8-09dadfb08bf9@oracle.com>
Message-ID: <1521119821.2448.27.camel@oracle.com>
Hi,
On Thu, 2018-03-15 at 14:05 +0100, Stefan Johansson wrote:
> Hi,
>
> Please review this change to improve the Full GC marking code.
>
[...]
> The fix is to push the task for the
> rest of the array onto the mark stack before doing the iteration of
> the current chunk.
>
looks good. Please add the suggested newline before pushing.
Thanks,
Thomas
From stefan.johansson at oracle.com Thu Mar 15 13:26:33 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Thu, 15 Mar 2018 14:26:33 +0100
Subject: RFR: 8199674: Improve G1 Full GC array marking
In-Reply-To: <1521119821.2448.27.camel@oracle.com>
References: <64527c58-0876-47c8-cdf8-09dadfb08bf9@oracle.com>
<1521119821.2448.27.camel@oracle.com>
Message-ID: <12e5c3ad-1a45-ea9b-96cb-3587043c0bcc@oracle.com>
Thanks Thomas and Aleksey,
I will add the newline and push tomorrow.
Cheers,
Stefan
On 2018-03-15 14:17, Thomas Schatzl wrote:
> Hi,
>
> On Thu, 2018-03-15 at 14:05 +0100, Stefan Johansson wrote:
>> Hi,
>>
>> Please review this change to improve the Full GC marking code.
>>
> [...]
>> The fix is to push the task for the
>> rest of the array onto the mark stack before doing the iteration of
>> the current chunk.
>>
> looks good. Please add the suggested newline before pushing.
>
> Thanks,
> Thomas
>
>
From rkennke at redhat.com Thu Mar 15 13:31:17 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 15 Mar 2018 14:31:17 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <75a17e6e-a8dd-3d79-26d8-7ae4eda08ce9@oracle.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
<75a17e6e-a8dd-3d79-26d8-7ae4eda08ce9@oracle.com>
Message-ID: <92582a69-5b07-e844-5a5f-036679e90ff1@redhat.com>
Am 15.03.2018 um 13:50 schrieb Per Liden:
> Hi Roman,
>
> On 03/14/2018 07:51 PM, Roman Kennke wrote:
>> 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/
>
> It seems your patch both grabs the GCLocker _and_ pins the object? I
> would have assumed that the default implementation of pin_objct() would
> be the one calling the GCLocker if pinning isn't supported by the GC.
>
> Also, it seems that this patch doesn't take "critical native" functions
> into account, i.e. those special functions which grabs the GCLocker
> "lazily" when a safepoint happens. See
> SafepointSynchronize::check_for_lazy_critical_native().
>
I researched a little, and this seems only be used in:
src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c
src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCryptoMD.c
and it is an optional internal feature, to be turned off by
-CriticalJNINatives and only used in Solaris. Opting to ignore it must
be safe, or not?
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From Derek.White at cavium.com Thu Mar 15 15:38:56 2018
From: Derek.White at cavium.com (White, Derek)
Date: Thu, 15 Mar 2018 15:38:56 +0000
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <531380d5-df59-b235-0b72-0748b1ce9d5d@redhat.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
<531380d5-df59-b235-0b72-0748b1ce9d5d@redhat.com>
Message-ID:
Hi Roman,
Thanks for clearing that up. I didn't consider a GC opting out of the GCLocker protocol.
[BTW, asking as a GC enthusiast, no longer a GC professional]
Is there a danger that the API for these two options of freezing an object (pinning vs. gc lock-out) being too disjoint and asymmetrical?
The GCLocker::lock_critical() API knows the thread requesting the lock, but nothing about the object (address, size, type, etc) while the pinning API knows all of that.
You could imagine schemes that would take object information into account when deciding to lock-out or to pin. For example, pinning an object that fully occupies a region has no drawbacks, while pinning tiny objects might end up protecting a lot of garbage (and these are cases that would have had short lock-out durations anyway).
I don't see how the proposed API could support this case. But if you consider handling this case over-engineering for the problem at hand, I understand.
- Derek
> -----Original Message-----
> From: Roman Kennke [mailto:rkennke at redhat.com]
> Sent: Thursday, March 15, 2018 6:21 AM
> To: White, Derek ; hotspot-gc-
> dev at openjdk.java.net
> Subject: Re: RFR: JDK-8199620: Support for JNI object pinning
>
> Hi Derek,
>
> I did not provide an implementation for G1 because I am not in the position
> to decide for G1 to use pinning or GCLocker. Nor do I know well
> G1 enough that I could be confident to get it right.
>
> The implementation should be fairly simple though: in Shenandoah we
> simply set a flag in the heap region containing the object, and when we get
> to build the collection set, skip the regions with the pinned flag set.
>
> The JNI code should still call GCLocker::lock_critical() and unlock_critical(). As
> long as the GC does not participate in the protocol, this amounts to counting
> up and down.
>
> It *is* possible to use both mechanisms in one GC even. For a while, in
> Shenandoah, we considered to use pinning for concurrent phases, but use
> the GCLocker protocol in full-GC, but we opted against it, because the
> coordination between GCLocker, control thread, GC workers and mutators
> seemed to error/deadlock-prone, and, TBH, critical arrays are not very
> common and don't seem worth the hassle.
>
> I hope that clarifies the idea a bit?
>
> 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
> >
>
From rkennke at redhat.com Thu Mar 15 16:57:43 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Thu, 15 Mar 2018 17:57:43 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To:
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
<413a2cd0-295f-e179-ff79-84f135b05b05@redhat.com>
<531380d5-df59-b235-0b72-0748b1ce9d5d@redhat.com>
Message-ID: <35D6A087-024B-4883-82CE-A269A3D04200@redhat.com>
The calls into GCLocker in jni.cpp are only the JNI part of the protocol. The GC must still do its part to initiate the actual wait-and-retry when no threads are in critical region. It is conceivable with the proposed API that the GC sees a small object in a region of otherwise garbage and elects to participate in GCLocker instead of pinning the object / region, on a case-by-case basis.
What I'm not sure about is support for CriticalJNINatives... This does not seem easily possible without GCLocker. But I would consider that optional.
Thanks, Roman
Am 15. M?rz 2018 16:38:56 MEZ schrieb "White, Derek" :
>Hi Roman,
>
>Thanks for clearing that up. I didn't consider a GC opting out of the
>GCLocker protocol.
>
>[BTW, asking as a GC enthusiast, no longer a GC professional]
>
>Is there a danger that the API for these two options of freezing an
>object (pinning vs. gc lock-out) being too disjoint and asymmetrical?
>
>The GCLocker::lock_critical() API knows the thread requesting the lock,
>but nothing about the object (address, size, type, etc) while the
>pinning API knows all of that.
>
>You could imagine schemes that would take object information into
>account when deciding to lock-out or to pin. For example, pinning an
>object that fully occupies a region has no drawbacks, while pinning
>tiny objects might end up protecting a lot of garbage (and these are
>cases that would have had short lock-out durations anyway).
>
>I don't see how the proposed API could support this case. But if you
>consider handling this case over-engineering for the problem at hand, I
>understand.
>
> - Derek
>
>> -----Original Message-----
>> From: Roman Kennke [mailto:rkennke at redhat.com]
>> Sent: Thursday, March 15, 2018 6:21 AM
>> To: White, Derek ; hotspot-gc-
>> dev at openjdk.java.net
>> Subject: Re: RFR: JDK-8199620: Support for JNI object pinning
>>
>> Hi Derek,
>>
>> I did not provide an implementation for G1 because I am not in the
>position
>> to decide for G1 to use pinning or GCLocker. Nor do I know well
>> G1 enough that I could be confident to get it right.
>>
>> The implementation should be fairly simple though: in Shenandoah we
>> simply set a flag in the heap region containing the object, and when
>we get
>> to build the collection set, skip the regions with the pinned flag
>set.
>>
>> The JNI code should still call GCLocker::lock_critical() and
>unlock_critical(). As
>> long as the GC does not participate in the protocol, this amounts to
>counting
>> up and down.
>>
>> It *is* possible to use both mechanisms in one GC even. For a while,
>in
>> Shenandoah, we considered to use pinning for concurrent phases, but
>use
>> the GCLocker protocol in full-GC, but we opted against it, because
>the
>> coordination between GCLocker, control thread, GC workers and
>mutators
>> seemed to error/deadlock-prone, and, TBH, critical arrays are not
>very
>> common and don't seem worth the hassle.
>>
>> I hope that clarifies the idea a bit?
>>
>> 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
>> >
>>
--
Diese Nachricht wurde von meinem Android-Ger?t mit K-9 Mail gesendet.
From irogers at google.com Thu Mar 15 17:49:53 2018
From: irogers at google.com (Ian Rogers)
Date: Thu, 15 Mar 2018 17:49:53 +0000
Subject: GetPrimitiveArrayCritical vs GetByteArrayRegion: 140x slow-down
using -Xcheck:jni and java.util.zip.DeflaterOutputStream
In-Reply-To: <1521102348.2448.25.camel@oracle.com>
References:
<22bbd632-47c1-7702-bd65-6a51f0bbad02@oracle.com>
<9b5ff318-af41-03c4-efdc-b41b97cf6e61@oracle.com>
<5A9D8C60.3050505@oracle.com> <5A9D8F33.5060500@oracle.com>
<5A9DAC84.906@oracle.com> <5A9DAE87.8020801@oracle.com>
<1521102348.2448.25.camel@oracle.com>
Message-ID:
+hotspot-gc-dev
On Thu, Mar 15, 2018 at 1:25 AM Thomas Schatzl
wrote:
> Hi,
>
> On Thu, 2018-03-15 at 01:00 +0000, Ian Rogers wrote:
> > An old data point on how large a critical region should be comes from
> > java.nio.Bits. In JDK 9 the code migrated into unsafe, but in JDK 8
> > the copies within a critical region were bound at most copying 1MB:
> > http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/
> > native/java/nio/Bits.c#l88 This is inconsistent with Deflater and
> > ObjectOutputStream which both allow unlimited arrays and thereby
> > critical region sizes.
> >
> > In JDK 9 the copies starve the garbage collector in nio Bits too as
> > there is no 1MB limit to the copy sizes:
> > http://hg.openjdk.java.net/jdk/jdk/rev/f70e100d3195
> > which came from:
> > https://bugs.openjdk.java.net/browse/JDK-8149596
> >
> > Perhaps this is a regression not demonstrated due to the testing
> > challenge.
> > [...]
> > It doesn't seem unreasonable to have the loops for the copies occur
> > in 1MB chunks but JDK-8149596 lost this and so I'm confused on what
> > the HotSpot stand point is.
>
> Please file a bug (seems to be a core-libs/java.nio regression?),
> preferably with some kind of regression test. Also file enhancements (I
> would guess) for the other cases allowing unlimited arrays.
>
I don't have perms to file bugs there's some catch-22 scenario in getting
the permissions. Happy to have a bug filed or to file were that not an
issue. Happy to create a test case but can't see any others for TTSP
issues. This feels like a potential use case for jmh, perhaps run the
benchmark well having a separate thread run GC bench.
Should there be a bug to add, in debug mode, a TTSP watcher thread whose
job it is to bring "random" threads into safepoints and report on tardy
ones?
Should there be a bug to warn on being in a JNI critical for more than just
a short period?
Seems like there should be a bug on Unsafe.copyMemory and
Unsafe.copySwapMemory having TTSP issues.
Seems like there should be a bug on all uses of critical that don't chunk
their critical region work based on some bound (like 1MB chunks for nio
Bits)? How are these bounds set? A past reference that I've lost is in
having the bound be the equivalent of 65535 bytecodes due to the
expectation of GC work at least once in a method or on a loop backedge - I
thought this was in a spec somewhere but now I can't find it. The bytecode
size feels as arbitrary as 1MB, a time period would be better but that can
depend on the kind of GC you want as delays with concurrent GC mean more
than non-concurrent. Clearly the chunk size shouldn't just be 0, but this
appears to currently be the norm in the JDK.
The original reason for coming here was a 140x slow down in -Xcheck:jni in
Deflater.deflate There are a few options there that its useful to enumerate:
1) rewrite in Java but there are correctness and open source related issues
2) remove underflow/overflow protection from critical arrays (revert
JDK-6311046
or perhaps bound protection to arrays of a particular small size) - this
removes checking and doesn't deal with TTSP
3) add a critical array slice API to JNI so that copies with -Xcheck:jni
aren't unbounded (martinrb@ proposed this) - keeps checking but doesn't
deal with TTSP
4) rewrite primitive array criticals with GetArrayRegion as O(n) beats the
"silent killer" TTSP (effectively deprecate the critical APIs)
In general (ie not just the deflate case) I think (1) is the most
preferable. (2) and (3) both have TTSP issues. (4) isn't great performance
wise, which motivates more use of approach (1), but I think deprecating
criticals may just be the easiest and sanest way forward. I think that
discussion is worth having on an e-mail thread rather than a bug.
> Long TTSP is a performance bug as any other.
>
> > In a way criticals are better than unsafe as they may
> > pin the memory and not starve GC, which shenandoah does.
>
> (Region based) Object pinning has its own share of problems:
>
> - only (relatively) easily implemented in region based collectors
>
> - may slow down pause a bit in presence of pinned regions/objects (for
> non-concurrent copying collectors)
>
> - excessive use of pinning may cause OOME and VM exit probably earlier
> than the gc locker. GC locker seems to provide a more gradual
> degradation. E.g. pinning regions typically makes these regions
> unavailable for allocation.
> I.e. you still should not use it for many, very long living objects.
> Of course this somewhat depends on the sophistication of the
> implementation.
>
> I think region based pinning would be a good addition to other
> collectors than Shenandoah too. It has been on our minds for a long
> time, but there are so many other more important issues :), so of
> course we are eager to see contributions in this area. ;)
>
> If you are interested on working on this, please ping us on hotspot-gc-
> dev for implementation ideas to get you jump-started.
>
> Thanks,
> Thomas
>
I'd rather deprecate criticals than build upon the complexity, but I'm very
glad this is a concern.
Thanks,
Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From coleen.phillimore at oracle.com Thu Mar 15 23:30:30 2018
From: coleen.phillimore at oracle.com (coleen.phillimore at oracle.com)
Date: Thu, 15 Mar 2018 19:30:30 -0400
Subject: RFR (XXS) 8199716: Unused AdjustKlassClosure in psParallelCompact.hpp
Message-ID: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
open webrev at http://cr.openjdk.java.net/~coleenp/8199716.01/webrev
bug link https://bugs.openjdk.java.net/browse/JDK-8199716
Tested with mach5 tier1.
thanks,
Coleen
From stefan.karlsson at oracle.com Fri Mar 16 06:25:25 2018
From: stefan.karlsson at oracle.com (Stefan Karlsson)
Date: Fri, 16 Mar 2018 07:25:25 +0100
Subject: RFR (XXS) 8199716: Unused AdjustKlassClosure in
psParallelCompact.hpp
In-Reply-To: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
References: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
Message-ID: <836165f1-0149-eb5c-0a8c-f6e2c7e2ce69@oracle.com>
Looks good.
StefanK
On 2018-03-16 00:30, coleen.phillimore at oracle.com wrote:
> open webrev at http://cr.openjdk.java.net/~coleenp/8199716.01/webrev
> bug link https://bugs.openjdk.java.net/browse/JDK-8199716
>
> Tested with mach5 tier1.
> thanks,
> Coleen
From thomas.schatzl at oracle.com Fri Mar 16 07:56:30 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Fri, 16 Mar 2018 08:56:30 +0100
Subject: RFR (XXS) 8199716: Unused AdjustKlassClosure in
psParallelCompact.hpp
In-Reply-To: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
References: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
Message-ID: <1521186990.2391.0.camel@oracle.com>
Hi,
On Thu, 2018-03-15 at 19:30 -0400, coleen.phillimore at oracle.com wrote:
> open webrev at http://cr.openjdk.java.net/~coleenp/8199716.01/webrev
> bug link https://bugs.openjdk.java.net/browse/JDK-8199716
>
> Tested with mach5 tier1.
looks good.
Thomas
From coleen.phillimore at oracle.com Fri Mar 16 12:00:59 2018
From: coleen.phillimore at oracle.com (coleen.phillimore at oracle.com)
Date: Fri, 16 Mar 2018 08:00:59 -0400
Subject: RFR (XXS) 8199716: Unused AdjustKlassClosure in
psParallelCompact.hpp
In-Reply-To: <836165f1-0149-eb5c-0a8c-f6e2c7e2ce69@oracle.com>
References: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
<836165f1-0149-eb5c-0a8c-f6e2c7e2ce69@oracle.com>
Message-ID:
Thanks, I think this is trivial.
Coleen
On 3/16/18 2:25 AM, Stefan Karlsson wrote:
> Looks good.
>
> StefanK
>
> On 2018-03-16 00:30, coleen.phillimore at oracle.com wrote:
>> open webrev at http://cr.openjdk.java.net/~coleenp/8199716.01/webrev
>> bug link https://bugs.openjdk.java.net/browse/JDK-8199716
>>
>> Tested with mach5 tier1.
>> thanks,
>> Coleen
>
>
From coleen.phillimore at oracle.com Fri Mar 16 12:33:11 2018
From: coleen.phillimore at oracle.com (coleen.phillimore at oracle.com)
Date: Fri, 16 Mar 2018 08:33:11 -0400
Subject: RFR (XXS) 8199716: Unused AdjustKlassClosure in
psParallelCompact.hpp
In-Reply-To: <1521186990.2391.0.camel@oracle.com>
References: <6a8f8ff2-a95d-6d98-e52a-ec6c2cd112cd@oracle.com>
<1521186990.2391.0.camel@oracle.com>
Message-ID: <321ed2b1-ca6c-b864-eebc-3ba981ee5080@oracle.com>
Thanks! (I just pushed it as trivial)
Coleen
On 3/16/18 3:56 AM, Thomas Schatzl wrote:
> Hi,
>
> On Thu, 2018-03-15 at 19:30 -0400, coleen.phillimore at oracle.com wrote:
>> open webrev at http://cr.openjdk.java.net/~coleenp/8199716.01/webrev
>> bug link https://bugs.openjdk.java.net/browse/JDK-8199716
>>
>> Tested with mach5 tier1.
> looks good.
>
> Thomas
From irogers at google.com Fri Mar 16 17:19:58 2018
From: irogers at google.com (Ian Rogers)
Date: Fri, 16 Mar 2018 17:19:58 +0000
Subject: GetPrimitiveArrayCritical vs GetByteArrayRegion: 140x slow-down
using -Xcheck:jni and java.util.zip.DeflaterOutputStream
In-Reply-To: <23639144-5217-4A0F-930C-EF24B4976544@oracle.com>
References:
<22bbd632-47c1-7702-bd65-6a51f0bbad02@oracle.com>
<9b5ff318-af41-03c4-efdc-b41b97cf6e61@oracle.com>
<5A9D8C60.3050505@oracle.com> <5A9D8F33.5060500@oracle.com>
<5A9DAC84.906@oracle.com> <5A9DAE87.8020801@oracle.com>
<1521102348.2448.25.camel@oracle.com>
<23639144-5217-4A0F-930C-EF24B4976544@oracle.com>
Message-ID:
Thanks Paul, very interesting.
On Fri, Mar 16, 2018 at 9:21 AM Paul Sandoz wrote:
> Hi Ian, Thomas,
>
> Some background on the bulk copying for byte buffers after talking with
> Mikael who worked on these changes a few years ago.
>
> Please correct the following if needed as our memory is hazy :-)
>
> IIRC at the time we felt this was a reasonable thing to do because C2 did
> not strip mine the loops for the bulk copying of large Java arrays i.e. the
> issue was there anyway for more common cases. However, i believe that may
> no longer be the so in some cases after Roland implemented loop strip
> mining in C2 [1]. So we should go back and revisit/check the current
> support in buffers and Java arrays (System.arraycopy etc).
>
The C2 issue is a well known TTSP issue :-) Its great that there is a strip
mining optimization, revisiting the bulk copies would be great!
> (This is also something we need to consider if we modify buffers to
> support capacities larger than Integer.MAX_VALUE. Also connects with
> Project Panama.)
>
> If Thomas has not done so or does not plan to i can log an issue for you.
>
That'd be great. I wonder if identifying more TTSP issues should also be a
bug. Its interesting to observe that overlooking TTSP in C2 motivated the
Unsafe.copyMemory change permitting a fresh TTSP issue. If TTSP is a 1st
class issue then maybe we can deprecate JNI critical regions to support
that effort :-)
Thanks,
Ian
> Paul.
>
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8186027
>
> On Mar 15, 2018, at 10:49 AM, Ian Rogers wrote:
>
> +hotspot-gc-dev
>
> On Thu, Mar 15, 2018 at 1:25 AM Thomas Schatzl
> wrote:
>
> Hi,
>
> On Thu, 2018-03-15 at 01:00 +0000, Ian Rogers wrote:
>
> An old data point on how large a critical region should be comes from
> java.nio.Bits. In JDK 9 the code migrated into unsafe, but in JDK 8
> the copies within a critical region were bound at most copying 1MB:
> http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/
> native/java/nio/Bits.c#l88 This is inconsistent with Deflater and
> ObjectOutputStream which both allow unlimited arrays and thereby
> critical region sizes.
>
> In JDK 9 the copies starve the garbage collector in nio Bits too as
> there is no 1MB limit to the copy sizes:
> http://hg.openjdk.java.net/jdk/jdk/rev/f70e100d3195
> which came from:
> https://bugs.openjdk.java.net/browse/JDK-8149596
>
> Perhaps this is a regression not demonstrated due to the testing
> challenge.
> [...]
> It doesn't seem unreasonable to have the loops for the copies occur
> in 1MB chunks but JDK-8149596 lost this and so I'm confused on what
> the HotSpot stand point is.
>
>
> Please file a bug (seems to be a core-libs/java.nio regression?),
> preferably with some kind of regression test. Also file enhancements (I
> would guess) for the other cases allowing unlimited arrays.
>
>
> I don't have perms to file bugs there's some catch-22 scenario in getting
> the permissions. Happy to have a bug filed or to file were that not an
> issue. Happy to create a test case but can't see any others for TTSP
> issues. This feels like a potential use case for jmh, perhaps run the
> benchmark well having a separate thread run GC bench.
>
> Should there be a bug to add, in debug mode, a TTSP watcher thread whose
> job it is to bring "random" threads into safepoints and report on tardy
> ones?
> Should there be a bug to warn on being in a JNI critical for more than just
> a short period?
> Seems like there should be a bug on Unsafe.copyMemory and
> Unsafe.copySwapMemory having TTSP issues.
> Seems like there should be a bug on all uses of critical that don't chunk
> their critical region work based on some bound (like 1MB chunks for nio
> Bits)? How are these bounds set? A past reference that I've lost is in
> having the bound be the equivalent of 65535 bytecodes due to the
> expectation of GC work at least once in a method or on a loop backedge - I
> thought this was in a spec somewhere but now I can't find it. The bytecode
> size feels as arbitrary as 1MB, a time period would be better but that can
> depend on the kind of GC you want as delays with concurrent GC mean more
> than non-concurrent. Clearly the chunk size shouldn't just be 0, but this
> appears to currently be the norm in the JDK.
>
> The original reason for coming here was a 140x slow down in -Xcheck:jni in
> Deflater.deflate There are a few options there that its useful to
> enumerate:
> 1) rewrite in Java but there are correctness and open source related issues
> 2) remove underflow/overflow protection from critical arrays (revert
> JDK-6311046
> or perhaps bound protection to arrays of a particular small size) - this
> removes checking and doesn't deal with TTSP
> 3) add a critical array slice API to JNI so that copies with -Xcheck:jni
> aren't unbounded (martinrb@ proposed this) - keeps checking but doesn't
> deal with TTSP
> 4) rewrite primitive array criticals with GetArrayRegion as O(n) beats the
> "silent killer" TTSP (effectively deprecate the critical APIs)
>
> In general (ie not just the deflate case) I think (1) is the most
> preferable. (2) and (3) both have TTSP issues. (4) isn't great performance
> wise, which motivates more use of approach (1), but I think deprecating
> criticals may just be the easiest and sanest way forward. I think that
> discussion is worth having on an e-mail thread rather than a bug.
>
>
> Long TTSP is a performance bug as any other.
>
> In a way criticals are better than unsafe as they may
> pin the memory and not starve GC, which shenandoah does.
>
>
> (Region based) Object pinning has its own share of problems:
>
> - only (relatively) easily implemented in region based collectors
>
> - may slow down pause a bit in presence of pinned regions/objects (for
> non-concurrent copying collectors)
>
> - excessive use of pinning may cause OOME and VM exit probably earlier
> than the gc locker. GC locker seems to provide a more gradual
> degradation. E.g. pinning regions typically makes these regions
> unavailable for allocation.
> I.e. you still should not use it for many, very long living objects.
> Of course this somewhat depends on the sophistication of the
> implementation.
>
> I think region based pinning would be a good addition to other
> collectors than Shenandoah too. It has been on our minds for a long
> time, but there are so many other more important issues :), so of
> course we are eager to see contributions in this area. ;)
>
> If you are interested on working on this, please ping us on hotspot-gc-
> dev for implementation ideas to get you jump-started.
>
> Thanks,
> Thomas
>
>
> I'd rather deprecate criticals than build upon the complexity, but I'm very
> glad this is a concern.
>
> Thanks,
> Ian
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From thomas.schatzl at oracle.com Mon Mar 19 09:28:07 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 19 Mar 2018 10:28:07 +0100
Subject: GetPrimitiveArrayCritical vs GetByteArrayRegion: 140x slow-down
using -Xcheck:jni and java.util.zip.DeflaterOutputStream
In-Reply-To:
References:
<22bbd632-47c1-7702-bd65-6a51f0bbad02@oracle.com>
<9b5ff318-af41-03c4-efdc-b41b97cf6e61@oracle.com>
<5A9D8C60.3050505@oracle.com> <5A9D8F33.5060500@oracle.com>
<5A9DAC84.906@oracle.com> <5A9DAE87.8020801@oracle.com>
<1521102348.2448.25.camel@oracle.com>
<23639144-5217-4A0F-930C-EF24B4976544@oracle.com>
Message-ID: <1521451687.2323.5.camel@oracle.com>
Hi,
On Fri, 2018-03-16 at 17:19 +0000, Ian Rogers wrote:
> Thanks Paul, very interesting.
>
> On Fri, Mar 16, 2018 at 9:21 AM Paul Sandoz
> wrote:
> > Hi Ian, Thomas,
> >
> > [...]
> > (This is also something we need to consider if we modify buffers to
> > support capacities larger than Integer.MAX_VALUE. Also connects
> > with Project Panama.)
> >
> > If Thomas has not done so or does not plan to i can log an issue
> > for you.
> >
>
> That'd be great. I wonder if identifying more TTSP issues should also
> be a bug. Its interesting to observe that overlooking TTSP in C2
> motivated the Unsafe.copyMemory change permitting a fresh TTSP issue.
> If TTSP is a 1st class issue then maybe we can deprecate JNI critical
> regions to support that effort :-)
Please log an issue. I am still a bit unsure what and how many issues
should be filed.
@Ian: at bugreports.oracle.com everyone may file bug reports without
the need for an account.
It will take some time until they show up in Jira due to vetting, but
if you have a good case, and can e.g. link to the mailing list, this
should be painless.
Thanks,
Thomas
From rkennke at redhat.com Mon Mar 19 10:40:30 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Mon, 19 Mar 2018 11:40:30 +0100
Subject: RFR: JDK-8199735: Mark word updates need to use Access API
Message-ID: <7bd73e32-a26b-2504-f069-b74807ae5e53@redhat.com>
Currently, the mark word is accessed directly in oopDesc::mark()
set_mark() and a bunch of other accessors. Those need to use the Access
API instead because GC might want to employ barriers on those accesses,
pretty much like every other field in oopDesc.
Notice that this is *not* about accessing the bits and fields inside the
markOop, but about accessing the header itself.
http://cr.openjdk.java.net/~rkennke/JDK-8199735/webrev.01/
Testing: build fastdebug/release with and without PCH, passed tier1
fastdebug/release.
Can I please get reviews?
Thanks, Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From rkennke at redhat.com Mon Mar 19 11:07:08 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Mon, 19 Mar 2018 12:07:08 +0100
Subject: RFR: JDK-8199735: Mark word updates need to use Access API
In-Reply-To: <7bd73e32-a26b-2504-f069-b74807ae5e53@redhat.com>
References: <7bd73e32-a26b-2504-f069-b74807ae5e53@redhat.com>
Message-ID: <859ac657-78c9-c7ab-0ec0-eddda331001b@redhat.com>
Am 19.03.2018 um 11:40 schrieb Roman Kennke:
> Currently, the mark word is accessed directly in oopDesc::mark()
> set_mark() and a bunch of other accessors. Those need to use the Access
> API instead because GC might want to employ barriers on those accesses,
> pretty much like every other field in oopDesc.
>
> Notice that this is *not* about accessing the bits and fields inside the
> markOop, but about accessing the header itself.
>
> http://cr.openjdk.java.net/~rkennke/JDK-8199735/webrev.01/
>
> Testing: build fastdebug/release with and without PCH, passed tier1
> fastdebug/release.
>
> Can I please get reviews?
>
> Thanks, Roman
>
Just when I sent it, I realized that this is dropping the volatile from
the mark word access. Fixed here:
http://cr.openjdk.java.net/~rkennke/JDK-8199735/webrev.02/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From thomas.schatzl at oracle.com Mon Mar 19 12:03:49 2018
From: thomas.schatzl at oracle.com (Thomas Schatzl)
Date: Mon, 19 Mar 2018 13:03:49 +0100
Subject: RFR [M][7/7]: 8197932: Better split work in rebuild remembered
sets phase
In-Reply-To: <1520953401.3100.41.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520265115.2532.126.camel@oracle.com>
<1520953401.3100.41.camel@oracle.com>
Message-ID: <1521461029.2323.11.camel@oracle.com>
Hi all,
Stefan proposed to use some iterator over the work area that
internally handles the boundary at the TAMS wrt to liveness when
scanning.
This makes the change a bit more compact, performance does not seem to
differ, so why not... :)
Webrevs:
http://cr.openjdk.java.net/~tschatzl/8197932/webrev.1_to_2/ (diff)
http://cr.openjdk.java.net/~tschatzl/8197932/webrev.2/ (full)
testing:
hs-tier1-5
Thanks,
Thomas
From rkennke at redhat.com Mon Mar 19 14:23:10 2018
From: rkennke at redhat.com (Roman Kennke)
Date: Mon, 19 Mar 2018 15:23:10 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
Message-ID:
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/
>
>
Ping? Any takers for this?
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
From stefan.johansson at oracle.com Mon Mar 19 15:39:48 2018
From: stefan.johansson at oracle.com (Stefan Johansson)
Date: Mon, 19 Mar 2018 16:39:48 +0100
Subject: RFR [M][7/7]: 8197932: Better split work in rebuild remembered
sets phase
In-Reply-To: <1521461029.2323.11.camel@oracle.com>
References: <1520258985.2532.40.camel@oracle.com>
<1520265115.2532.126.camel@oracle.com> <1520953401.3100.41.camel@oracle.com>
<1521461029.2323.11.camel@oracle.com>
Message-ID: <4110ec65-c66f-eca0-3b7a-6580f0edf00d@oracle.com>
Thanks Thomas,
On 2018-03-19 13:03, Thomas Schatzl wrote:
> Hi all,
>
> Stefan proposed to use some iterator over the work area that
> internally handles the boundary at the TAMS wrt to liveness when
> scanning.
>
> This makes the change a bit more compact, performance does not seem to
> differ, so why not... :)
I really like this approach :) A few additional small things:
src/hotspot/share/gc/g1/g1RemSet.cpp
787???????? if (!is_live(_current)) {
I would like to invert the if-statement in the LiveObjIterator
constructor and move the call to move_if_below_ntams() into the
if-statement updating _current, something like this:
if (is_live(_current)) {
? // Non-objArrays were scanned by the previous part of that region.
? if (_current < mr.start() && !oop(_current)->is_objArray()) {
????? _current += oop(_current)->size();
????? // We might have positioned _current on a non-live object.
Reposition to the next
?? ?? // live one if needed.
????? move_if_below_ntams();
??? }
? }
} else {
? ...
}
926 #ifdef ASSERT
927?????? // In the final iteration of the loop the region might have
been eagerly reclaimed.
928?????? // Simply filter out those regions. We can not just use region
type because there
929?????? // might have already been new allocations into these regions.
930?????? HeapWord* const top_at_rebuild_start =
_cm->top_at_rebuild_start(region_idx);
931?????? assert(!hr->is_old() ||
What do you think about making this assert into a guarantee or use
DEBUG_ONLY() to avoid the #ifdef ASSERT? Also maybe adding something to
the comment explaining that it is the check on top_at_rebuild_start that
filters out eagerly reclaimed regions.
---
src/hotspot/share/gc/g1/g1_globals.hpp
259?? experimental(size_t, G1RebuildRemSetChunkSize, 256 * K,
Did you test to see if changing the G1RebuildRemSetChunkSize flag had
any impact on performance, otherwise maybe we could make it a constant
instead.
---
Otherwise I think this looks great.
Thanks,
Stefan
>
> Webrevs:
> http://cr.openjdk.java.net/~tschatzl/8197932/webrev.1_to_2/ (diff)
> http://cr.openjdk.java.net/~tschatzl/8197932/webrev.2/ (full)
> testing:
> hs-tier1-5
>
> Thanks,
> Thomas
>
From erik.osterlund at oracle.com Mon Mar 19 16:04:26 2018
From: erik.osterlund at oracle.com (=?UTF-8?Q?Erik_=c3=96sterlund?=)
Date: Mon, 19 Mar 2018 17:04:26 +0100
Subject: RFR: JDK-8199620: Support for JNI object pinning
In-Reply-To:
References: <7061678b-92df-5169-4b86-5e1165bfc59e@redhat.com>
Message-ID: <5AAFDF8A.1080309@oracle.com>
Hi Roman,
Would there be a problem for you to move the GCLocker stuff into the
default implementation of object pinning?
I have seen code in the wild (not just Solaris) outside of hotspot that
exploits critical native. I would feel less worried if a given GC is not
forced to choose between completely ignoring the GC locking protocol
(and hence breaking such applications), or only locking.
Thanks,
/Erik
On 2018-03-19 15:23, Roman Kennke wrote:
> 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/
>>
>>
> Ping? Any takers for this?
>
> Roman
>
From paul.sandoz at oracle.com Fri Mar 16 16:21:32 2018
From: paul.sandoz at oracle.com (Paul Sandoz)
Date: Fri, 16 Mar 2018 09:21:32 -0700
Subject: GetPrimitiveArrayCritical vs GetByteArrayRegion: 140x slow-down
using -Xcheck:jni and java.util.zip.DeflaterOutputStream
In-Reply-To:
References:
<22bbd632-47c1-7702-bd65-6a51f0bbad02@oracle.com>
<9b5ff318-af41-03c4-efdc-b41b97cf6e61@oracle.com>
<5A9D8C60.3050505@oracle.com> <5A9D8F33.5060500@oracle.com>