From david.holmes at oracle.com Tue Mar 1 03:45:59 2016 From: david.holmes at oracle.com (David Holmes) Date: Tue, 1 Mar 2016 13:45:59 +1000 Subject: RFR: JDK-8150822: Fix typo in JDK-8150201 In-Reply-To: <56D41B46.7000900@oracle.com> References: <56D41B46.7000900@oracle.com> Message-ID: <56D51077.9030007@oracle.com> Looks good. Thanks, David ----- On 29/02/2016 8:19 PM, Erik Joelsson wrote: > In JDK-8150201, some debug flags were corrected. In one of the > overrides, the file name was misspelled so the debug flag correction is > not in effect. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8150822 > > Patch: > diff -r 63a9e10565c4 make/solaris/makefiles/amd64.make > --- a/make/solaris/makefiles/amd64.make > +++ b/make/solaris/makefiles/amd64.make > @@ -39,7 +39,7 @@ > # of OPT_CFLAGS. Restore it here. > ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) > OPT_CFLAGS/generateOptoStub.o += -g0 -xs > - OPT_CFLAGS/LinearScan.o += -g0 -xs > + OPT_CFLAGS/c1_LinearScan.o += -g0 -xs > endif > > > > /Erik From david.holmes at oracle.com Tue Mar 1 05:49:59 2016 From: david.holmes at oracle.com (David Holmes) Date: Tue, 1 Mar 2016 15:49:59 +1000 Subject: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests In-Reply-To: <56D42B0B.6050008@oracle.com> References: <56D42B0B.6050008@oracle.com> Message-ID: <56D52D87.3040900@oracle.com> Hi Dmitry, On 29/02/2016 9:27 PM, Dmitry Dmitriev wrote: > Hello, > > Please review this patch, which integrates the selection/resolution test > suite into the JTreg test suite. This test suite was developed by Eric > Mccorkle(OpenJDK: emc). Thanks Eric for that! > > This test suite uses a template-based generation scheme to exercise all > aspects of the updated selection/resolution test suite from JVMS 8. It > runs a very large number of tests, representing a very wide variety of > cases. Extensive javadoc comments are found throughout the test code > which describe the suite's functioning in more detail. > > Also note that this suite as already undergone extensive review as part > of the development process. > > JBS: https://bugs.openjdk.java.net/browse/JDK-8078112 > webrev.00: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.00/ > > Testing: Jprt, RBT(all platforms, product & fastdebug builds) I hate to open this debate again but I see: @library /runtime/SelectionResolution/classes but no instructions on how to build the library contents. Do we really need to specify a timeout? @run main/othervm/timeout=300 Will these tests now run as part of JPRT submissions? If so: a) have they been tested on all platforms? b) how long do they take to run? Thanks, David > Thanks, > Dmitry From roland.westrelin at oracle.com Tue Mar 1 11:25:53 2016 From: roland.westrelin at oracle.com (Roland Westrelin) Date: Tue, 1 Mar 2016 12:25:53 +0100 Subject: [8u] backport of 8148353: [linux-sparc] Crash in libawt.so on Linux SPARC In-Reply-To: <20160301002500.GA4515@vimes> References: <826FAB32-8FC1-4FDA-AE0E-0F3D083D8AFA@oracle.com> <56D4D5BC.30503@oracle.com> <20160301002500.GA4515@vimes> Message-ID: <8DC85D52-4C2C-4280-A01D-7F323AB4B7E1@oracle.com> Thanks Rob & Vladimir. Roland. From paul.sandoz at oracle.com Tue Mar 1 15:03:20 2016 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 1 Mar 2016 16:03:20 +0100 Subject: RFR (S) 8150465: Unsafe methods to produce uninitialized arrays In-Reply-To: <56CF86EE.6070704@oracle.com> References: <56CE3222.6040207@oracle.com> <56CECE5E.4080105@redhat.com> <56CF053A.3070607@oracle.com> <56CF0C1A.4040600@redhat.com> <56CF1163.4040005@oracle.com> <6D79C6DB-B770-4CAA-9338-154589441F8B@oracle.com> <56CF86EE.6070704@oracle.com> Message-ID: Hi Jim, My comment was not an intent to stifle discussion (which it thankfully did not do!) or to exactly equate functionality, it was just pointing out that the unsafe approach of non-zeroing is not uncharted territory when we are all at sea with Unsafe. FWIW (you may know this already perhaps) Unsafe.allocateMemory is used in the constructor of DirectByteBuffer [*], which zeros out the contents, and is safe because it?s all carefully performed in the constructor. Paul. [*] DirectByteBuffer(int cap) { // package-private super(-1, 0, cap, cap); boolean pa = VM.isDirectMemoryPageAligned(); int ps = Bits.pageSize(); long size = Math.max(1L, (long)cap + (pa ? ps : 0)); Bits.reserveMemory(size, cap); long base = 0; try { base = unsafe.allocateMemory(size); } catch (OutOfMemoryError x) { Bits.unreserveMemory(size, cap); throw x; } unsafe.setMemory(base, size, (byte) 0); if (pa && (base % ps != 0)) { // Round up to page boundary address = base + ps - (base & (ps - 1)); } else { address = base; } cleaner = Cleaner.create(this, new Deallocator(base, size, cap)); att = null; } > On 25 Feb 2016, at 23:57, Jim Graham wrote: > > Just to play devil's advocate here. > > It's true that from a code correctness-safety perspective Unsafe programmers can already shoot themselves in the foot with uninitialized allocations, but from the security point of view the two methods don't have the same opportunity to leak information. > > Unsafe.allocateMemory returns a long, which is just a long to any untrusted code since it can't use the Unsafe methods to access the data in it. > > The new uninitialized array allocation returns a primitive array which can be inspected by untrusted code for any stale elements that hold private information from a previous allocation - should that array ever be leaked to untrusted code... > > ...jim > > On 2/25/2016 7:47 AM, Paul Sandoz wrote: >> >>> On 25 Feb 2016, at 15:36, Aleksey Shipilev wrote: >>> >>> On 02/25/2016 05:13 PM, Andrew Haley wrote: >>>> On 02/25/2016 01:44 PM, Aleksey Shipilev wrote: >>>>> Of course, you will still see garbage data if after storing the array >>>>> elements into the uninitialized array you would publish it racily. But >>>>> the same is true for the "regular" allocations and subsequent writes. >>>>> The only difference is whether you see "real" garbage, or some >>>>> "synthetic" garbage like zeros. It is, of course, a caller >>>>> responsibility to publish array safely in both cases, if garbage is >>>>> unwanted. >>>> >>>> Of course, my worry with this optimization assumes that programmers >>>> make mistakes. But you did say "complicated processing is done after >>>> the allocation." And that's where programmers make mistakes. >>> >>> Of course they do; at least half of the Unsafe methods is suitable for >>> shooting oneself in a foot in creative ways. Unsafe is a sharp tool, and >>> Unsafe callers are trusted in their madness. This is not your average >>> Joe's use case, for sure. >>> >> >> FTR the contents of the memory allocated by Unsafe.allocateMemory are also uninitialized. >> >> Paul. >> From mikael.vidstedt at oracle.com Tue Mar 1 16:58:10 2016 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Tue, 1 Mar 2016 08:58:10 -0800 Subject: RFR (M): 8149159: Clean up Unsafe In-Reply-To: <56C7757E.4070806@oracle.com> References: <56C61A07.4010604@oracle.com> <56C7757E.4070806@oracle.com> Message-ID: <56D5CA22.7050308@oracle.com> Thanks for all the great feedback/questions. Updated webrev(s) here: http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/hotspot/webrev.01.incr/webrev/ http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/jdk/webrev.01.incr/webrev/ Also, here are the changes after rebasing on top of hs-comp to include Aleksey's recent changes to Unsafe. There were some conflicts in unsafe.cpp where the new methods/functions were added, so I had to resolve that and apply the cleanup to them as well. hotspot: http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/hotspot/webrev.01/webrev/ jdk: http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/jdk/webrev.01/webrev/ * Changes Apart from resolving the conflicts in unsafe.cpp, this change include the following changes compared to webrev.00: Claes - you are absolutely about right about the missing annotations, I have gone through and added the ForceInline annotation to all the s.m.Unsafe methods were it was missing. Thanks for catching that! Chris - I chose to completely remove the UnsafeWrapper macro and its uses from unsafe.cpp. After all it's empty right now, and if somebody feels like adding it back it can simply be injected into the UNSAFE_ENTRY/UNSAFE_LEAF macros. * Testing I've run both -testset hotspot and -testset core on this, and FWIW it's all green. * Comments/other Stas - Wrt to the changes to the unsafe.cpp function names, I chose to rename the functions to include the suffix "0" to reflect the name change of the corresponding java (native) methods. While it's not strictly necessary it does feel just a tad clearer/more intuitive to me to have the names match. John/Paul - I filed https://bugs.openjdk.java.net/browse/JDK-8150921 to cover the migration from single (long) addressing modes for the Unsafe getters/setters to the double-register (Object + long) equivalents. Cheers, Mikael On 2016-02-19 12:05, Claes Redestad wrote: > Good stuff! But quite a few delegating methods in sun.misc.Unsafe did > not get the @ForceInline treatment, which seems like an oversight? > > Thanks! > /Claes > > On 2016-02-18 20:22, Mikael Vidstedt wrote: >> >> Please review the following change which does some relatively >> significant cleaning up of the Unsafe implementation. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8149159 >> Webrev (hotspot): >> http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/hotspot/webrev.00/webrev/ >> Webrev (jdk): >> http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/jdk/webrev.00/webrev/ >> >> Summary: >> >> * To avoid code duplication sun.misc.Unsafe now delegates all work to >> jdk.internal.misc.Unsafe. This also means that the VM - and >> unsafe.cpp specifically - no longer needs to know or care about >> s.m.Unsafe. >> * The s.m.Unsafe delegation methods have all been decorated with >> @ForceInline to minimize the risk of performance regressions, though >> it is highly likely that they will be inlined even without the >> annotations. >> * The documentation has been updated to reflect that it is the >> responsibility of the user of Unsafe to make sure arguments are valid. >> * The argument checking has, to the extent possible, been moved from >> unsafe.cpp up to Java to simplify the native code and allow the JIT >> to optimize it. >> * Some of the argument checks have been relaxed. For example, the >> recently introduced U.copySwapMemory does not check for null pointers >> anymore. See docs for j.i.m.U.checkPointer for the complete reasoning >> behind this. Note that the Unsafe methods today, apart from >> U.copySwapMemory, do not perform the NULL related check(s). >> * A test was added for j.i.m.U.copyMemory, based on U.copySwapMemory. >> Feel free to point out that I should merge them (because I should). >> >> Also, unsafe.cpp was cleaned up rather dramatically. Some specific >> highlights: >> >> * Unsafe_ functions are now declared static, as are the other >> unsafe.cpp local functions. >> * Created unsafe.hpp and moved some functions used in other parts of >> the VM to that. Removed some "extern" function declarations (extern >> is bad, kittens die when extern is (over-)used). >> * Remove scary looking comment about UNSAFE_LEAF not being possible >> to use - there's nothing special about it, it's just a JVM_LEAF. >> * Used UNSAFE_LEAF for a few simple leaf methods >> * Added helpful braces around UNSAFE_ENTRY/UNSAFE_END to help >> auto-indent >> * Removed unused Unsafe_<...>##140 functions/macros >> * Updated macro argument names to be consistent throughout unsafe.cpp >> macro definitions >> * Replaced some checks with asserts - as per above the checks are now >> performed in j.i.m.Unsafe instead. >> * Removed all the s.m.Unsafe related code >> >> >> Testing: >> >> * jtreg: hotspot_jprt group, jdk/internal >> * JPRT: hotspot testset >> * Perf: JMH unsafe-bench.jar (no significant changes) >> >> I'm taking suggestions on additional things to test. >> >> Cheers, >> Mikael >> > From dmitry.dmitriev at oracle.com Tue Mar 1 17:38:53 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Tue, 1 Mar 2016 20:38:53 +0300 Subject: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests In-Reply-To: <56D52D87.3040900@oracle.com> References: <56D42B0B.6050008@oracle.com> <56D52D87.3040900@oracle.com> Message-ID: <56D5D3AD.7030308@oracle.com> Hello David, Thank you for the comments! I added build instructions to the tests. I specify timeout because on fastdebug builds test needs more time. Only two tests will be run as part of JPRT submissions - InvokeStaticSuccessTest and NoSuchMethodErrorTest. InvokeStaticSuccessTest takes 1-3 seconds and NoSuchMethodErrorTest takes 2-9 seconds. Other tests are excluded from JPRT run. Updated webrev.01: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.01/ Thank you, Dmitry On 01.03.2016 8:49, David Holmes wrote: > Hi Dmitry, > > On 29/02/2016 9:27 PM, Dmitry Dmitriev wrote: >> Hello, >> >> Please review this patch, which integrates the selection/resolution test >> suite into the JTreg test suite. This test suite was developed by Eric >> Mccorkle(OpenJDK: emc). Thanks Eric for that! >> >> This test suite uses a template-based generation scheme to exercise all >> aspects of the updated selection/resolution test suite from JVMS 8. It >> runs a very large number of tests, representing a very wide variety of >> cases. Extensive javadoc comments are found throughout the test code >> which describe the suite's functioning in more detail. >> >> Also note that this suite as already undergone extensive review as part >> of the development process. >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8078112 >> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.00/ >> >> Testing: Jprt, RBT(all platforms, product & fastdebug builds) > > I hate to open this debate again but I see: > > @library /runtime/SelectionResolution/classes > > but no instructions on how to build the library contents. > > Do we really need to specify a timeout? > > @run main/othervm/timeout=300 > > Will these tests now run as part of JPRT submissions? If so: > a) have they been tested on all platforms? > b) how long do they take to run? > > Thanks, > David > > >> Thanks, >> Dmitry From tom.benson at oracle.com Tue Mar 1 18:39:29 2016 From: tom.benson at oracle.com (Tom Benson) Date: Tue, 1 Mar 2016 13:39:29 -0500 Subject: [9] RFR (S) 8146436: Add -XX:+UseAggressiveHeapShrink option In-Reply-To: <56D5325B.80903@oracle.com> References: <56B39A43.5070409@oracle.com> <56BB8F3D.3070502@oracle.com> <56BB9831.5030504@oracle.com> <56BB9A9A.7060901@oracle.com> <56BB9FEA.5070506@oracle.com> <56BBA27C.2080106@oracle.com> <56BBA353.2020805@oracle.com> <56C5E177.9030104@oracle.com> <56CB3524.7030800@oracle.com> <56CF46B4.9080800@oracle.com> <56D5325B.80903@oracle.com> Message-ID: <56D5E1E1.3060803@oracle.com> Hi Chris, Looks good. I do notice that the trace printed at line 273 in cardGeneration will show "shrink factors" of zero when ShrinkHeapInSteps is disabled, when 100 might be expected. But OTOH, you could interpret zero as 'not in use.' I would leave it as is, but perhaps the other reviewer (or you) will have a different opinion. OK with that as well. Tom On 3/1/2016 1:10 AM, Chris Plummer wrote: > On 2/25/16 10:23 AM, Chris Plummer wrote: >> On 2/22/16 8:19 AM, Chris Plummer wrote: >>> On 2/18/16 7:21 AM, Tom Benson wrote: >>>> Hi Chris, >>>> >>>> On 2/10/2016 3:53 PM, Chris Plummer wrote: >>>>> On 2/10/16 12:50 PM, Tom Benson wrote: >>>>>> >>>>>> I've heard from another GC team person that there might be more >>>>>> feedback on the name coming, after some discussion. Not sure if >>>>>> it will constitute the 'landslide' I mentioned. 8^) >>>>> No problem. I'll wait for that to settle before sending out a >>>>> final webrev. >>>> >>>> "Landslide" may not be the right term, but there was mild consensus >>>> among the GC team that it's worth going through CCC again to >>>> replace UseAggressiveHeapShrink. Our suggestion is >>>> "ShrinkHeapInSteps", which would be on by default, and hopefully >>>> describes what's happening without any other implications. So >>>> you'd disable it to get what you want. >>>> Tom >>> Hi Tom, >>> >>> Ok, I'll get started with this. Just got back from vacation today, >>> but it shouldn't take long to get to it. >>> >> Updated webrev: >> >> http://cr.openjdk.java.net/~cjplummer/8146436/webrev.03/ >> >> thanks, > Ping. Tom and Jon can you give final approval for this? > > Thanks. > > Chris >> >> Chris >> >>> thanks, >>> >>> Chris >>>> >>>>> >>>>> thanks, >>>>> >>>>> Chris >>>>>> Tom >>>>>> >>>>>> On 2/10/2016 3:39 PM, Chris Plummer wrote: >>>>>>> Hi Tom, >>>>>>> >>>>>>> if (!UseAggressiveHeapShrink) { >>>>>>> // If UseAggressiveHeapShrink is false (the default), >>>>>>> // we don't want shrink all the way back to initSize if >>>>>>> people call >>>>>>> // System.gc(), because some programs do that between >>>>>>> "phases" and then >>>>>>> // we'd just have to grow the heap up again for the next >>>>>>> phase. So we >>>>>>> // damp the shrinking: 0% on the first call, 10% on the >>>>>>> second call, 40% >>>>>>> // on the third call, and 100% by the fourth call. But >>>>>>> if we recompute >>>>>>> // size without shrinking, it goes back to 0%. >>>>>>> shrink_bytes = shrink_bytes / 100 * current_shrink_factor; >>>>>>> } >>>>>>> assert(shrink_bytes <= max_shrink_bytes, "invalid shrink >>>>>>> size"); >>>>>>> if (current_shrink_factor == 0) { >>>>>>> _shrink_factor = 10; >>>>>>> } else { >>>>>>> _shrink_factor = MIN2(current_shrink_factor * 4, >>>>>>> (size_t) 100); >>>>>>> } >>>>>>> >>>>>>> I got rid of the changes at the start of the method, and added >>>>>>> the !UseAggressiveHeapShrink check and the comment, so the first >>>>>>> 2 lines above and the closing right brace are now the only >>>>>>> change in the file, other than the copyright date. If you want I >>>>>>> could also move the _shrink_factor adjustment into this block >>>>>>> since the value of _shrink_factor becomes irrelevant if >>>>>>> UseAggressiveHeapShrink is true. The assert should remain >>>>>>> outside the block. >>>>>>> >>>>>>> cheers, >>>>>>> >>>>>>> Chris >>>>>>> >>>>>>> On 2/10/16 12:16 PM, Tom Benson wrote: >>>>>>>> Hi Chris, >>>>>>>> OK, that all sounds good. >>>>>>>> >>>>>>>> >> I can change it, although that will mean filing a new CCC. >>>>>>>> Ah, I'd forgotten about that. Not worth it, unless there's a >>>>>>>> landslide of support for a different name. >>>>>>>> >>>>>>>> Tnx, >>>>>>>> Tom >>>>>>>> >>>>>>>> On 2/10/2016 3:06 PM, Chris Plummer wrote: >>>>>>>>> Hi Tom, >>>>>>>>> >>>>>>>>> Thanks for having a look. Comments inline below: >>>>>>>>> >>>>>>>>> On 2/10/16 11:27 AM, Tom Benson wrote: >>>>>>>>>> Hi Chris, >>>>>>>>>> My apologies if I missed the discussion somewhere, but is >>>>>>>>>> there a specific rationale for adding this that can be >>>>>>>>>> mentioned in the bug report? I can imagine scenarios where >>>>>>>>>> it would be useful, but maybe the real need can be called out. >>>>>>>>> In general, it is for customers that want to minimize the >>>>>>>>> amount of memory used by the java heap, and are willing to >>>>>>>>> sacrifice some performance (induce more frequent GCs) to save >>>>>>>>> that memory. When heap usage fluctuates greatly, the GC will >>>>>>>>> tend to hold on to that memory longer than needed due to the >>>>>>>>> the current algorithm which requires 4 full GCs before >>>>>>>>> MaxHeapFreeRatio is fully honored. If this is what you are >>>>>>>>> looking for, I can add it to the CR. >>>>>>>>>> >>>>>>>>>> I think it might be clearer if the new code in cardGeneration >>>>>>>>>> was moved down to where the values are used. IE, I would >>>>>>>>>> leave the inits of current_shrink_factor and _shrink_factor >>>>>>>>>> as they were at lines 190/191. Then down at 270, just don't >>>>>>>>>> divide by the shrink factor if UseAggressiveHeapShrink is >>>>>>>>>> set, and the updates to shrink factor can be in the same >>>>>>>>>> conditional. This has the advantage that you can fix the >>>>>>>>>> comment just above it to match this special case. Do you >>>>>>>>>> think that would work? >>>>>>>>> Yes, that makes sense. I'll get started on it. I have a >>>>>>>>> vacation coming up shortly, so what I'll get a new webrev out >>>>>>>>> soon, but probably will need to wait until after my trip to do >>>>>>>>> more thorough testing and push the changes. >>>>>>>>>> >>>>>>>>>> It looks like the ending "\" at line 3330 in globals.hpp >>>>>>>>>> isn't aligned, and the copyright in cardGeneration.cpp needs >>>>>>>>>> to be updated. >>>>>>>>> Ok. >>>>>>>>>> >>>>>>>>>> One other nit, which you can ignore unless someone comes >>>>>>>>>> forward to agree with me 8^) , is that I'd prefer the name >>>>>>>>>> ShrinkHeapAggressively instead. Maybe this was already >>>>>>>>>> debated elsewhere.... >>>>>>>>> The name choice hasn't really been discussed or questioned. It >>>>>>>>> was what was suggested to me, so I stuck with it (The initial >>>>>>>>> work was done by someone else. I'm just getting it integrated >>>>>>>>> into 9). I can change it, although that will mean filing a new >>>>>>>>> CCC. >>>>>>>>> >>>>>>>>> thanks, >>>>>>>>> >>>>>>>>> Chris >>>>>>>>>> Tom >>>>>>>>>> >>>>>>>>>> On 2/4/2016 1:36 PM, Chris Plummer wrote: >>>>>>>>>>> Hello, >>>>>>>>>>> >>>>>>>>>>> Please review the following for adding the -XX >>>>>>>>>>> UseAggressiveHeapShrink option. When turned on, it tells the >>>>>>>>>>> GC to reduce the heap size to the new target size >>>>>>>>>>> immediately after a full GC rather than doing it >>>>>>>>>>> progressively over 4 GCs. >>>>>>>>>>> >>>>>>>>>>> Webrev: >>>>>>>>>>> http://cr.openjdk.java.net/~cjplummer/8146436/webrev.02/ >>>>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8146436 >>>>>>>>>>> >>>>>>>>>>> Testing: >>>>>>>>>>> -JPRT with '-testset hotspot' >>>>>>>>>>> -JPRT with '-testset hotspot -vmflags >>>>>>>>>>> "-XX:+UseAggressiveHeapShrink"' >>>>>>>>>>> -added new TestMaxMinHeapFreeRatioFlags.java test >>>>>>>>>>> >>>>>>>>>>> thanks, >>>>>>>>>>> >>>>>>>>>>> Chris >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > From aleksey.shipilev at oracle.com Tue Mar 1 18:45:15 2016 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Tue, 1 Mar 2016 21:45:15 +0300 Subject: RFR (S) 8150465: Unsafe methods to produce uninitialized arrays In-Reply-To: <56CE3222.6040207@oracle.com> References: <56CE3222.6040207@oracle.com> Message-ID: <56D5E33B.4050606@oracle.com> On 02/25/2016 01:43 AM, Aleksey Shipilev wrote: > Webrevs: > http://cr.openjdk.java.net/~shade/8150465/webrev.hs.01/ > http://cr.openjdk.java.net/~shade/8150465/webrev.jdk.01/ For the record, after all good reviews and discussions happened in this thread, I'll be pushing these soon: http://cr.openjdk.java.net/~shade/8150465/webrev.hs.04/ http://cr.openjdk.java.net/~shade/8150465/webrev.jdk.04/ Thanks, -Aleksey From david.holmes at oracle.com Tue Mar 1 21:13:54 2016 From: david.holmes at oracle.com (David Holmes) Date: Wed, 2 Mar 2016 07:13:54 +1000 Subject: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests In-Reply-To: <56D5D3AD.7030308@oracle.com> References: <56D42B0B.6050008@oracle.com> <56D52D87.3040900@oracle.com> <56D5D3AD.7030308@oracle.com> Message-ID: <56D60612.7020903@oracle.com> On 2/03/2016 3:38 AM, Dmitry Dmitriev wrote: > Hello David, > > Thank you for the comments! I added build instructions to the tests. Thank you. > I specify timeout because on fastdebug builds test needs more time. Don't we set a different default timeout when running fastdebug? Perhaps not. Anyway I see there are a range of different timeout values specified so presumably this has been tuned for the slowest machines ? > Only two tests will be run as part of JPRT submissions - > InvokeStaticSuccessTest and NoSuchMethodErrorTest. > InvokeStaticSuccessTest takes 1-3 seconds and NoSuchMethodErrorTest > takes 2-9 seconds. Other tests are excluded from JPRT run. Thanks - I misread the change to TEST.groups. > Updated webrev.01: > http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.01/ I can't comment on the details of the tests themselves but the adding of the test suite seems okay. Thanks, David > Thank you, > Dmitry > > On 01.03.2016 8:49, David Holmes wrote: >> Hi Dmitry, >> >> On 29/02/2016 9:27 PM, Dmitry Dmitriev wrote: >>> Hello, >>> >>> Please review this patch, which integrates the selection/resolution test >>> suite into the JTreg test suite. This test suite was developed by Eric >>> Mccorkle(OpenJDK: emc). Thanks Eric for that! >>> >>> This test suite uses a template-based generation scheme to exercise all >>> aspects of the updated selection/resolution test suite from JVMS 8. It >>> runs a very large number of tests, representing a very wide variety of >>> cases. Extensive javadoc comments are found throughout the test code >>> which describe the suite's functioning in more detail. >>> >>> Also note that this suite as already undergone extensive review as part >>> of the development process. >>> >>> JBS: https://bugs.openjdk.java.net/browse/JDK-8078112 >>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.00/ >>> >>> Testing: Jprt, RBT(all platforms, product & fastdebug builds) >> >> I hate to open this debate again but I see: >> >> @library /runtime/SelectionResolution/classes >> >> but no instructions on how to build the library contents. >> >> Do we really need to specify a timeout? >> >> @run main/othervm/timeout=300 >> >> Will these tests now run as part of JPRT submissions? If so: >> a) have they been tested on all platforms? >> b) how long do they take to run? >> >> Thanks, >> David >> >> >>> Thanks, >>> Dmitry > From jon.masamitsu at oracle.com Tue Mar 1 23:05:57 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Tue, 1 Mar 2016 15:05:57 -0800 Subject: [9] RFR (S) 8146436: Add -XX:+UseAggressiveHeapShrink option In-Reply-To: <56D5325B.80903@oracle.com> References: <56B39A43.5070409@oracle.com> <56BB8F3D.3070502@oracle.com> <56BB9831.5030504@oracle.com> <56BB9A9A.7060901@oracle.com> <56BB9FEA.5070506@oracle.com> <56BBA27C.2080106@oracle.com> <56BBA353.2020805@oracle.com> <56C5E177.9030104@oracle.com> <56CB3524.7030800@oracle.com> <56CF46B4.9080800@oracle.com> <56D5325B.80903@oracle.com> Message-ID: <56D62055.9060102@oracle.com> On 2/29/2016 10:10 PM, Chris Plummer wrote: > On 2/25/16 10:23 AM, Chris Plummer wrote: >> On 2/22/16 8:19 AM, Chris Plummer wrote: >>> On 2/18/16 7:21 AM, Tom Benson wrote: >>>> Hi Chris, >>>> >>>> On 2/10/2016 3:53 PM, Chris Plummer wrote: >>>>> On 2/10/16 12:50 PM, Tom Benson wrote: >>>>>> >>>>>> I've heard from another GC team person that there might be more >>>>>> feedback on the name coming, after some discussion. Not sure if >>>>>> it will constitute the 'landslide' I mentioned. 8^) >>>>> No problem. I'll wait for that to settle before sending out a >>>>> final webrev. >>>> >>>> "Landslide" may not be the right term, but there was mild consensus >>>> among the GC team that it's worth going through CCC again to >>>> replace UseAggressiveHeapShrink. Our suggestion is >>>> "ShrinkHeapInSteps", which would be on by default, and hopefully >>>> describes what's happening without any other implications. So >>>> you'd disable it to get what you want. >>>> Tom >>> Hi Tom, >>> >>> Ok, I'll get started with this. Just got back from vacation today, >>> but it shouldn't take long to get to it. >>> >> Updated webrev: >> >> http://cr.openjdk.java.net/~cjplummer/8146436/webrev.03/ >> >> thanks, > Ping. Tom and Jon can you give final approval for this? Changes look good. Reviewed. Jon > > Thanks. > > Chris >> >> Chris >> >>> thanks, >>> >>> Chris >>>> >>>>> >>>>> thanks, >>>>> >>>>> Chris >>>>>> Tom >>>>>> >>>>>> On 2/10/2016 3:39 PM, Chris Plummer wrote: >>>>>>> Hi Tom, >>>>>>> >>>>>>> if (!UseAggressiveHeapShrink) { >>>>>>> // If UseAggressiveHeapShrink is false (the default), >>>>>>> // we don't want shrink all the way back to initSize if >>>>>>> people call >>>>>>> // System.gc(), because some programs do that between >>>>>>> "phases" and then >>>>>>> // we'd just have to grow the heap up again for the next >>>>>>> phase. So we >>>>>>> // damp the shrinking: 0% on the first call, 10% on the >>>>>>> second call, 40% >>>>>>> // on the third call, and 100% by the fourth call. But >>>>>>> if we recompute >>>>>>> // size without shrinking, it goes back to 0%. >>>>>>> shrink_bytes = shrink_bytes / 100 * current_shrink_factor; >>>>>>> } >>>>>>> assert(shrink_bytes <= max_shrink_bytes, "invalid shrink >>>>>>> size"); >>>>>>> if (current_shrink_factor == 0) { >>>>>>> _shrink_factor = 10; >>>>>>> } else { >>>>>>> _shrink_factor = MIN2(current_shrink_factor * 4, >>>>>>> (size_t) 100); >>>>>>> } >>>>>>> >>>>>>> I got rid of the changes at the start of the method, and added >>>>>>> the !UseAggressiveHeapShrink check and the comment, so the first >>>>>>> 2 lines above and the closing right brace are now the only >>>>>>> change in the file, other than the copyright date. If you want I >>>>>>> could also move the _shrink_factor adjustment into this block >>>>>>> since the value of _shrink_factor becomes irrelevant if >>>>>>> UseAggressiveHeapShrink is true. The assert should remain >>>>>>> outside the block. >>>>>>> >>>>>>> cheers, >>>>>>> >>>>>>> Chris >>>>>>> >>>>>>> On 2/10/16 12:16 PM, Tom Benson wrote: >>>>>>>> Hi Chris, >>>>>>>> OK, that all sounds good. >>>>>>>> >>>>>>>> >> I can change it, although that will mean filing a new CCC. >>>>>>>> Ah, I'd forgotten about that. Not worth it, unless there's a >>>>>>>> landslide of support for a different name. >>>>>>>> >>>>>>>> Tnx, >>>>>>>> Tom >>>>>>>> >>>>>>>> On 2/10/2016 3:06 PM, Chris Plummer wrote: >>>>>>>>> Hi Tom, >>>>>>>>> >>>>>>>>> Thanks for having a look. Comments inline below: >>>>>>>>> >>>>>>>>> On 2/10/16 11:27 AM, Tom Benson wrote: >>>>>>>>>> Hi Chris, >>>>>>>>>> My apologies if I missed the discussion somewhere, but is >>>>>>>>>> there a specific rationale for adding this that can be >>>>>>>>>> mentioned in the bug report? I can imagine scenarios where >>>>>>>>>> it would be useful, but maybe the real need can be called out. >>>>>>>>> In general, it is for customers that want to minimize the >>>>>>>>> amount of memory used by the java heap, and are willing to >>>>>>>>> sacrifice some performance (induce more frequent GCs) to save >>>>>>>>> that memory. When heap usage fluctuates greatly, the GC will >>>>>>>>> tend to hold on to that memory longer than needed due to the >>>>>>>>> the current algorithm which requires 4 full GCs before >>>>>>>>> MaxHeapFreeRatio is fully honored. If this is what you are >>>>>>>>> looking for, I can add it to the CR. >>>>>>>>>> >>>>>>>>>> I think it might be clearer if the new code in cardGeneration >>>>>>>>>> was moved down to where the values are used. IE, I would >>>>>>>>>> leave the inits of current_shrink_factor and _shrink_factor >>>>>>>>>> as they were at lines 190/191. Then down at 270, just don't >>>>>>>>>> divide by the shrink factor if UseAggressiveHeapShrink is >>>>>>>>>> set, and the updates to shrink factor can be in the same >>>>>>>>>> conditional. This has the advantage that you can fix the >>>>>>>>>> comment just above it to match this special case. Do you >>>>>>>>>> think that would work? >>>>>>>>> Yes, that makes sense. I'll get started on it. I have a >>>>>>>>> vacation coming up shortly, so what I'll get a new webrev out >>>>>>>>> soon, but probably will need to wait until after my trip to do >>>>>>>>> more thorough testing and push the changes. >>>>>>>>>> >>>>>>>>>> It looks like the ending "\" at line 3330 in globals.hpp >>>>>>>>>> isn't aligned, and the copyright in cardGeneration.cpp needs >>>>>>>>>> to be updated. >>>>>>>>> Ok. >>>>>>>>>> >>>>>>>>>> One other nit, which you can ignore unless someone comes >>>>>>>>>> forward to agree with me 8^) , is that I'd prefer the name >>>>>>>>>> ShrinkHeapAggressively instead. Maybe this was already >>>>>>>>>> debated elsewhere.... >>>>>>>>> The name choice hasn't really been discussed or questioned. It >>>>>>>>> was what was suggested to me, so I stuck with it (The initial >>>>>>>>> work was done by someone else. I'm just getting it integrated >>>>>>>>> into 9). I can change it, although that will mean filing a new >>>>>>>>> CCC. >>>>>>>>> >>>>>>>>> thanks, >>>>>>>>> >>>>>>>>> Chris >>>>>>>>>> Tom >>>>>>>>>> >>>>>>>>>> On 2/4/2016 1:36 PM, Chris Plummer wrote: >>>>>>>>>>> Hello, >>>>>>>>>>> >>>>>>>>>>> Please review the following for adding the -XX >>>>>>>>>>> UseAggressiveHeapShrink option. When turned on, it tells the >>>>>>>>>>> GC to reduce the heap size to the new target size >>>>>>>>>>> immediately after a full GC rather than doing it >>>>>>>>>>> progressively over 4 GCs. >>>>>>>>>>> >>>>>>>>>>> Webrev: >>>>>>>>>>> http://cr.openjdk.java.net/~cjplummer/8146436/webrev.02/ >>>>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8146436 >>>>>>>>>>> >>>>>>>>>>> Testing: >>>>>>>>>>> -JPRT with '-testset hotspot' >>>>>>>>>>> -JPRT with '-testset hotspot -vmflags >>>>>>>>>>> "-XX:+UseAggressiveHeapShrink"' >>>>>>>>>>> -added new TestMaxMinHeapFreeRatioFlags.java test >>>>>>>>>>> >>>>>>>>>>> thanks, >>>>>>>>>>> >>>>>>>>>>> Chris >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > From james.graham at oracle.com Tue Mar 1 23:34:29 2016 From: james.graham at oracle.com (Jim Graham) Date: Tue, 1 Mar 2016 15:34:29 -0800 Subject: RFR (S) 8150465: Unsafe methods to produce uninitialized arrays In-Reply-To: References: <56CE3222.6040207@oracle.com> <56CECE5E.4080105@redhat.com> <56CF053A.3070607@oracle.com> <56CF0C1A.4040600@redhat.com> <56CF1163.4040005@oracle.com> <6D79C6DB-B770-4CAA-9338-154589441F8B@oracle.com> <56CF86EE.6070704@oracle.com> Message-ID: <56D62705.2020506@oracle.com> Thanks Paul, That code doesn't seem to follow the recommendations in the new allocateUninit() method as far as publicizing the address field. Unless unsafe.setMemory() does a fence? ...jim On 3/1/16 7:03 AM, Paul Sandoz wrote: > Hi Jim, > > My comment was not an intent to stifle discussion (which it thankfully did not do!) or to exactly equate functionality, it was just pointing out that the unsafe approach of non-zeroing is not uncharted territory when we are all at sea with Unsafe. > > FWIW (you may know this already perhaps) Unsafe.allocateMemory is used in the constructor of DirectByteBuffer [*], which zeros out the contents, and is safe because it?s all carefully performed in the constructor. > > Paul. > > [*] > DirectByteBuffer(int cap) { // package-private > > super(-1, 0, cap, cap); > boolean pa = VM.isDirectMemoryPageAligned(); > int ps = Bits.pageSize(); > long size = Math.max(1L, (long)cap + (pa ? ps : 0)); > Bits.reserveMemory(size, cap); > > long base = 0; > try { > base = unsafe.allocateMemory(size); > } catch (OutOfMemoryError x) { > Bits.unreserveMemory(size, cap); > throw x; > } > unsafe.setMemory(base, size, (byte) 0); > if (pa && (base % ps != 0)) { > // Round up to page boundary > address = base + ps - (base & (ps - 1)); > } else { > address = base; > } > cleaner = Cleaner.create(this, new Deallocator(base, size, cap)); > att = null; > > > > > } > >> On 25 Feb 2016, at 23:57, Jim Graham wrote: >> >> Just to play devil's advocate here. >> >> It's true that from a code correctness-safety perspective Unsafe programmers can already shoot themselves in the foot with uninitialized allocations, but from the security point of view the two methods don't have the same opportunity to leak information. >> >> Unsafe.allocateMemory returns a long, which is just a long to any untrusted code since it can't use the Unsafe methods to access the data in it. >> >> The new uninitialized array allocation returns a primitive array which can be inspected by untrusted code for any stale elements that hold private information from a previous allocation - should that array ever be leaked to untrusted code... >> >> ...jim >> >> On 2/25/2016 7:47 AM, Paul Sandoz wrote: >>> >>>> On 25 Feb 2016, at 15:36, Aleksey Shipilev wrote: >>>> >>>> On 02/25/2016 05:13 PM, Andrew Haley wrote: >>>>> On 02/25/2016 01:44 PM, Aleksey Shipilev wrote: >>>>>> Of course, you will still see garbage data if after storing the array >>>>>> elements into the uninitialized array you would publish it racily. But >>>>>> the same is true for the "regular" allocations and subsequent writes. >>>>>> The only difference is whether you see "real" garbage, or some >>>>>> "synthetic" garbage like zeros. It is, of course, a caller >>>>>> responsibility to publish array safely in both cases, if garbage is >>>>>> unwanted. >>>>> >>>>> Of course, my worry with this optimization assumes that programmers >>>>> make mistakes. But you did say "complicated processing is done after >>>>> the allocation." And that's where programmers make mistakes. >>>> >>>> Of course they do; at least half of the Unsafe methods is suitable for >>>> shooting oneself in a foot in creative ways. Unsafe is a sharp tool, and >>>> Unsafe callers are trusted in their madness. This is not your average >>>> Joe's use case, for sure. >>>> >>> >>> FTR the contents of the memory allocated by Unsafe.allocateMemory are also uninitialized. >>> >>> Paul. >>> > From rob.mckenna at oracle.com Tue Mar 1 00:25:00 2016 From: rob.mckenna at oracle.com (Rob McKenna) Date: Tue, 1 Mar 2016 00:25:00 +0000 Subject: [8u] backport of 8148353: [linux-sparc] Crash in libawt.so on Linux SPARC In-Reply-To: <56D4D5BC.30503@oracle.com> References: <826FAB32-8FC1-4FDA-AE0E-0F3D083D8AFA@oracle.com> <56D4D5BC.30503@oracle.com> Message-ID: <20160301002500.GA4515@vimes> Approved -Rob On 29/02/16 03:35, Vladimir Kozlov wrote: > Looks good. > > Note, the code fix was applied cleanly to jdk 8u. Only test have to be > modified. > > Thanks, > Vladimir > > On 2/29/16 12:52 PM, Roland Westrelin wrote: > >Hi, > > > >Please approve and review the following backport to 8u. > > > >8148353 was pushed to jdk9 last week (on Wednesday) and it hasn?t caused any new failures during nightly testing. The change doesn?t apply cleanly to 8u: I had to rework the test because the infrastructure to run native jtreg tests doesn?t seem to exist in 8. I restricted the test to linux-sparc to keep it simple. > > > >https://bugs.openjdk.java.net/browse/JDK-8148353 > >http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/1f4f4866aee0 > > > >New webrev: > >http://cr.openjdk.java.net/~roland/8148353/webrev.8u.00/ > > > >review thread: > >http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2016-February/thread.html#21530 > > > >Note that when I pushed 8148353 to 9, the fix version was set to 8 and so a backport was created for 9. > > > >Roland. > > From dmitry.dmitriev at oracle.com Wed Mar 2 08:10:11 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 2 Mar 2016 11:10:11 +0300 Subject: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests In-Reply-To: <56D60612.7020903@oracle.com> References: <56D42B0B.6050008@oracle.com> <56D52D87.3040900@oracle.com> <56D5D3AD.7030308@oracle.com> <56D60612.7020903@oracle.com> Message-ID: <56D69FE3.6050605@oracle.com> Hello David, Yes, you are right about the slowest machine. Thank you for the review! Dmitry On 02.03.2016 0:13, David Holmes wrote: > On 2/03/2016 3:38 AM, Dmitry Dmitriev wrote: >> Hello David, >> >> Thank you for the comments! I added build instructions to the tests. > > Thank you. > >> I specify timeout because on fastdebug builds test needs more time. > > Don't we set a different default timeout when running fastdebug? > Perhaps not. Anyway I see there are a range of different timeout > values specified so presumably this has been tuned for the slowest > machines ? > >> Only two tests will be run as part of JPRT submissions - >> InvokeStaticSuccessTest and NoSuchMethodErrorTest. >> InvokeStaticSuccessTest takes 1-3 seconds and NoSuchMethodErrorTest >> takes 2-9 seconds. Other tests are excluded from JPRT run. > > Thanks - I misread the change to TEST.groups. > >> Updated webrev.01: >> http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.01/ >> > > I can't comment on the details of the tests themselves but the adding > of the test suite seems okay. > > Thanks, > David > >> Thank you, >> Dmitry >> >> On 01.03.2016 8:49, David Holmes wrote: >>> Hi Dmitry, >>> >>> On 29/02/2016 9:27 PM, Dmitry Dmitriev wrote: >>>> Hello, >>>> >>>> Please review this patch, which integrates the selection/resolution >>>> test >>>> suite into the JTreg test suite. This test suite was developed by >>>> Eric >>>> Mccorkle(OpenJDK: emc). Thanks Eric for that! >>>> >>>> This test suite uses a template-based generation scheme to exercise >>>> all >>>> aspects of the updated selection/resolution test suite from JVMS >>>> 8. It >>>> runs a very large number of tests, representing a very wide variety of >>>> cases. Extensive javadoc comments are found throughout the test code >>>> which describe the suite's functioning in more detail. >>>> >>>> Also note that this suite as already undergone extensive review as >>>> part >>>> of the development process. >>>> >>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8078112 >>>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.00/ >>>> >>>> Testing: Jprt, RBT(all platforms, product & fastdebug builds) >>> >>> I hate to open this debate again but I see: >>> >>> @library /runtime/SelectionResolution/classes >>> >>> but no instructions on how to build the library contents. >>> >>> Do we really need to specify a timeout? >>> >>> @run main/othervm/timeout=300 >>> >>> Will these tests now run as part of JPRT submissions? If so: >>> a) have they been tested on all platforms? >>> b) how long do they take to run? >>> >>> Thanks, >>> David >>> >>> >>>> Thanks, >>>> Dmitry >> From aph at redhat.com Wed Mar 2 08:45:30 2016 From: aph at redhat.com (Andrew Haley) Date: Wed, 2 Mar 2016 08:45:30 +0000 Subject: RFR (S) 8150465: Unsafe methods to produce uninitialized arrays In-Reply-To: <56D62705.2020506@oracle.com> References: <56CE3222.6040207@oracle.com> <56CECE5E.4080105@redhat.com> <56CF053A.3070607@oracle.com> <56CF0C1A.4040600@redhat.com> <56CF1163.4040005@oracle.com> <6D79C6DB-B770-4CAA-9338-154589441F8B@oracle.com> <56CF86EE.6070704@oracle.com> <56D62705.2020506@oracle.com> Message-ID: <56D6A82A.2030302@redhat.com> On 01/03/16 23:34, Jim Graham wrote: > Thanks Paul, > > That code doesn't seem to follow the recommendations in the new > allocateUninit() method as far as publicizing the address field. Unless > unsafe.setMemory() does a fence? DirectByteBuffer.cleaner is final, so there is a fence at the end of DirectByteBuffer's constructor. But there is perhaps a race here because a Deallocator instance is created before the Unsafe.setMemory() becomes observable to the cleaner thread. I don't think that matters as long as the Deallocator is sane, but it's not a pattern I like much. Andrew. From kirk.pepperdine at gmail.com Wed Mar 2 11:34:04 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Wed, 2 Mar 2016 05:34:04 -0600 Subject: safepoint accumulating time counter In-Reply-To: References: <7845BD64-DD13-4ED8-A2A1-B6858BF2FA7A@oracle.com> Message-ID: <2627E4E9-9B1B-421D-9EBD-2FD89861341D@gmail.com> Hi Brian, You can see the name of the MXBean interface in the metadata view. In that view you can see that the Diagnostic MXBean is not the one you are looking for. It would seem that this MXBean has not been registered with the PlatformMBeanServer. Regards, Kirk > On Feb 29, 2016, at 5:04 PM, Brian Toal wrote: > > When I pull up jconsole and connect to a 1.8 runtime, I see > com.sun.management (not sun.management) and under the HotSpotDiagnostic > MBean I don't see any of the attributes mentioned. Is there something I > need to do to enable the sun.management.HotspotRuntimeMBean? > > On Mon, Feb 29, 2016 at 10:02 AM, Carsten Varming wrote: > >> Dear Brian, >> >> I believe the HotspotRuntimeMBean[1] exports total time spent in >> safepoints. >> >> [1]: >> http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/5972ad24ef27/src/share/classes/sun/management/HotspotRuntimeMBean.java >> >> Carsten >> >> On Mon, Feb 29, 2016 at 12:35 PM, charlie hunt >> wrote: >> >>> Hi Brian, >>> >>> Nice to hear from you! >>> >>> Look at +PrintSafepointStatistics. I think you will figure it out from >>> there. >>> >>> AFAIR, info is not exposed in an MBean. >>> >>> hths, >>> >>> Charlie >>> >>>> On Feb 29, 2016, at 10:32 AM, Brian Toal wrote: >>>> >>>> Hi, does the JVM expose total time spent in safepoints via an MBean or >>>> another mechanism other than PrintGCApplicationStoppedTime? >>> Specifically, >>>> I'm curious whether this feature exists in Java 8. >>> >> >> From erik.joelsson at oracle.com Wed Mar 2 12:27:43 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Wed, 2 Mar 2016 13:27:43 +0100 Subject: RFR JDK-8149644 Integrate VarHandles In-Reply-To: <9C47EF6F-80D6-467E-A5CB-2FDD5FF6AE17@oracle.com> References: <9C47EF6F-80D6-467E-A5CB-2FDD5FF6AE17@oracle.com> Message-ID: <56D6DC3F.30402@oracle.com> Build part looks ok. /Erik On 2016-02-11 16:39, Paul Sandoz wrote: > Hi, > > This is the implementation review request for VarHandles. > > Langtools: > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8149644-varhandles-integration/langtools/webrev/index.html > > Hotspot: > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8149644-varhandles-integration/hotspot/webrev/index.html > > JDK: > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8149644-varhandles-integration/jdk/webrev/index.html > > The spec/API review is proceeding here [1]. > > The patches depend on Unsafe changes [2] and ByteBuffer changes [3]. > > Recent (as of today) JPRT runs for core and hotspot tests pass without failure. Many parts of the code have been soaking in the Valhalla repo for over a year, and it?s been soaking in the sandbox for quite and many a JPRT run was performed. > > It is planned to push through hs-comp as is the case for the dependent patches, and thus minimise any delays due to integration between forests. > > > The Langtools changes are small. Tweaks were made to support updates to signature polymorphic methods and where may be located, in addition to supporting compilation of calls to MethodHandle.link*. > > > The Hotspot changes are not very large. It?s mostly a matter of augmenting checks for MethodHandle to include that for VarHandle. It?s tempting to generalise the ?invokehandle" invocation as i believe there are other use-cases where it might be useful, but i resisted temptation here. I wanted to focus on the minimal changes required. > > > The JDK changes are more substantial, but a large proportion are new tests. The source compilation approach taken is to use templates, the same approach as for code in the nio package, to generate both implementation and test source code. The implementations are generated by the build, the tests are pre-generated. I believe the tests should have good coverage but we have yet to run any code coverage tool. > > The approach to invocation of VarHandle signature polymoprhic methods is slightly different to that of MethodHandles. I wanted to ensure that linking for the common cases avoids lambda form creation, compilation and therefore class spinning. That reduces start up costs and also potential circular dependencies that might be induced in the VM boot process if VarHandles are employed early on. > > For common basic (i.e. erased ref and widened primitive) method signatures, namely all those that matter for the efficient atomic operations there are pre-generated methods that would otherwise be generated from creating and compiling invoker lambda forms. Those methods reside on the VarHandleGuards class. When the VM makes an up call to MethodHandleNatives.linkMethod to link a call site then this up-called method will first check if an appropriate pre-generated method exists on VarHandleGuards and if so it links to that, otherwise it falls back to a method on a class generated from compiling a lambda form. For testing purposes there is a system property available to switch off this optimisation when linking [*]. > > Each VarHandle instance of the same variable type produced from the same factory will share an underlying immutable instance of a VarForm that contains a set of MemberName instances, one for each implementation of a signature polymorphic method (a value of null means unsupported). The invoke methods (on VarHandleGuards or on lambda forms) will statically link to such MemberName instances using a call to MethodHandle.linkToStatic. > > There are a couple of TODOs in comments, those are all on non-critical code paths and i plan to chase them up afterwards. > > C1 does not support constant folding for @Stable arrays hence why in certain cases we have exploded stuff into fields that are operated on using if/else loops. We can simplify such code if/when C1 support is added. > > > Thanks, > Paul. > > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/038150.html > [2] http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2016-January/020953.html > http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-January/021514.html > [3] http://mail.openjdk.java.net/pipermail/nio-dev/2016-February/003535.html > > [*] This technique might be useful for common signatures of MH invokers to reduce associated costs of lambda form creation and compilation in the interim of something better. From tobias.hartmann at oracle.com Wed Mar 2 12:30:57 2016 From: tobias.hartmann at oracle.com (Tobias Hartmann) Date: Wed, 2 Mar 2016 13:30:57 +0100 Subject: [9] RFR(XS): 8151024: Remove TCKJapaneseChronology.java from the problem list Message-ID: <56D6DD01.40208@oracle.com> Hi, please review the following patch that removes TCKJapaneseChronology.java from the problem list after JDK-8134979 was fixed (closed as duplicate of JDK-8134974). https://bugs.openjdk.java.net/browse/JDK-8151024 http://cr.openjdk.java.net/~thartmann/8151024/webrev.00/ I intend to push this into hs-comp. Best regards, Tobias From paul.sandoz at oracle.com Wed Mar 2 12:33:01 2016 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 2 Mar 2016 13:33:01 +0100 Subject: RFR (M): 8149159: Clean up Unsafe In-Reply-To: <56D5CA22.7050308@oracle.com> References: <56C61A07.4010604@oracle.com> <56C7757E.4070806@oracle.com> <56D5CA22.7050308@oracle.com> Message-ID: <5BC69CC7-9933-4504-AA23-8BDCF75CEEE9@oracle.com> > On 1 Mar 2016, at 17:58, Mikael Vidstedt wrote: > > > Thanks for all the great feedback/questions. Updated webrev(s) here: > > http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/hotspot/webrev.01.incr/webrev/ > http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/jdk/webrev.01.incr/webrev/ > +1 > Also, here are the changes after rebasing on top of hs-comp to include Aleksey's recent changes to Unsafe. There were some conflicts in unsafe.cpp where the new methods/functions were added, so I had to resolve that and apply the cleanup to them as well. > > hotspot: http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/hotspot/webrev.01/webrev/ > jdk: http://cr.openjdk.java.net/~mikael/webrevs/8149159_unsafecleanup/jdk/webrev.01/webrev/ > > > * Changes > > Apart from resolving the conflicts in unsafe.cpp, this change include the following changes compared to webrev.00: > > Claes - you are absolutely about right about the missing annotations, I have gone through and added the ForceInline annotation to all the s.m.Unsafe methods were it was missing. Thanks for catching that! > IMO this is a nice to have and good to be consistent to avoid any missing anything; not strictly necessary for methods that are not marked as intrinsic in the ?real? Unsafe (i assumed, perhaps incorrectly, that was the case for all such non-annotated methods). > Chris - I chose to completely remove the UnsafeWrapper macro and its uses from unsafe.cpp. After all it's empty right now, and if somebody feels like adding it back it can simply be injected into the UNSAFE_ENTRY/UNSAFE_LEAF macros. > > > * Testing > > I've run both -testset hotspot and -testset core on this, and FWIW it's all green. > > > * Comments/other > > Stas - Wrt to the changes to the unsafe.cpp function names, I chose to rename the functions to include the suffix "0" to reflect the name change of the corresponding java (native) methods. While it's not strictly necessary it does feel just a tad clearer/more intuitive to me to have the names match. > > John/Paul - I filed https://bugs.openjdk.java.net/browse/JDK-8150921 to cover the migration from single (long) addressing modes for the Unsafe getters/setters to the double-register (Object + long) equivalents. > Great! For that we might require some careful analysis of generated code to ensure the double addressing accessor with a null base value generates the same code as the current single addressing accessor. Paul. From vladimir.x.ivanov at oracle.com Wed Mar 2 13:06:57 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Wed, 2 Mar 2016 16:06:57 +0300 Subject: [9] RFR(XS): 8151024: Remove TCKJapaneseChronology.java from the problem list In-Reply-To: <56D6DD01.40208@oracle.com> References: <56D6DD01.40208@oracle.com> Message-ID: <56D6E571.50707@oracle.com> Looks good. Best regards, Vladimir Ivanov On 3/2/16 3:30 PM, Tobias Hartmann wrote: > Hi, > > please review the following patch that removes TCKJapaneseChronology.java from the problem list after JDK-8134979 was fixed (closed as duplicate of JDK-8134974). > > https://bugs.openjdk.java.net/browse/JDK-8151024 > http://cr.openjdk.java.net/~thartmann/8151024/webrev.00/ > > I intend to push this into hs-comp. > > Best regards, > Tobias > From tobias.hartmann at oracle.com Wed Mar 2 13:13:32 2016 From: tobias.hartmann at oracle.com (Tobias Hartmann) Date: Wed, 2 Mar 2016 14:13:32 +0100 Subject: [9] RFR(XS): 8151024: Remove TCKJapaneseChronology.java from the problem list In-Reply-To: <56D6E571.50707@oracle.com> References: <56D6DD01.40208@oracle.com> <56D6E571.50707@oracle.com> Message-ID: <56D6E6FC.6010100@oracle.com> Thanks, Vladimir. Best regards, Tobias On 02.03.2016 14:06, Vladimir Ivanov wrote: > Looks good. > > Best regards, > Vladimir Ivanov > > On 3/2/16 3:30 PM, Tobias Hartmann wrote: >> Hi, >> >> please review the following patch that removes TCKJapaneseChronology.java from the problem list after JDK-8134979 was fixed (closed as duplicate of JDK-8134974). >> >> https://bugs.openjdk.java.net/browse/JDK-8151024 >> http://cr.openjdk.java.net/~thartmann/8151024/webrev.00/ >> >> I intend to push this into hs-comp. >> >> Best regards, >> Tobias >> From kirk.pepperdine at gmail.com Wed Mar 2 15:20:18 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Wed, 2 Mar 2016 09:20:18 -0600 Subject: PollArrayWrapper.c Message-ID: <680AB042-BF0E-43AF-93ED-7167FCD03AF4@gmail.com> Hi, I was looking at PollArrayWrapper.c and I saw this. #define RESTARTABLE(_cmd, _result) do { \ do { \ _result = _cmd; \ } while((_result == -1) && (errno == EINTR)); \ } while(0) Is there a reason why this logic is wrapped in a do { ?. } while(0) Regards, Kirk From aph at redhat.com Wed Mar 2 15:51:41 2016 From: aph at redhat.com (Andrew Haley) Date: Wed, 2 Mar 2016 15:51:41 +0000 Subject: PollArrayWrapper.c In-Reply-To: <680AB042-BF0E-43AF-93ED-7167FCD03AF4@gmail.com> References: <680AB042-BF0E-43AF-93ED-7167FCD03AF4@gmail.com> Message-ID: <56D70C0D.3060608@redhat.com> On 03/02/2016 03:20 PM, kirk.pepperdine at gmail.com wrote: > Is there a reason why this logic is wrapped in a do { ?. } while(0) Every multi-statement #define must always be wrapped in do { ?. } while(0) consider if (blah) MACRO; else stuff; The { } mean the right thing happens with multiple statments; the while 0 eats the trailing semicolon in MACRO; Andrew. From kirk.pepperdine at gmail.com Wed Mar 2 15:56:30 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Wed, 2 Mar 2016 09:56:30 -0600 Subject: PollArrayWrapper.c In-Reply-To: <56D70C0D.3060608@redhat.com> References: <680AB042-BF0E-43AF-93ED-7167FCD03AF4@gmail.com> <56D70C0D.3060608@redhat.com> Message-ID: Hi Andrew, Thanks for the boring (as in good) answer. In this case it?s superfluous as it?s wrapping a single statement but.. Regards, Kirk > On Mar 2, 2016, at 9:51 AM, Andrew Haley wrote: > > On 03/02/2016 03:20 PM, kirk.pepperdine at gmail.com wrote: >> Is there a reason why this logic is wrapped in a do { ?. } while(0) > > Every multi-statement #define must always be wrapped in do { ?. } while(0) > > consider > > if (blah) > MACRO; > else > stuff; > > The { } mean the right thing happens with multiple statments; > the while 0 eats the trailing semicolon in > > MACRO; > > Andrew. > From aph at redhat.com Wed Mar 2 15:58:46 2016 From: aph at redhat.com (Andrew Haley) Date: Wed, 2 Mar 2016 15:58:46 +0000 Subject: PollArrayWrapper.c In-Reply-To: References: <680AB042-BF0E-43AF-93ED-7167FCD03AF4@gmail.com> <56D70C0D.3060608@redhat.com> Message-ID: <56D70DB6.4020305@redhat.com> On 03/02/2016 03:56 PM, kirk.pepperdine at gmail.com wrote: > Thanks for the boring (as in good) answer. In this case it?s superfluous as it?s wrapping a single statement but.. ... always do it, because that might change, and it costs nothing. Andrew. From dmitry.dmitriev at oracle.com Wed Mar 2 16:03:52 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 2 Mar 2016 19:03:52 +0300 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56CDA375.4090501@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> Message-ID: <56D70EE8.4020403@oracle.com> Hello Coleen, I implement refactoring which removes repeating of '&' expression. In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed extracting of oopDesc* from oop and added call to check_obj_alignment instead. Updated webrev.01: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ Testing: jprt, hotspot_all & vm.quick(still in progress, no new failures). Thanks, Dmitry On 24.02.2016 15:35, Coleen Phillimore wrote: > > From > http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1OopClosures.inline.hpp.udiff.html > > http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1RemSet.inline.hpp.udiff.html > > > Can you just call > > assert(check_obj_alignment(o), "not oop aligned"); > > rather than repeating the & expression? The check_obj_alignment is > inlined. > > Coleen > > On 2/24/16 5:42 AM, Dmitry Dmitriev wrote: >> Hello, >> >> Please, review small optimization to the object alignment check in >> the debug builds. In this fix I replace division by >> MinObjAlignmentInBytes to bitwise AND operation with >> MinObjAlignmentInBytesMask, because MinObjAlignmentInBytes is a power >> of two. Suggested construction already used in MacroAssembler, e.g. >> hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp). >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8149973 >> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/ >> >> Testing: jprt, hotspot_all >> >> Thanks, >> Dmitry > From coleen.phillimore at oracle.com Wed Mar 2 16:32:11 2016 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 2 Mar 2016 11:32:11 -0500 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56D70EE8.4020403@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> Message-ID: <56D7158B.9090002@oracle.com> Dmitry, That change looks nice! Coleen On 3/2/16 11:03 AM, Dmitry Dmitriev wrote: > Hello Coleen, > > I implement refactoring which removes repeating of '&' expression. > In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed > extracting of oopDesc* from oop and added call to check_obj_alignment > instead. > Updated webrev.01: > http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ > > Testing: jprt, hotspot_all & vm.quick(still in progress, no new > failures). > > Thanks, > Dmitry > > > On 24.02.2016 15:35, Coleen Phillimore wrote: >> >> From >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1OopClosures.inline.hpp.udiff.html >> >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1RemSet.inline.hpp.udiff.html >> >> >> Can you just call >> >> assert(check_obj_alignment(o), "not oop aligned"); >> >> rather than repeating the & expression? The check_obj_alignment is >> inlined. >> >> Coleen >> >> On 2/24/16 5:42 AM, Dmitry Dmitriev wrote: >>> Hello, >>> >>> Please, review small optimization to the object alignment check in >>> the debug builds. In this fix I replace division by >>> MinObjAlignmentInBytes to bitwise AND operation with >>> MinObjAlignmentInBytesMask, because MinObjAlignmentInBytes is a >>> power of two. Suggested construction already used in MacroAssembler, >>> e.g. hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp). >>> >>> JBS: https://bugs.openjdk.java.net/browse/JDK-8149973 >>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/ >>> >>> Testing: jprt, hotspot_all >>> >>> Thanks, >>> Dmitry >> > From dmitry.dmitriev at oracle.com Wed Mar 2 16:58:19 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 2 Mar 2016 19:58:19 +0300 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56D7158B.9090002@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> <56D7158B.9090002@oracle.com> Message-ID: <56D71BAB.9040806@oracle.com> Coleen, thank you! Dmitry On 02.03.2016 19:32, Coleen Phillimore wrote: > Dmitry, > That change looks nice! > Coleen > > On 3/2/16 11:03 AM, Dmitry Dmitriev wrote: >> Hello Coleen, >> >> I implement refactoring which removes repeating of '&' expression. >> In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed >> extracting of oopDesc* from oop and added call to check_obj_alignment >> instead. >> Updated webrev.01: >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ >> >> Testing: jprt, hotspot_all & vm.quick(still in progress, no new >> failures). >> >> Thanks, >> Dmitry >> >> >> On 24.02.2016 15:35, Coleen Phillimore wrote: >>> >>> From >>> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1OopClosures.inline.hpp.udiff.html >>> >>> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1RemSet.inline.hpp.udiff.html >>> >>> >>> Can you just call >>> >>> assert(check_obj_alignment(o), "not oop aligned"); >>> >>> rather than repeating the & expression? The check_obj_alignment is >>> inlined. >>> >>> Coleen >>> >>> On 2/24/16 5:42 AM, Dmitry Dmitriev wrote: >>>> Hello, >>>> >>>> Please, review small optimization to the object alignment check in >>>> the debug builds. In this fix I replace division by >>>> MinObjAlignmentInBytes to bitwise AND operation with >>>> MinObjAlignmentInBytesMask, because MinObjAlignmentInBytes is a >>>> power of two. Suggested construction already used in >>>> MacroAssembler, e.g. >>>> hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp). >>>> >>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8149973 >>>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/ >>>> >>>> Testing: jprt, hotspot_all >>>> >>>> Thanks, >>>> Dmitry >>> >> > From thomas.schatzl at oracle.com Wed Mar 2 17:03:57 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Wed, 02 Mar 2016 18:03:57 +0100 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56D70EE8.4020403@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> Message-ID: <1456938237.10257.0.camel@oracle.com> Hi, On Wed, 2016-03-02 at 19:03 +0300, Dmitry Dmitriev wrote: > Hello Coleen, > > I implement refactoring which removes repeating of '&' expression. > In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed > extracting > of oopDesc* from oop and added call to check_obj_alignment instead. > Updated webrev.01: > http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ > > Testing: jprt, hotspot_all & vm.quick(still in progress, no new > failures). looks good. Thomas From dmitry.dmitriev at oracle.com Wed Mar 2 17:18:41 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 2 Mar 2016 20:18:41 +0300 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <1456938237.10257.0.camel@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> <1456938237.10257.0.camel@oracle.com> Message-ID: <56D72071.6050304@oracle.com> Thomas, thank you for the review! Dmitry On 02.03.2016 20:03, Thomas Schatzl wrote: > Hi, > > On Wed, 2016-03-02 at 19:03 +0300, Dmitry Dmitriev wrote: >> Hello Coleen, >> >> I implement refactoring which removes repeating of '&' expression. >> In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed >> extracting >> of oopDesc* from oop and added call to check_obj_alignment instead. >> Updated webrev.01: >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ >> >> Testing: jprt, hotspot_all & vm.quick(still in progress, no new >> failures). > looks good. > > Thomas From Guy.Delamarter at oracle.com Wed Mar 2 23:33:42 2016 From: Guy.Delamarter at oracle.com (Guy Delamarter) Date: Wed, 2 Mar 2016 15:33:42 -0800 Subject: [9] RFR(S): 8144693: Intrinsify StringCoding.hasNegatives() on SPARC Message-ID: <56D77856.1020707@oracle.com> Hi, Please review the following patch adding a SPARC intrinsic for StringCoding.hasNegatives to hotspot and supporting changes. Tobias Hartmann (tobias.hartmann at oracle.com) has offered to sponsor these changes. Summary: hasNegatives is a utility method for encoding/decoding under the new Compact Strings framework, returning whether the given byte array (segment) contains any negative entries. hasNegatives is an intrinsic candidate, emitted by hotspot as a node in the latest Java 9 builds, but the SPARC node match and (inline assembly) implementation have been missing up to now. This implementation checks aligned 8-byte windows onto the array segment for negative bytes, carefully ignoring bytes in the window that happen to be outside the segment. It was discovered that the private access of the hasNegatives method prevented direct testing of the intrinsic from outside StringCoding, so that was changed to public. Subsequent to this change a compiler test class (TestHasNegatives) was added providing useful validation coverage. Webrevs: http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.00/ http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.00/ Issue: https://bugs.openjdk.java.net/browse/JDK-8144693 Thanks, Guy Delamarter From david.holmes at oracle.com Thu Mar 3 02:43:07 2016 From: david.holmes at oracle.com (David Holmes) Date: Thu, 3 Mar 2016 12:43:07 +1000 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56D70EE8.4020403@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> Message-ID: <56D7A4BB.5050402@oracle.com> On 3/03/2016 2:03 AM, Dmitry Dmitriev wrote: > Hello Coleen, > > I implement refactoring which removes repeating of '&' expression. > In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed extracting > of oopDesc* from oop and added call to check_obj_alignment instead. > Updated webrev.01: > http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ > > Testing: jprt, hotspot_all & vm.quick(still in progress, no new failures). I'm unclear on how the CHECK_UNHANDLED_OOPS case is handled in the cast_from_oop. In the original we had to "unwrap" obj as obj.obj(), but that no longer appears anywhere. ?? Thanks, David > Thanks, > Dmitry > > > On 24.02.2016 15:35, Coleen Phillimore wrote: >> >> From >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1OopClosures.inline.hpp.udiff.html >> >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1RemSet.inline.hpp.udiff.html >> >> >> Can you just call >> >> assert(check_obj_alignment(o), "not oop aligned"); >> >> rather than repeating the & expression? The check_obj_alignment is >> inlined. >> >> Coleen >> >> On 2/24/16 5:42 AM, Dmitry Dmitriev wrote: >>> Hello, >>> >>> Please, review small optimization to the object alignment check in >>> the debug builds. In this fix I replace division by >>> MinObjAlignmentInBytes to bitwise AND operation with >>> MinObjAlignmentInBytesMask, because MinObjAlignmentInBytes is a power >>> of two. Suggested construction already used in MacroAssembler, e.g. >>> hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp). >>> >>> JBS: https://bugs.openjdk.java.net/browse/JDK-8149973 >>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/ >>> >>> Testing: jprt, hotspot_all >>> >>> Thanks, >>> Dmitry >> > From coleen.phillimore at oracle.com Thu Mar 3 02:58:00 2016 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 2 Mar 2016 21:58:00 -0500 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56D7A4BB.5050402@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> <56D7A4BB.5050402@oracle.com> Message-ID: <56D7A838.4080609@oracle.com> On 3/2/16 9:43 PM, David Holmes wrote: > On 3/03/2016 2:03 AM, Dmitry Dmitriev wrote: >> Hello Coleen, >> >> I implement refactoring which removes repeating of '&' expression. >> In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed extracting >> of oopDesc* from oop and added call to check_obj_alignment instead. >> Updated webrev.01: >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ >> >> Testing: jprt, hotspot_all & vm.quick(still in progress, no new >> failures). > > I'm unclear on how the CHECK_UNHANDLED_OOPS case is handled in the > cast_from_oop. In the original we had to "unwrap" obj as obj.obj(), > but that no longer appears anywhere. ?? It's done implicitly. Coleen > > Thanks, > David > >> Thanks, >> Dmitry >> >> >> On 24.02.2016 15:35, Coleen Phillimore wrote: >>> >>> From >>> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1OopClosures.inline.hpp.udiff.html >>> >>> >>> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1RemSet.inline.hpp.udiff.html >>> >>> >>> >>> Can you just call >>> >>> assert(check_obj_alignment(o), "not oop aligned"); >>> >>> rather than repeating the & expression? The check_obj_alignment is >>> inlined. >>> >>> Coleen >>> >>> On 2/24/16 5:42 AM, Dmitry Dmitriev wrote: >>>> Hello, >>>> >>>> Please, review small optimization to the object alignment check in >>>> the debug builds. In this fix I replace division by >>>> MinObjAlignmentInBytes to bitwise AND operation with >>>> MinObjAlignmentInBytesMask, because MinObjAlignmentInBytes is a power >>>> of two. Suggested construction already used in MacroAssembler, e.g. >>>> hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp). >>>> >>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8149973 >>>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/ >>>> >>>> Testing: jprt, hotspot_all >>>> >>>> Thanks, >>>> Dmitry >>> >> From vladimir.kozlov at oracle.com Thu Mar 3 04:37:58 2016 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Wed, 2 Mar 2016 20:37:58 -0800 Subject: [9] RFR(S): 8144693: Intrinsify StringCoding.hasNegatives() on SPARC In-Reply-To: <56D77856.1020707@oracle.com> References: <56D77856.1020707@oracle.com> Message-ID: <56D7BFA6.1000401@oracle.com> Why you are avoiding the same register for src and dst in instructions? For example: + add(t3, 0x80, t2); I think you can use less registers if you reuse registers. The less registers you use - less registers will be spilled on stack in the code which use your code. 'size' register is defined as 32-bit values in .ad file. It may have garbage in apper bits - I would suggest to sign extend it before using: signx(size); If size is small (t5 != 0 for unaligned header) may be we should just jump to tail code to do right shift (to mov(0, result); instruction). But I am not insisting on this. Thanks, Vladimir On 3/2/16 3:33 PM, Guy Delamarter wrote: > Hi, > > Please review the following patch adding a SPARC intrinsic for > StringCoding.hasNegatives to hotspot and supporting changes. > > Tobias Hartmann (tobias.hartmann at oracle.com) has offered to > sponsor these changes. > > > Summary: > > hasNegatives is a utility method for encoding/decoding under the new > Compact Strings framework, returning whether the given byte array > (segment) contains any negative entries. hasNegatives is an intrinsic > candidate, emitted by hotspot as a node in the latest Java 9 builds, > but the SPARC node match and (inline assembly) implementation have > been missing up to now. This implementation checks aligned 8-byte > windows onto the array segment for negative bytes, carefully ignoring > bytes in the window that happen to be outside the segment. > > It was discovered that the private access of the hasNegatives method > prevented direct testing of the intrinsic from outside StringCoding, > so that was changed to public. Subsequent to this change a compiler > test class (TestHasNegatives) was added providing useful validation > coverage. > > > Webrevs: > http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.00/ > http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.00/ > > Issue: > https://bugs.openjdk.java.net/browse/JDK-8144693 > > > Thanks, > Guy Delamarter > From dmitry.dmitriev at oracle.com Thu Mar 3 08:52:12 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Thu, 3 Mar 2016 11:52:12 +0300 Subject: RFR(XS): 8149973: Optimize object alignment check in debug builds. In-Reply-To: <56D7A4BB.5050402@oracle.com> References: <56CD892B.20409@oracle.com> <56CDA375.4090501@oracle.com> <56D70EE8.4020403@oracle.com> <56D7A4BB.5050402@oracle.com> Message-ID: <56D7FB3C.8070701@oracle.com> Hello David, Good question, as Coleen wrote this is done implicitly. Let me add few more details. cast_from_oop is defined in share/vm/oops/oopsHierarchy.hpp: template inline T cast_from_oop(oop o) { return (T)(CHECK_UNHANDLED_OOPS_ONLY((void*))o); } CHECK_UNHANDLED_OOPS_ONLY is defined in share/vm/utilities/macros.hpp: #ifdef CHECK_UNHANDLED_OOPS #define CHECK_UNHANDLED_OOPS_ONLY(code) code #define NOT_CHECK_UNHANDLED_OOPS(code) #else #define CHECK_UNHANDLED_OOPS_ONLY(code) #define NOT_CHECK_UNHANDLED_OOPS(code) code #endif // CHECK_UNHANDLED_OOPS I.e. in case when CHECK_UNHANDLED_OOPS is defined cast_from_oop will looks like this: template inline T cast_from_oop(oop o) { return (T)((void*)o); } oop have an explicit user conversions for 'void *': operator void* () const { return (void *)obj(); } I.e. cast_from_oop(obj) will evaluates to the: (intptr_t) (obj.obj()) Thanks, Dmitry On 03.03.2016 5:43, David Holmes wrote: > On 3/03/2016 2:03 AM, Dmitry Dmitriev wrote: >> Hello Coleen, >> >> I implement refactoring which removes repeating of '&' expression. >> In g1OopClosures.inline.hpp and g1RemSet.inline.hpp I removed extracting >> of oopDesc* from oop and added call to check_obj_alignment instead. >> Updated webrev.01: >> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.01/ >> >> Testing: jprt, hotspot_all & vm.quick(still in progress, no new >> failures). > > I'm unclear on how the CHECK_UNHANDLED_OOPS case is handled in the > cast_from_oop. In the original we had to "unwrap" obj as obj.obj(), > but that no longer appears anywhere. ?? > > Thanks, > David > >> Thanks, >> Dmitry >> >> >> On 24.02.2016 15:35, Coleen Phillimore wrote: >>> >>> From >>> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1OopClosures.inline.hpp.udiff.html >>> >>> >>> http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/src/share/vm/gc/g1/g1RemSet.inline.hpp.udiff.html >>> >>> >>> >>> Can you just call >>> >>> assert(check_obj_alignment(o), "not oop aligned"); >>> >>> rather than repeating the & expression? The check_obj_alignment is >>> inlined. >>> >>> Coleen >>> >>> On 2/24/16 5:42 AM, Dmitry Dmitriev wrote: >>>> Hello, >>>> >>>> Please, review small optimization to the object alignment check in >>>> the debug builds. In this fix I replace division by >>>> MinObjAlignmentInBytes to bitwise AND operation with >>>> MinObjAlignmentInBytesMask, because MinObjAlignmentInBytes is a power >>>> of two. Suggested construction already used in MacroAssembler, e.g. >>>> hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp). >>>> >>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8149973 >>>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8149973/webrev.00/ >>>> >>>> Testing: jprt, hotspot_all >>>> >>>> Thanks, >>>> Dmitry >>> >> From vladimir.x.ivanov at oracle.com Thu Mar 3 10:40:51 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Thu, 3 Mar 2016 13:40:51 +0300 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock Message-ID: <56D814B3.3000605@oracle.com> http://cr.openjdk.java.net/~vlivanov/8139247/webrev.00 https://bugs.openjdk.java.net/browse/JDK-8139247 Solaris Studio C++ compiler generates tightly coupled Monitor::lock/unlock calls for unnamed MutexLocker which breaks synchronization between ciMethodData::load_extra_data() and MethodData::bci_to_extra_data(). MutexLocker(mdo->extra_data_lock()); is compiled into: load_extra_data+0x001d: movq %r13,%rdi load_extra_data+0x0020: call lock [ 0xfffffd7fe6df46c0, .+0x7cc5c0 ] load_extra_data+0x0025: movq %r13,%rdi load_extra_data+0x0028: call unlock [ 0xfffffd7fe6df47f0, .+0x7cc6e8 But after adding a name, we hit a compiler bug in SS12u4 and Monitor::unlock call is missed. So, have to add a workaround (same as in JDK-8146616 [1]). Testing: verified machine code for ciMethodData::load_extra_data(). Best regards, Vladimir Ivanov [1] https://bugs.openjdk.java.net/browse/JDK-8146616 From roland.westrelin at oracle.com Thu Mar 3 11:42:25 2016 From: roland.westrelin at oracle.com (Roland Westrelin) Date: Thu, 3 Mar 2016 12:42:25 +0100 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56D814B3.3000605@oracle.com> References: <56D814B3.3000605@oracle.com> Message-ID: <9D853112-129A-435C-B6F8-196CEF50883C@oracle.com> > http://cr.openjdk.java.net/~vlivanov/8139247/webrev.00 That looks good to me. Roland. From christian.tornqvist at oracle.com Thu Mar 3 12:37:56 2016 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Thu, 3 Mar 2016 07:37:56 -0500 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 Message-ID: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> Hi everyone, Please review this change that integrates some of the trivial Hotspot test changes made in Jake, these are all going into jdk9-dev in order to make it into master before M3 hits. There are three different kind of changes included in this webrev: - Adding/correcting Module exports (using @module), this is a no-op in JDK 9 until Jigsaw M3 gets in. - @run driver -> @run main, jtreg has a bug where module exports doesn't work correctly with driver (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a misspelled package name, a new version of jtreg will treat this as an error Changes have been tested by running all of the Hotspot Jtreg tests. Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8151156 Thanks, Christian From george.triantafillou at oracle.com Thu Mar 3 13:00:41 2016 From: george.triantafillou at oracle.com (George Triantafillou) Date: Thu, 3 Mar 2016 08:00:41 -0500 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 In-Reply-To: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> References: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> Message-ID: <56D83579.30403@oracle.com> Hi Christian, Changes look good. -George On 3/3/2016 7:37 AM, Christian Tornqvist wrote: > Hi everyone, > > > > Please review this change that integrates some of the trivial Hotspot test > changes made in Jake, these are all going into jdk9-dev in order to make it > into master before M3 hits. There are three different kind of changes > included in this webrev: > > > > - Adding/correcting Module exports (using @module), this is a no-op > in JDK 9 until Jigsaw M3 gets in. > > - @run driver -> @run main, jtreg has a bug where module exports > doesn't work correctly with driver > (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) > > - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and > test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a > misspelled package name, a new version of jtreg will treat this as an error > > > > Changes have been tested by running all of the Hotspot Jtreg tests. > > > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8151156 > > > > Thanks, > > Christian > > > From harold.seigel at oracle.com Thu Mar 3 13:51:34 2016 From: harold.seigel at oracle.com (harold seigel) Date: Thu, 3 Mar 2016 08:51:34 -0500 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 In-Reply-To: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> References: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> Message-ID: <56D84166.9060100@oracle.com> Hi Christian, The changes look good. Are there any copyrights that need to be updated? Thanks, Harold On 3/3/2016 7:37 AM, Christian Tornqvist wrote: > Hi everyone, > > > > Please review this change that integrates some of the trivial Hotspot test > changes made in Jake, these are all going into jdk9-dev in order to make it > into master before M3 hits. There are three different kind of changes > included in this webrev: > > > > - Adding/correcting Module exports (using @module), this is a no-op > in JDK 9 until Jigsaw M3 gets in. > > - @run driver -> @run main, jtreg has a bug where module exports > doesn't work correctly with driver > (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) > > - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and > test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a > misspelled package name, a new version of jtreg will treat this as an error > > > > Changes have been tested by running all of the Hotspot Jtreg tests. > > > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8151156 > > > > Thanks, > > Christian > > > From daniel.daugherty at oracle.com Thu Mar 3 16:49:29 2016 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Thu, 3 Mar 2016 09:49:29 -0700 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56D814B3.3000605@oracle.com> References: <56D814B3.3000605@oracle.com> Message-ID: <56D86B19.7010206@oracle.com> On 3/3/16 3:40 AM, Vladimir Ivanov wrote: > http://cr.openjdk.java.net/~vlivanov/8139247/webrev.00 src/share/vm/ci/ciMethodData.cpp Nicely done! We've been bitten by the "MutexLocker /*missing name*/ (lock);" before. It's interesting that fixing that runs into JDK-8146616. We should probably make an audit run on finding missing name instances (again). Thumbs up! Dan > https://bugs.openjdk.java.net/browse/JDK-8139247 > > Solaris Studio C++ compiler generates tightly coupled > Monitor::lock/unlock calls for unnamed MutexLocker which breaks > synchronization between ciMethodData::load_extra_data() and > MethodData::bci_to_extra_data(). > > MutexLocker(mdo->extra_data_lock()); > > is compiled into: > > load_extra_data+0x001d: movq %r13,%rdi > load_extra_data+0x0020: call lock [ 0xfffffd7fe6df46c0, .+0x7cc5c0 ] > load_extra_data+0x0025: movq %r13,%rdi > load_extra_data+0x0028: call unlock [ 0xfffffd7fe6df47f0, .+0x7cc6e8 > > But after adding a name, we hit a compiler bug in SS12u4 and > Monitor::unlock call is missed. So, have to add a workaround (same as > in JDK-8146616 [1]). > > Testing: verified machine code for ciMethodData::load_extra_data(). > > Best regards, > Vladimir Ivanov > > [1] https://bugs.openjdk.java.net/browse/JDK-8146616 From christian.tornqvist at oracle.com Thu Mar 3 20:35:32 2016 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Thu, 3 Mar 2016 15:35:32 -0500 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 In-Reply-To: <56D84166.9060100@oracle.com> References: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> <56D84166.9060100@oracle.com> Message-ID: <1c77701d1758c$3bfb2100$b3f16300$@oracle.com> Hi Harold, I've updated the copyrights, thanks for the review! Thanks, Christian -----Original Message----- From: hotspot-dev [mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of harold seigel Sent: Thursday, March 3, 2016 8:52 AM To: hotspot-dev at openjdk.java.net Subject: Re: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 Hi Christian, The changes look good. Are there any copyrights that need to be updated? Thanks, Harold On 3/3/2016 7:37 AM, Christian Tornqvist wrote: > Hi everyone, > > > > Please review this change that integrates some of the trivial Hotspot test > changes made in Jake, these are all going into jdk9-dev in order to > make it > into master before M3 hits. There are three different kind of changes > included in this webrev: > > > > - Adding/correcting Module exports (using @module), this is a no-op > in JDK 9 until Jigsaw M3 gets in. > > - @run driver -> @run main, jtreg has a bug where module exports > doesn't work correctly with driver > (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) > > - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and > test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a > misspelled package name, a new version of jtreg will treat this as an error > > > > Changes have been tested by running all of the Hotspot Jtreg tests. > > > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8151156 > > > > Thanks, > > Christian > > > From david.holmes at oracle.com Thu Mar 3 21:50:04 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 4 Mar 2016 07:50:04 +1000 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56D86B19.7010206@oracle.com> References: <56D814B3.3000605@oracle.com> <56D86B19.7010206@oracle.com> Message-ID: <56D8B18C.5080104@oracle.com> On 4/03/2016 2:49 AM, Daniel D. Daugherty wrote: > On 3/3/16 3:40 AM, Vladimir Ivanov wrote: >> http://cr.openjdk.java.net/~vlivanov/8139247/webrev.00 > > src/share/vm/ci/ciMethodData.cpp > Nicely done! +1 from me. > We've been bitten by the "MutexLocker /*missing name*/ (lock);" before. > It's interesting that fixing that runs into JDK-8146616. We should Yeah - how did Vladimir detect that? Detailed check of the generated code? > probably make an audit run on finding missing name instances (again). Yep here's another one in ./share/vm/utilities/decoder.cpp DecoderLocker::DecoderLocker() : MutexLockerEx(DecoderLocker::is_first_error_thread() ? NULL : Decoder::shared_decoder_lock(), true) { _decoder = is_first_error_thread() ? Decoder::get_error_handler_instance() : Decoder::get_shared_instance(); assert(_decoder != NULL, "null decoder"); } Cheers, David ----- > Thumbs up! > > Dan > > >> https://bugs.openjdk.java.net/browse/JDK-8139247 >> >> Solaris Studio C++ compiler generates tightly coupled >> Monitor::lock/unlock calls for unnamed MutexLocker which breaks >> synchronization between ciMethodData::load_extra_data() and >> MethodData::bci_to_extra_data(). >> >> MutexLocker(mdo->extra_data_lock()); >> >> is compiled into: >> >> load_extra_data+0x001d: movq %r13,%rdi >> load_extra_data+0x0020: call lock [ 0xfffffd7fe6df46c0, .+0x7cc5c0 ] >> load_extra_data+0x0025: movq %r13,%rdi >> load_extra_data+0x0028: call unlock [ 0xfffffd7fe6df47f0, .+0x7cc6e8 >> >> But after adding a name, we hit a compiler bug in SS12u4 and >> Monitor::unlock call is missed. So, have to add a workaround (same as >> in JDK-8146616 [1]). >> >> Testing: verified machine code for ciMethodData::load_extra_data(). >> >> Best regards, >> Vladimir Ivanov >> >> [1] https://bugs.openjdk.java.net/browse/JDK-8146616 > From david.holmes at oracle.com Thu Mar 3 21:57:39 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 4 Mar 2016 07:57:39 +1000 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56D814B3.3000605@oracle.com> References: <56D814B3.3000605@oracle.com> Message-ID: <56D8B353.4030904@oracle.com> On 3/03/2016 8:40 PM, Vladimir Ivanov wrote: > http://cr.openjdk.java.net/~vlivanov/8139247/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8139247 > > Solaris Studio C++ compiler generates tightly coupled > Monitor::lock/unlock calls for unnamed MutexLocker which breaks Just to be clear this is not a compiler bug - the anonymous instance can be destructed at any time after construction as it lives only until the end of the expression that defines it. Arguably any compiler not doing this is the buggy one. :) Cheers, David > synchronization between ciMethodData::load_extra_data() and > MethodData::bci_to_extra_data(). > > MutexLocker(mdo->extra_data_lock()); > > is compiled into: > > load_extra_data+0x001d: movq %r13,%rdi > load_extra_data+0x0020: call lock [ 0xfffffd7fe6df46c0, .+0x7cc5c0 ] > load_extra_data+0x0025: movq %r13,%rdi > load_extra_data+0x0028: call unlock [ 0xfffffd7fe6df47f0, .+0x7cc6e8 > > But after adding a name, we hit a compiler bug in SS12u4 and > Monitor::unlock call is missed. So, have to add a workaround (same as in > JDK-8146616 [1]). > > Testing: verified machine code for ciMethodData::load_extra_data(). > > Best regards, > Vladimir Ivanov > > [1] https://bugs.openjdk.java.net/browse/JDK-8146616 From jon.masamitsu at oracle.com Thu Mar 3 23:46:06 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Thu, 3 Mar 2016 15:46:06 -0800 Subject: RFR 8150013: ParNew: Prune nmethods scavengable list In-Reply-To: References: Message-ID: <56D8CCBE.4040900@oracle.com> Carsten, Changes look good. A couple of suggestions. http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/src/share/vm/code/codeCache.cpp.frames.html 661 if (is_live) { 662 // Perform cur->oops_do(f), maybe just once per nmethod. 663 f->do_code_blob(cur); 664 } 665 nmethod* const next = cur->scavenge_root_link(); 666 if (fix_relocations) { 667 if (!is_live || !cur->detect_scavenge_root_oops()) { 668 unlink_scavenge_root_nmethod(cur, prev); 669 } else { 670 prev = cur; 671 } 672 } 673 cur = next; Although this does not change the actions, I find this easier to read. You and Tony (and whoever else wants to) can vote on it. if (is_live) { ... } else { if (fix_relocations) { if (cur->detect_scavenge_root_oops()) { prev = cur; } else { unlink_scavenge_root_nmethod(cur, prev);} } cur = cur->scavenge_root_link(); } Also I'd suggest a comment before the if-test if you find it correct. // Unless the relocations have been updated (fixed), the // detect_scavenge_root_oops() will not be precise so skip // the check to unlink. Note that not doing the unlinking // is safe but less optimal. if (fix_relocations) { The comment in the header file for fix_relocations helped but a comment here might be helpful. I'll sponsor. Jon On 2/28/2016 6:16 PM, Carsten Varming wrote: > Dear Hotspot developers, > > Any chance of a review of this patch? The patch cut between 7ms and > 10ms of every ParNew with one application at Twitter and I expect a > 1-2ms improvement for most applications. > > I touch the code cache and GenCollectedHeap, so I assume I need > reviews from both gc and compiler reviewers. Thank you Tony Printezis > for the review (posted on the hotspot-gc-dev list). > > I also need a sponsor. > > Carsten > > On Fri, Feb 19, 2016 at 10:52 AM, Carsten Varming > wrote: > > Dear Hotspot developers, > > I would like to contribute a patch for JDK-8150013 > . The current > webrev can be found here: > http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ > . > > Suggestions for improvements are very welcome. > > Carsten > > From david.holmes at oracle.com Fri Mar 4 02:38:24 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 4 Mar 2016 12:38:24 +1000 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 In-Reply-To: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> References: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> Message-ID: <56D8F520.5030504@oracle.com> Hi Christian, On 3/03/2016 10:37 PM, Christian Tornqvist wrote: > Hi everyone, > > > > Please review this change that integrates some of the trivial Hotspot test > changes made in Jake, these are all going into jdk9-dev in order to make it > into master before M3 hits. There are three different kind of changes > included in this webrev: > > > > - Adding/correcting Module exports (using @module), this is a no-op > in JDK 9 until Jigsaw M3 gets in. > > - @run driver -> @run main, jtreg has a bug where module exports > doesn't work correctly with driver > (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) Could this change have an adverse impact on the nightlies, now that unexpected/unwanted options will be passed through to the initial VM? Can you file a follow up bug to switch these all back to @driver once the jtreg problem is fixed. Thanks, David > - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and > test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a > misspelled package name, a new version of jtreg will treat this as an error > > > > Changes have been tested by running all of the Hotspot Jtreg tests. > > > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8151156 > > > > Thanks, > > Christian > > > From christian.tornqvist at oracle.com Fri Mar 4 04:40:06 2016 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Thu, 3 Mar 2016 23:40:06 -0500 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 In-Reply-To: <56D8F520.5030504@oracle.com> References: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> <56D8F520.5030504@oracle.com> Message-ID: <1c97f01d175cf$ed887c40$c89974c0$@oracle.com> Hi David, I've filed https://bugs.openjdk.java.net/browse/JDK-8151248 to deal with changing them back. As for nightly, I'd be surprised if they would fail, we'll handle them if they do. Thanks, Christian -----Original Message----- From: David Holmes [mailto:david.holmes at oracle.com] Sent: Thursday, March 3, 2016 9:38 PM To: Christian Tornqvist ; 'hotspot-dev developers' Subject: Re: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 Hi Christian, On 3/03/2016 10:37 PM, Christian Tornqvist wrote: > Hi everyone, > > > > Please review this change that integrates some of the trivial Hotspot > test changes made in Jake, these are all going into jdk9-dev in order > to make it into master before M3 hits. There are three different kind > of changes included in this webrev: > > > > - Adding/correcting Module exports (using @module), this is a no-op > in JDK 9 until Jigsaw M3 gets in. > > - @run driver -> @run main, jtreg has a bug where module exports > doesn't work correctly with driver > (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) Could this change have an adverse impact on the nightlies, now that unexpected/unwanted options will be passed through to the initial VM? Can you file a follow up bug to switch these all back to @driver once the jtreg problem is fixed. Thanks, David > - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and > test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a > misspelled package name, a new version of jtreg will treat this as an > error > > > > Changes have been tested by running all of the Hotspot Jtreg tests. > > > > Webrev: > > http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ > > > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8151156 > > > > Thanks, > > Christian > > > From david.holmes at oracle.com Fri Mar 4 04:43:57 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 4 Mar 2016 14:43:57 +1000 Subject: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test changes from Jake before Jigsaw M3 In-Reply-To: <1c97f01d175cf$ed887c40$c89974c0$@oracle.com> References: <1c4cd01d17549$837e4d10$8a7ae730$@oracle.com> <56D8F520.5030504@oracle.com> <1c97f01d175cf$ed887c40$c89974c0$@oracle.com> Message-ID: <56D9128D.8020509@oracle.com> On 4/03/2016 2:40 PM, Christian Tornqvist wrote: > Hi David, > > I've filed https://bugs.openjdk.java.net/browse/JDK-8151248 to deal with Thanks. > changing them back. As for nightly, I'd be surprised if they would fail, > we'll handle them if they do. Okay. David > Thanks, > Christian > > -----Original Message----- > From: David Holmes [mailto:david.holmes at oracle.com] > Sent: Thursday, March 3, 2016 9:38 PM > To: Christian Tornqvist ; 'hotspot-dev > developers' > Subject: Re: RFR(M): 8151156 - [TESTBUG] Integrate trivial Hotspot test > changes from Jake before Jigsaw M3 > > Hi Christian, > > On 3/03/2016 10:37 PM, Christian Tornqvist wrote: >> Hi everyone, >> >> >> >> Please review this change that integrates some of the trivial Hotspot >> test changes made in Jake, these are all going into jdk9-dev in order >> to make it into master before M3 hits. There are three different kind >> of changes included in this webrev: >> >> >> >> - Adding/correcting Module exports (using @module), this is a > no-op >> in JDK 9 until Jigsaw M3 gets in. >> >> - @run driver -> @run main, jtreg has a bug where module exports >> doesn't work correctly with driver >> (https://bugs.openjdk.java.net/browse/CODETOOLS-7901589) > > Could this change have an adverse impact on the nightlies, now that > unexpected/unwanted options will be passed through to the initial VM? > > Can you file a follow up bug to switch these all back to @driver once the > jtreg problem is fixed. > > Thanks, > David > >> - Two tests (test/serviceability/dcmd/gc/HeapDumpTest.java and >> test/serviceability/dcmd/gc/HeapDumpAllTest.java) had @build with a >> misspelled package name, a new version of jtreg will treat this as an >> error >> >> >> >> Changes have been tested by running all of the Hotspot Jtreg tests. >> >> >> >> Webrev: >> >> http://cr.openjdk.java.net/~ctornqvi/webrev/8151156/webrev.00/ >> >> >> >> Bug: >> >> https://bugs.openjdk.java.net/browse/JDK-8151156 >> >> >> >> Thanks, >> >> Christian >> >> >> > From christian.tornqvist at oracle.com Fri Mar 4 17:12:58 2016 From: christian.tornqvist at oracle.com (Christian Tornqvist) Date: Fri, 4 Mar 2016 12:12:58 -0500 Subject: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests In-Reply-To: <56D5D3AD.7030308@oracle.com> References: <56D42B0B.6050008@oracle.com> <56D52D87.3040900@oracle.com> <56D5D3AD.7030308@oracle.com> Message-ID: <022d01d17639$19e4bf10$4dae3d30$@oracle.com> Hi Dmitry, This looks good, thanks for taking care of this. Thanks, Christian -----Original Message----- From: hotspot-dev [mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of Dmitry Dmitriev Sent: Tuesday, March 1, 2016 12:39 PM To: David Holmes ; hotspot-dev at openjdk.java.net Subject: Re: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests Hello David, Thank you for the comments! I added build instructions to the tests. I specify timeout because on fastdebug builds test needs more time. Only two tests will be run as part of JPRT submissions - InvokeStaticSuccessTest and NoSuchMethodErrorTest. InvokeStaticSuccessTest takes 1-3 seconds and NoSuchMethodErrorTest takes 2-9 seconds. Other tests are excluded from JPRT run. Updated webrev.01: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.01/ Thank you, Dmitry On 01.03.2016 8:49, David Holmes wrote: > Hi Dmitry, > > On 29/02/2016 9:27 PM, Dmitry Dmitriev wrote: >> Hello, >> >> Please review this patch, which integrates the selection/resolution >> test suite into the JTreg test suite. This test suite was developed >> by Eric >> Mccorkle(OpenJDK: emc). Thanks Eric for that! >> >> This test suite uses a template-based generation scheme to exercise >> all aspects of the updated selection/resolution test suite from JVMS >> 8. It runs a very large number of tests, representing a very wide >> variety of cases. Extensive javadoc comments are found throughout >> the test code which describe the suite's functioning in more detail. >> >> Also note that this suite as already undergone extensive review as >> part of the development process. >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8078112 >> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.00/ >> >> Testing: Jprt, RBT(all platforms, product & fastdebug builds) > > I hate to open this debate again but I see: > > @library /runtime/SelectionResolution/classes > > but no instructions on how to build the library contents. > > Do we really need to specify a timeout? > > @run main/othervm/timeout=300 > > Will these tests now run as part of JPRT submissions? If so: > a) have they been tested on all platforms? > b) how long do they take to run? > > Thanks, > David > > >> Thanks, >> Dmitry From dmitry.dmitriev at oracle.com Fri Mar 4 17:20:51 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Fri, 4 Mar 2016 20:20:51 +0300 Subject: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests In-Reply-To: <022d01d17639$19e4bf10$4dae3d30$@oracle.com> References: <56D42B0B.6050008@oracle.com> <56D52D87.3040900@oracle.com> <56D5D3AD.7030308@oracle.com> <022d01d17639$19e4bf10$4dae3d30$@oracle.com> Message-ID: <56D9C3F3.6010400@oracle.com> Hi Christian, Thank you for the review! Dmitry On 04.03.2016 20:12, Christian Tornqvist wrote: > Hi Dmitry, > > This looks good, thanks for taking care of this. > > Thanks, > Christian > > -----Original Message----- > From: hotspot-dev [mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of Dmitry Dmitriev > Sent: Tuesday, March 1, 2016 12:39 PM > To: David Holmes ; hotspot-dev at openjdk.java.net > Subject: Re: RFR: 8078112: Integrate Selection/Resolution test suite into jtreg tests > > Hello David, > > Thank you for the comments! I added build instructions to the tests. > > I specify timeout because on fastdebug builds test needs more time. > > Only two tests will be run as part of JPRT submissions - InvokeStaticSuccessTest and NoSuchMethodErrorTest. > InvokeStaticSuccessTest takes 1-3 seconds and NoSuchMethodErrorTest takes 2-9 seconds. Other tests are excluded from JPRT run. > > Updated webrev.01: > http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.01/ > > > Thank you, > Dmitry > > On 01.03.2016 8:49, David Holmes wrote: >> Hi Dmitry, >> >> On 29/02/2016 9:27 PM, Dmitry Dmitriev wrote: >>> Hello, >>> >>> Please review this patch, which integrates the selection/resolution >>> test suite into the JTreg test suite. This test suite was developed >>> by Eric >>> Mccorkle(OpenJDK: emc). Thanks Eric for that! >>> >>> This test suite uses a template-based generation scheme to exercise >>> all aspects of the updated selection/resolution test suite from JVMS >>> 8. It runs a very large number of tests, representing a very wide >>> variety of cases. Extensive javadoc comments are found throughout >>> the test code which describe the suite's functioning in more detail. >>> >>> Also note that this suite as already undergone extensive review as >>> part of the development process. >>> >>> JBS: https://bugs.openjdk.java.net/browse/JDK-8078112 >>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8078112/webrev.00/ >>> >>> Testing: Jprt, RBT(all platforms, product & fastdebug builds) >> I hate to open this debate again but I see: >> >> @library /runtime/SelectionResolution/classes >> >> but no instructions on how to build the library contents. >> >> Do we really need to specify a timeout? >> >> @run main/othervm/timeout=300 >> >> Will these tests now run as part of JPRT submissions? If so: >> a) have they been tested on all platforms? >> b) how long do they take to run? >> >> Thanks, >> David >> >> >>> Thanks, >>> Dmitry > From christian.thalinger at oracle.com Fri Mar 4 17:50:28 2016 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Fri, 4 Mar 2016 07:50:28 -1000 Subject: RFR 8150013: ParNew: Prune nmethods scavengable list In-Reply-To: <56D8CCBE.4040900@oracle.com> References: <56D8CCBE.4040900@oracle.com> Message-ID: Jon asked me to have a quick look over the code cache changes. Looks good to me. > On Mar 3, 2016, at 1:46 PM, Jon Masamitsu wrote: > > Carsten, > > Changes look good. > > A couple of suggestions. > > http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/src/share/vm/code/codeCache.cpp.frames.html > > 661 if (is_live) { > 662 // Perform cur->oops_do(f), maybe just once per nmethod. > 663 f->do_code_blob(cur); > 664 } > 665 nmethod* const next = cur->scavenge_root_link(); > 666 if (fix_relocations) { > 667 if (!is_live || !cur->detect_scavenge_root_oops()) { > 668 unlink_scavenge_root_nmethod(cur, prev); > 669 } else { > 670 prev = cur; > 671 } > 672 } > 673 cur = next; > > Although this does not change the actions, I find this easier to > read. You and Tony (and whoever else wants to) can vote > on it. > > if (is_live) { ... } else { > if (fix_relocations) { if (cur->detect_scavenge_root_oops()) { prev = cur; } else { unlink_scavenge_root_nmethod(cur, prev);} } cur = cur->scavenge_root_link(); } > > Also I'd suggest a comment before the if-test > if you find it correct. > > // Unless the relocations have been updated (fixed), the // detect_scavenge_root_oops() will not be precise so skip // the check to unlink. Note that not doing the unlinking // is safe but less optimal. if (fix_relocations) { > > The comment in the header file for fix_relocations helped > but a comment here might be helpful. > > I'll sponsor. > > Jon > > On 2/28/2016 6:16 PM, Carsten Varming wrote: >> Dear Hotspot developers, >> >> Any chance of a review of this patch? The patch cut between 7ms and 10ms of every ParNew with one application at Twitter and I expect a 1-2ms improvement for most applications. >> >> I touch the code cache and GenCollectedHeap, so I assume I need reviews from both gc and compiler reviewers. Thank you Tony Printezis for the review (posted on the hotspot-gc-dev list). >> >> I also need a sponsor. >> >> Carsten >> >> On Fri, Feb 19, 2016 at 10:52 AM, Carsten Varming > wrote: >> >> Dear Hotspot developers, >> >> I would like to contribute a patch for JDK-8150013 >> . The current >> webrev can be found here: >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ >> . >> >> Suggestions for improvements are very welcome. >> >> Carsten >> >> > From varming at gmail.com Fri Mar 4 18:23:57 2016 From: varming at gmail.com (Carsten Varming) Date: Fri, 4 Mar 2016 13:23:57 -0500 Subject: RFR 8150013: ParNew: Prune nmethods scavengable list In-Reply-To: References: <56D8CCBE.4040900@oracle.com> Message-ID: Dear Christian, Thank you for your review. Carsten On Fri, Mar 4, 2016 at 12:50 PM, Christian Thalinger < christian.thalinger at oracle.com> wrote: > Jon asked me to have a quick look over the code cache changes. Looks good > to me. > > > On Mar 3, 2016, at 1:46 PM, Jon Masamitsu > wrote: > > > > Carsten, > > > > Changes look good. > > > > A couple of suggestions. > > > > > http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/src/share/vm/code/codeCache.cpp.frames.html > > > > 661 if (is_live) { > > 662 // Perform cur->oops_do(f), maybe just once per nmethod. > > 663 f->do_code_blob(cur); > > 664 } > > 665 nmethod* const next = cur->scavenge_root_link(); > > 666 if (fix_relocations) { > > 667 if (!is_live || !cur->detect_scavenge_root_oops()) { > > 668 unlink_scavenge_root_nmethod(cur, prev); > > 669 } else { > > 670 prev = cur; > > 671 } > > 672 } > > 673 cur = next; > > > > Although this does not change the actions, I find this easier to > > read. You and Tony (and whoever else wants to) can vote > > on it. > > > > if (is_live) { ... } else { > > if (fix_relocations) { if (cur->detect_scavenge_root_oops()) { prev = > cur; } else { unlink_scavenge_root_nmethod(cur, prev);} } cur = > cur->scavenge_root_link(); } > > > > Also I'd suggest a comment before the if-test > > if you find it correct. > > > > // Unless the relocations have been updated (fixed), the // > detect_scavenge_root_oops() will not be precise so skip // the check to > unlink. Note that not doing the unlinking // is safe but less optimal. if > (fix_relocations) { > > > > The comment in the header file for fix_relocations helped > > but a comment here might be helpful. > > > > I'll sponsor. > > > > Jon > > > > On 2/28/2016 6:16 PM, Carsten Varming wrote: > >> Dear Hotspot developers, > >> > >> Any chance of a review of this patch? The patch cut between 7ms and > 10ms of every ParNew with one application at Twitter and I expect a 1-2ms > improvement for most applications. > >> > >> I touch the code cache and GenCollectedHeap, so I assume I need reviews > from both gc and compiler reviewers. Thank you Tony Printezis for the > review (posted on the hotspot-gc-dev list). > >> > >> I also need a sponsor. > >> > >> Carsten > >> > >> On Fri, Feb 19, 2016 at 10:52 AM, Carsten Varming > wrote: > >> > >> Dear Hotspot developers, > >> > >> I would like to contribute a patch for JDK-8150013 > >> . The current > >> webrev can be found here: > >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ > >> < > http://cr.openjdk.java.net/%7Ecvarming/scavenge_nmethods_auto_prune/2/>. > >> > >> Suggestions for improvements are very welcome. > >> > >> Carsten > >> > >> > > > > From vladimir.x.ivanov at oracle.com Sun Mar 6 12:49:24 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Sun, 6 Mar 2016 15:49:24 +0300 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56D8B18C.5080104@oracle.com> References: <56D814B3.3000605@oracle.com> <56D86B19.7010206@oracle.com> <56D8B18C.5080104@oracle.com> Message-ID: <56DC2754.7030902@oracle.com> Roland, Dan, David, thanks for the reviews. Updated fix: http://cr.openjdk.java.net/~vlivanov/8139247/webrev.01/ I found that ciSpeculativeTrapData::translate_from may block on Compile_lock (in ciMethod ctor [1]), so MDO extra lock has to be unlocked first since it has leaf rank. >> We've been bitten by the "MutexLocker /*missing name*/ (lock);" before. >> It's interesting that fixing that runs into JDK-8146616. We should > > Yeah - how did Vladimir detect that? Detailed check of the generated code? Well, initially I missed that the locker doesn't have a name and went right to the generated code, since I vaguely remembered that there was some bug in SS12u4. And the control flow shape was similar When I added a name, I looked at it again and noticed unlock() is missed. >> probably make an audit run on finding missing name instances (again). > > Yep here's another one in ./share/vm/utilities/decoder.cpp > > DecoderLocker::DecoderLocker() : > MutexLockerEx(DecoderLocker::is_first_error_thread() ? > NULL : Decoder::shared_decoder_lock(), true) { > _decoder = is_first_error_thread() ? > Decoder::get_error_handler_instance() : > Decoder::get_shared_instance(); > assert(_decoder != NULL, "null decoder"); > } Are you sure? It is a constructor call: class DecoderLocker : public MutexLockerEx { All DecodeLocker usages are named. Best regards, Vladimir Ivanov [1] http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/tip/src/share/vm/ci/ciMethod.cpp#l108 > > Cheers, > David > ----- > > >> Thumbs up! >> >> Dan >> >> >>> https://bugs.openjdk.java.net/browse/JDK-8139247 >>> >>> Solaris Studio C++ compiler generates tightly coupled >>> Monitor::lock/unlock calls for unnamed MutexLocker which breaks >>> synchronization between ciMethodData::load_extra_data() and >>> MethodData::bci_to_extra_data(). >>> >>> MutexLocker(mdo->extra_data_lock()); >>> >>> is compiled into: >>> >>> load_extra_data+0x001d: movq %r13,%rdi >>> load_extra_data+0x0020: call lock [ 0xfffffd7fe6df46c0, .+0x7cc5c0 ] >>> load_extra_data+0x0025: movq %r13,%rdi >>> load_extra_data+0x0028: call unlock [ 0xfffffd7fe6df47f0, .+0x7cc6e8 >>> >>> But after adding a name, we hit a compiler bug in SS12u4 and >>> Monitor::unlock call is missed. So, have to add a workaround (same as >>> in JDK-8146616 [1]). >>> >>> Testing: verified machine code for ciMethodData::load_extra_data(). >>> >>> Best regards, >>> Vladimir Ivanov >>> >>> [1] https://bugs.openjdk.java.net/browse/JDK-8146616 >> From david.holmes at oracle.com Sun Mar 6 21:03:26 2016 From: david.holmes at oracle.com (David Holmes) Date: Mon, 7 Mar 2016 07:03:26 +1000 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56DC2754.7030902@oracle.com> References: <56D814B3.3000605@oracle.com> <56D86B19.7010206@oracle.com> <56D8B18C.5080104@oracle.com> <56DC2754.7030902@oracle.com> Message-ID: <56DC9B1E.7040803@oracle.com> On 6/03/2016 10:49 PM, Vladimir Ivanov wrote: > Roland, Dan, David, thanks for the reviews. > > Updated fix: > http://cr.openjdk.java.net/~vlivanov/8139247/webrev.01/ > > I found that ciSpeculativeTrapData::translate_from may block on > Compile_lock (in ciMethod ctor [1]), so MDO extra lock has to be > unlocked first since it has leaf rank. That's interesting - it means even if other compilers were not unlocking the mutex immediately, they were unlocking it prior to this modified code (else the problem would have been detected earlier). Which all suggest that as far as locking is concerned the behaviour of this code is somewhat untested! Why was the assertion removed? Don't forget to update copyright year. >>> We've been bitten by the "MutexLocker /*missing name*/ (lock);" before. >>> It's interesting that fixing that runs into JDK-8146616. We should >> >> Yeah - how did Vladimir detect that? Detailed check of the generated >> code? > Well, initially I missed that the locker doesn't have a name and went > right to the generated code, since I vaguely remembered that there was > some bug in SS12u4. And the control flow shape was similar > > When I added a name, I looked at it again and noticed unlock() is missed. > >>> probably make an audit run on finding missing name instances (again). >> >> Yep here's another one in ./share/vm/utilities/decoder.cpp >> >> DecoderLocker::DecoderLocker() : >> MutexLockerEx(DecoderLocker::is_first_error_thread() ? >> NULL : Decoder::shared_decoder_lock(), true) { >> _decoder = is_first_error_thread() ? >> Decoder::get_error_handler_instance() : >> Decoder::get_shared_instance(); >> assert(_decoder != NULL, "null decoder"); >> } > Are you sure? It is a constructor call: > > class DecoderLocker : public MutexLockerEx { > > All DecodeLocker usages are named. Yep my mistake - thanks. I was only looking at the grep results, I hadn't check the actual usage. Thanks, David > > Best regards, > Vladimir Ivanov > > [1] > http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/tip/src/share/vm/ci/ciMethod.cpp#l108 > > >> >> Cheers, >> David >> ----- >> >> >>> Thumbs up! >>> >>> Dan >>> >>> >>>> https://bugs.openjdk.java.net/browse/JDK-8139247 >>>> >>>> Solaris Studio C++ compiler generates tightly coupled >>>> Monitor::lock/unlock calls for unnamed MutexLocker which breaks >>>> synchronization between ciMethodData::load_extra_data() and >>>> MethodData::bci_to_extra_data(). >>>> >>>> MutexLocker(mdo->extra_data_lock()); >>>> >>>> is compiled into: >>>> >>>> load_extra_data+0x001d: movq %r13,%rdi >>>> load_extra_data+0x0020: call lock [ 0xfffffd7fe6df46c0, .+0x7cc5c0 ] >>>> load_extra_data+0x0025: movq %r13,%rdi >>>> load_extra_data+0x0028: call unlock [ 0xfffffd7fe6df47f0, .+0x7cc6e8 >>>> >>>> But after adding a name, we hit a compiler bug in SS12u4 and >>>> Monitor::unlock call is missed. So, have to add a workaround (same as >>>> in JDK-8146616 [1]). >>>> >>>> Testing: verified machine code for ciMethodData::load_extra_data(). >>>> >>>> Best regards, >>>> Vladimir Ivanov >>>> >>>> [1] https://bugs.openjdk.java.net/browse/JDK-8146616 >>> From vladimir.x.ivanov at oracle.com Sun Mar 6 21:49:49 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Mon, 7 Mar 2016 00:49:49 +0300 Subject: [9] RFR (XS): 8139247: Improper locking of MethodData::_extra_data_lock In-Reply-To: <56DC9B1E.7040803@oracle.com> References: <56D814B3.3000605@oracle.com> <56D86B19.7010206@oracle.com> <56D8B18C.5080104@oracle.com> <56DC2754.7030902@oracle.com> <56DC9B1E.7040803@oracle.com> Message-ID: <56DCA5FD.4050202@oracle.com> >> Updated fix: >> http://cr.openjdk.java.net/~vlivanov/8139247/webrev.01/ >> >> I found that ciSpeculativeTrapData::translate_from may block on >> Compile_lock (in ciMethod ctor [1]), so MDO extra lock has to be >> unlocked first since it has leaf rank. > > That's interesting - it means even if other compilers were not unlocking > the mutex immediately, they were unlocking it prior to this modified > code (else the problem would have been detected earlier). Which all > suggest that as far as locking is concerned the behaviour of this code > is somewhat untested! Yes, it turns out the bug is not specific to Solaris x86. I'm not sure why it fails only there though. > Why was the assertion removed? It's useless. SpeculativeTrapData is just a view over a memory location and the location is the same: SpeculativeTrapData* data_src = new SpeculativeTrapData(dp_src); SpeculativeTrapData* data_src2 = new SpeculativeTrapData(dp_src); > Don't forget to update copyright year. Will do. Thanks! Best regards, Vladimir Ivanov From gromero at linux.vnet.ibm.com Sun Mar 6 22:27:03 2016 From: gromero at linux.vnet.ibm.com (Gustavo Romero) Date: Sun, 6 Mar 2016 19:27:03 -0300 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: References: <56CE0975.8060807@linux.vnet.ibm.com> <56CEB349.1050102@oracle.com> <56CEB73D.8030904@linux.vnet.ibm.com> <56CEB982.5030706@oracle.com> Message-ID: <56DCAEB7.8010003@linux.vnet.ibm.com> Hi Thomas Thanks for offering the hosting. :-) Thomas, could you please host this updated version that incorporates the comments made by you, Martin, and Vladimir (Martin also kindly offered the hosting but probably is yet out of office - but I'm not sure). Webrev updated version: http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev.zip Thanks a lot. Best regards, Gustavo On 25-02-2016 07:57, Thomas St?fe wrote: > Hi Gustavo, > > I can host this for you, if you have no access to cr.openjdk.java.net. Just > send me the patch file. > > About your change: > > src/cpu/ppc/vm/globalDefinitions_ppc.hpp > > small nit: Could be probably be merged with the paragraph above where we do > the same thing for AIX, but I do not have strong emotions. > > > src/cpu/ppc/vm/vm_version_ppc.cpp > > + // Please, refer to commit 4b4fadba057c1af7689fc8fa182b13baL7 > Does this refer to an OpenJDK change? If yes, could you please instead > mention the OpenJDK bug number instead? > > > src/os/linux/vm/os_linux.cpp > > os::Linux::initialize_os_info() > > Please make this code more robust: > - Check the return value of sscanf (must be 3, otherwise your assumption > about the version format was wrong) > - Could this happen: "3.2" ? If yes, could you please handle it too? > - Please handle overflow - if any one of minor/fix is > 256, something > sensible should happen (for major, this probably indicates an error). > Possibly cap out at 256? > > If version cannot be read successfully, the VM should not abort imho but > behave gracefully. Worst that should happen is that RTM gets deactivated. > > > Kind Regards, Thomas > > > On Thu, Feb 25, 2016 at 9:21 AM, David Holmes > wrote: > >> On 25/02/2016 6:11 PM, Gustavo Romero wrote: >> >>> Hi David, >>> >>> OK, I'll fix that. >>> >>> Should I re-send the RFR with the right URL and abandon this one? >>> >> >> I think you can just post the new URL to this one. >> >> In case a contribution is not so small, even so is it fine to include it >>> inline? >>> >> >> Well it's preferable, for larger contributions, to find someone to host >> the webrev for you. >> >> Cheers, >> David >> >> >> Thank you. >>> >>> Regards, >>> Gustavo >>> >>> On 25-02-2016 04:54, David Holmes wrote: >>> >>>> Hi Gustavo, >>>> >>>> Just a point of order. All contributions to the OpenJDK must be made >>>> through OpenJDK infrastructure. So you must either get someone to host your >>>> webrev on cr.openjdk.java.net, or include it inline in >>>> email (attachments tend to get stripped). >>>> >>>> Sorry for the inconvenience. >>>> >>>> David >>>> >>>> On 25/02/2016 5:50 AM, Gustavo Romero wrote: >>>> >>>>> Hi Martin, >>>>> >>>>> Both little and big endian Linux kernel contain the syscall change, so >>>>> I did not include: >>>>> >>>>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>>>> >>>>> in globalDefinitions_ppc.hpp. >>>>> >>>>> Please, could you review the following change? >>>>> >>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>>>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>>>> >>>>> Summary: >>>>> >>>>> * Enable RTM support for Linux on PPC64 (LE and BE). >>>>> * Fix C2 compiler buffer size issue. >>>>> >>>>> Thank you. >>>>> >>>>> Regards, >>>>> Gustavo >>>>> >>>>> >>>> >>> > From varming at gmail.com Mon Mar 7 01:51:21 2016 From: varming at gmail.com (Carsten Varming) Date: Sun, 6 Mar 2016 20:51:21 -0500 Subject: RFR 8150013: ParNew: Prune nmethods scavengable list In-Reply-To: <56D9D98A.8050407@oracle.com> References: <56D8CCBE.4040900@oracle.com> <56D9D98A.8050407@oracle.com> Message-ID: Dear Jon, Thank you for sponsoring. I am not sure about your intended change to the patch. If fix_relocations, then there are two cases where I remove the nmethod from the scavengable list: 1. If the nmethod is not live. 2. If the nmethod is live and it does not have scavengable roots. With your suggested code change I don't think I can cover both cases without code duplication. So I think it is best to leave the logic as is. Regarding you proposed comment about the precision of detect_scavenge_root_oops. // Unless the relocations have been updated (fixed), the // detect_scavenge_root_oops() will not be precise so skip // the check to unlink. Note that not doing the unlinking // is safe but less optimal. I don't know what you mean when you say "detect_scavenge_root_oops() will not be precise". The method fix_relocations() in every closure that might move an object returns true (I carefully checked all collectors except G1 (which does not use the list)), so there should never be a time where an nmethod is left in a state where detect_scavenge_root_oops is wrong. You are right that non-scavengable nmethods on the list is fine, but I disagree about it being less than optimal (see next comment). The reason I chose to not prune nmethods when !fix_relocations is that I don't expect to be able to prune any live nmethods. To prune a live nmethod from the list all oops in the nmethod must be non-scavengable (oops::is_scavengable() must return false). In all collectors today, fix_relocations is true if an object might be moved. Hence the only time the list might contain a non-scavengable nmethod is between line 663 and 668 in my patch and between an oop moved by a full collection and the prune method called at the end of said collection. As every live nmethod on the list is expected to be scavengable (with the exceptions already listed) pruning the list when objects have not moved seems like a waste. What about dead nmethods? I don't think pruning dead nmethods really makes a difference, but I would be happy to change the code to prune them regardless of the value of fix_relocations. I added the following comment // The scavengable nmethod list must contain all methods with scavengable // oops. It is safe to include more nmethod on the list, but we do not // expect any live non-scavengable nmethods on the list. I hope that covers your intention. I updated the webrev at http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ with the comment. Carsten On Fri, Mar 4, 2016 at 1:52 PM, Jon Masamitsu wrote: > Carsten, > > There will be a couple of days delay in pushing this > change. The runtime repository is closed at the > moment but hopefully will be open again in a day > or two. > > Jon > > > On 03/04/2016 10:23 AM, Carsten Varming wrote: > > Dear Christian, > > Thank you for your review. > > Carsten > > On Fri, Mar 4, 2016 at 12:50 PM, Christian Thalinger < > christian.thalinger at oracle.com> wrote: > >> Jon asked me to have a quick look over the code cache changes. Looks >> good to me. >> >> > On Mar 3, 2016, at 1:46 PM, Jon Masamitsu < >> jon.masamitsu at oracle.com> wrote: >> > >> > Carsten, >> > >> > Changes look good. >> > >> > A couple of suggestions. >> > >> > >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/src/share/vm/code/codeCache.cpp.frames.html >> > >> > 661 if (is_live) { >> > 662 // Perform cur->oops_do(f), maybe just once per nmethod. >> > 663 f->do_code_blob(cur); >> > 664 } >> > 665 nmethod* const next = cur->scavenge_root_link(); >> > 666 if (fix_relocations) { >> > 667 if (!is_live || !cur->detect_scavenge_root_oops()) { >> > 668 unlink_scavenge_root_nmethod(cur, prev); >> > 669 } else { >> > 670 prev = cur; >> > 671 } >> > 672 } >> > 673 cur = next; >> > >> > Although this does not change the actions, I find this easier to >> > read. You and Tony (and whoever else wants to) can vote >> > on it. >> > >> > if (is_live) { ... } else { >> > if (fix_relocations) { if (cur->detect_scavenge_root_oops()) { prev = >> cur; } else { unlink_scavenge_root_nmethod(cur, prev);} } cur = >> cur->scavenge_root_link(); } >> > >> > Also I'd suggest a comment before the if-test >> > if you find it correct. >> > >> > // Unless the relocations have been updated (fixed), the // >> detect_scavenge_root_oops() will not be precise so skip // the check to >> unlink. Note that not doing the unlinking // is safe but less optimal. if >> (fix_relocations) { >> > >> > The comment in the header file for fix_relocations helped >> > but a comment here might be helpful. >> > >> > I'll sponsor. >> > >> > Jon >> > >> > On 2/28/2016 6:16 PM, Carsten Varming wrote: >> >> Dear Hotspot developers, >> >> >> >> Any chance of a review of this patch? The patch cut between 7ms and >> 10ms of every ParNew with one application at Twitter and I expect a 1-2ms >> improvement for most applications. >> >> >> >> I touch the code cache and GenCollectedHeap, so I assume I need >> reviews from both gc and compiler reviewers. Thank you Tony Printezis for >> the review (posted on the hotspot-gc-dev list). >> >> >> >> I also need a sponsor. >> >> >> >> Carsten >> >> >> >> On Fri, Feb 19, 2016 at 10:52 AM, Carsten Varming > > wrote: >> >> >> >> Dear Hotspot developers, >> >> >> >> I would like to contribute a patch for JDK-8150013 >> >> . The current >> >> webrev can be found here: >> >> >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ >> >> < >> http://cr.openjdk.java.net/%7Ecvarming/scavenge_nmethods_auto_prune/2/>. >> >> >> >> Suggestions for improvements are very welcome. >> >> >> >> Carsten >> >> >> >> >> > >> >> > > From yasuenag at gmail.com Mon Mar 7 03:38:30 2016 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Mon, 7 Mar 2016 12:38:30 +0900 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. Message-ID: <56DCF7B6.7000404@gmail.com> Hi all, When I build fastdebug JDK (--enable-debug) with --with-native-debug-symbols=internal, build process generated *.debuginfo for libjsig and libjvm. I think that build process should regard --with-native-debug-symbols. I've uploaded webrev. Could you review it? http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ I cannot access JPRT. So I need a sponsor. Thanks, Yasumasa From david.holmes at oracle.com Mon Mar 7 07:57:33 2016 From: david.holmes at oracle.com (David Holmes) Date: Mon, 7 Mar 2016 17:57:33 +1000 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. In-Reply-To: <56DCF7B6.7000404@gmail.com> References: <56DCF7B6.7000404@gmail.com> Message-ID: <56DD346D.5010200@oracle.com> Hi Yasumasa, On 7/03/2016 1:38 PM, Yasumasa Suenaga wrote: > Hi all, > > When I build fastdebug JDK (--enable-debug) with --with-native-debug-symbols=internal, > build process generated *.debuginfo for libjsig and libjvm. > I think that build process should regard --with-native-debug-symbols. As I wrote in the bug report we are getting very close to the switch over to the new hotspot build and I'm assuming/hoping this is already addressed there. We are avoiding non-urgent changes to the hotspot build in the meantime to ease the change over. Thanks, David > I've uploaded webrev. Could you review it? > http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ > > I cannot access JPRT. So I need a sponsor. > > > Thanks, > > Yasumasa > From yasuenag at gmail.com Mon Mar 7 09:34:44 2016 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Mon, 7 Mar 2016 18:34:44 +0900 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. In-Reply-To: <56DD346D.5010200@oracle.com> References: <56DCF7B6.7000404@gmail.com> <56DD346D.5010200@oracle.com> Message-ID: Hi David, Does "new hotspot build" mean JEP 284? If it so and this issue does not occur on JEP 284, I will close this issue. Thanks, Yasumasa 2016/03/07 16:57 "David Holmes" : > Hi Yasumasa, > > On 7/03/2016 1:38 PM, Yasumasa Suenaga wrote: > > Hi all, > > > > When I build fastdebug JDK (--enable-debug) with > --with-native-debug-symbols=internal, > > build process generated *.debuginfo for libjsig and libjvm. > > I think that build process should regard --with-native-debug-symbols. > > As I wrote in the bug report we are getting very close to the switch > over to the new hotspot build and I'm assuming/hoping this is already > addressed there. We are avoiding non-urgent changes to the hotspot build > in the meantime to ease the change over. > > Thanks, > David > > > I've uploaded webrev. Could you review it? > > http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ > > > > I cannot access JPRT. So I need a sponsor. > > > > > > Thanks, > > > > Yasumasa > > > From erik.joelsson at oracle.com Mon Mar 7 09:54:33 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Mon, 7 Mar 2016 10:54:33 +0100 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. In-Reply-To: References: <56DCF7B6.7000404@gmail.com> <56DD346D.5010200@oracle.com> Message-ID: <56DD4FD9.1090600@oracle.com> Hello Yasumasa, Yes, it is indeed JEP 284 and I have verified that the new build there works as expected with the "internal" setting. If you like, you can take it for a spin yourself by cloning http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty good shape right now on Linux. /Erik On 2016-03-07 10:34, Yasumasa Suenaga wrote: > Hi David, > > Does "new hotspot build" mean JEP 284? > If it so and this issue does not occur on JEP 284, I will close this issue. > > Thanks, > > Yasumasa > 2016/03/07 16:57 "David Holmes" : > >> Hi Yasumasa, >> >> On 7/03/2016 1:38 PM, Yasumasa Suenaga wrote: >>> Hi all, >>> >>> When I build fastdebug JDK (--enable-debug) with >> --with-native-debug-symbols=internal, >>> build process generated *.debuginfo for libjsig and libjvm. >>> I think that build process should regard --with-native-debug-symbols. >> As I wrote in the bug report we are getting very close to the switch >> over to the new hotspot build and I'm assuming/hoping this is already >> addressed there. We are avoiding non-urgent changes to the hotspot build >> in the meantime to ease the change over. >> >> Thanks, >> David >> >>> I've uploaded webrev. Could you review it? >>> http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ >>> >>> I cannot access JPRT. So I need a sponsor. >>> >>> >>> Thanks, >>> >>> Yasumasa >>> From martin.doerr at sap.com Mon Mar 7 10:29:13 2016 From: martin.doerr at sap.com (Doerr, Martin) Date: Mon, 7 Mar 2016 10:29:13 +0000 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: <56CFB72C.7030401@oracle.com> References: <56CE0975.8060807@linux.vnet.ibm.com> <56CE42AE.7080605@oracle.com> <10c9a1cb6d9b40618a094283ac838038@DEWDFE13DE14.global.corp.sap> <56CFB72C.7030401@oracle.com> Message-ID: Hi Vladimir, thank you very much for the detailed analysis. I hope an #ifdef PPC64 is ok in the shared code? I had written something to Gustavo about the performance problem we have with RTM in SPEC jbb2005: > The following issue is important for performance work: > RTM does not work with BiasedLocking. The latter gets switched off if RTM is activated which has a large performance impact (especially in jbb2005). > I would disable it for a reference measurement: > -XX:-UseBiasedLocking > > Unfortunately, RTM was slower than BiasedLocking but faster than the reference (without both) which tells me that there's room for improvement. > There are basically 3 classes of locks: > 1. no contention > 2. contention on lock, low contention on data > 3. high contention on data > > I believe the optimal treatment for the cases would be: > 1. Biased Locking > 2. Transactional Memory > 3. classical locking with lock inflating > > I think it would be good if the JVM could optimize for all these cases in the future. But that would add additional complexity and code size. Do you think this is something which should be improved in the future? We could try e.g. the following approach - try biased - deoptimize if it doesn't work well, try transactional - deoptimize if it doesn't work well, use classical locking (with inflating) Best regards, Martin -----Original Message----- From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] Sent: Freitag, 26. Februar 2016 03:24 To: Doerr, Martin ; Gustavo Romero ; hotspot-dev at openjdk.java.net Cc: brenohl at br.ibm.com Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux The problem with increasing ScratchBufferBlob size is that with Tiered compilation we scale number of compiler threads based on cpu count and increase space in CodeCache accordingly: code_buffers_size += c2_count * C2Compiler::initial_code_buffer_size(); I did experiment on Intel setting ON all RTM flags which can increase size of lock code: $ java -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+UseRTMLocking -XX:+UseRTMDeopt -XX:+UseRTMForStackLocks -XX:+PrintPreciseRTMLockingStatistics -XX:+PrintFlagsFinal -version |grep RTM Java HotSpot(TM) 64-Bit Server VM warning: UseRTMLocking is only available as experimental option on this platform. bool PrintPreciseRTMLockingStatistics := true {C2 diagnostic} intx RTMAbortRatio = 50 {ARCH experimental} intx RTMAbortThreshold = 1000 {ARCH experimental} intx RTMLockingCalculationDelay = 0 {ARCH experimental} intx RTMLockingThreshold = 10000 {ARCH experimental} uintx RTMRetryCount = 5 {ARCH product} intx RTMSpinLoopCount = 100 {ARCH experimental} intx RTMTotalCountIncrRate = 64 {ARCH experimental} bool UseRTMDeopt := true {ARCH product} bool UseRTMForStackLocks := true {ARCH experimental} bool UseRTMLocking := true {ARCH product} bool UseRTMXendForLockBusy = true {ARCH experimental} I added next lines to the end of Compile::scratch_emit_size() method: if (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_FastLock) { tty->print_cr("======== FastLock size: %d ==========", buf.total_content_size()); } if (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_FastUnlock) { tty->print_cr("======== FastUnlock size: %d ==========", buf.total_content_size()); } and got: ======== FastLock size: 657 ========== ======== FastUnlock size: 175 ========== Thanks, Vladimir On 2/25/16 3:43 AM, Doerr, Martin wrote: > Hi Vladimir, > > thanks for taking a look. > > About version values: > We are using a similar scheme for version checks on AIX where we know that the version values are less than 256. > It makes comparisons much more convenient. > But I agree that we should double-check if it is guaranteed for linux as well (and possibly add an assertion). > > About scratch buffer size: > We only noticed that the scratch buffer was too small when we enable all RTM features: > -XX:+UnlockExperimentalVMOptions -XX:+UseRTMLocking -XX:+UseRTMForStackLocks -XX:+UseRTMDeopt > We have only tried on PPC64, but I wonder if the current size is sufficient for x86. I currently don't have access to a Skylake machine. > > I think adding 1024 bytes to the scratch buffer doesn't hurt. > (It may also lead to larger CodeBuffers in output.cpp but I don't think this is problematic as long as the real content gets copied to nmethods.) > Would you agree? > > Best regards, > Martin > > -----Original Message----- > From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] > Sent: Donnerstag, 25. Februar 2016 00:54 > To: Gustavo Romero ; Doerr, Martin ; hotspot-dev at openjdk.java.net > Cc: brenohl at br.ibm.com > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > My concern (but I am not export) is Linux version encoding. Is it true > that each value in x.y.z is less then 256? Why not keep them as separate > int values? > I also thought we have OS versions in make files but we check only gcc > version there. > > Do you have problem with ScratchBufferBlob only on PPC or on some other > platforms too? May be we should make MAX_inst_size as platform specific > value. > > Thanks, > Vladimir > > On 2/24/16 11:50 AM, Gustavo Romero wrote: >> Hi Martin, >> >> Both little and big endian Linux kernel contain the syscall change, so >> I did not include: >> >> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >> >> in globalDefinitions_ppc.hpp. >> >> Please, could you review the following change? >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >> >> Summary: >> >> * Enable RTM support for Linux on PPC64 (LE and BE). >> * Fix C2 compiler buffer size issue. >> >> Thank you. >> >> Regards, >> Gustavo >> From yasuenag at gmail.com Mon Mar 7 14:29:12 2016 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Mon, 7 Mar 2016 23:29:12 +0900 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. In-Reply-To: <56DD4FD9.1090600@oracle.com> References: <56DCF7B6.7000404@gmail.com> <56DD346D.5010200@oracle.com> <56DD4FD9.1090600@oracle.com> Message-ID: <56DD9038.6050106@gmail.com> Hi Erik, > If you like, you can take it for a spin yourself by cloning http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty good shape right now on Linux. Thanks! It looks good to me. BTW, Does build-infra use hotspot/make/linux/makefiles/vm.make ? vm.make have a bug in this issue yet. However, build-infra seems to use make/common/NativeCompilation.gmk . If so, I will close this issue. (Will hotspot/make remove at JDK-8150601 ? ) Thanks, Yasumasa On 2016/03/07 18:54, Erik Joelsson wrote: > Hello Yasumasa, > > Yes, it is indeed JEP 284 and I have verified that the new build there works as expected with the "internal" setting. > > If you like, you can take it for a spin yourself by cloning http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty good shape right now on Linux. > > /Erik > > On 2016-03-07 10:34, Yasumasa Suenaga wrote: >> Hi David, >> >> Does "new hotspot build" mean JEP 284? >> If it so and this issue does not occur on JEP 284, I will close this issue. >> >> Thanks, >> >> Yasumasa >> 2016/03/07 16:57 "David Holmes" : >> >>> Hi Yasumasa, >>> >>> On 7/03/2016 1:38 PM, Yasumasa Suenaga wrote: >>>> Hi all, >>>> >>>> When I build fastdebug JDK (--enable-debug) with >>> --with-native-debug-symbols=internal, >>>> build process generated *.debuginfo for libjsig and libjvm. >>>> I think that build process should regard --with-native-debug-symbols. >>> As I wrote in the bug report we are getting very close to the switch >>> over to the new hotspot build and I'm assuming/hoping this is already >>> addressed there. We are avoiding non-urgent changes to the hotspot build >>> in the meantime to ease the change over. >>> >>> Thanks, >>> David >>> >>>> I've uploaded webrev. Could you review it? >>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ >>>> >>>> I cannot access JPRT. So I need a sponsor. >>>> >>>> >>>> Thanks, >>>> >>>> Yasumasa >>>> > From erik.joelsson at oracle.com Mon Mar 7 14:36:48 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Mon, 7 Mar 2016 15:36:48 +0100 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. In-Reply-To: <56DD9038.6050106@gmail.com> References: <56DCF7B6.7000404@gmail.com> <56DD346D.5010200@oracle.com> <56DD4FD9.1090600@oracle.com> <56DD9038.6050106@gmail.com> Message-ID: <56DD9200.7080008@oracle.com> Hello Yasumasa, In build-infra, we still have the old Hotspot build present for reference in hotspot/make. The new build currently resides in hotspot/makefiles. Basically no files in hotspot/make are used by the new build. After we switch in JDK 9, we will have both build systems available for a short while (1-2 weeks if we don't see any major trouble) before we remove the old and move the new build into hotspot/make. To be clear, we do not use vm.make. /Erik On 2016-03-07 15:29, Yasumasa Suenaga wrote: > Hi Erik, > >> If you like, you can take it for a spin yourself by cloning >> http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty >> good shape right now on Linux. > > Thanks! It looks good to me. > > BTW, Does build-infra use hotspot/make/linux/makefiles/vm.make ? > vm.make have a bug in this issue yet. > However, build-infra seems to use make/common/NativeCompilation.gmk . > If so, I will close this issue. > (Will hotspot/make remove at JDK-8150601 ? ) > > > Thanks, > > Yasumasa > > > On 2016/03/07 18:54, Erik Joelsson wrote: >> Hello Yasumasa, >> >> Yes, it is indeed JEP 284 and I have verified that the new build >> there works as expected with the "internal" setting. >> >> If you like, you can take it for a spin yourself by cloning >> http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty >> good shape right now on Linux. >> >> /Erik >> >> On 2016-03-07 10:34, Yasumasa Suenaga wrote: >>> Hi David, >>> >>> Does "new hotspot build" mean JEP 284? >>> If it so and this issue does not occur on JEP 284, I will close this >>> issue. >>> >>> Thanks, >>> >>> Yasumasa >>> 2016/03/07 16:57 "David Holmes" : >>> >>>> Hi Yasumasa, >>>> >>>> On 7/03/2016 1:38 PM, Yasumasa Suenaga wrote: >>>>> Hi all, >>>>> >>>>> When I build fastdebug JDK (--enable-debug) with >>>> --with-native-debug-symbols=internal, >>>>> build process generated *.debuginfo for libjsig and libjvm. >>>>> I think that build process should regard --with-native-debug-symbols. >>>> As I wrote in the bug report we are getting very close to the switch >>>> over to the new hotspot build and I'm assuming/hoping this is already >>>> addressed there. We are avoiding non-urgent changes to the hotspot >>>> build >>>> in the meantime to ease the change over. >>>> >>>> Thanks, >>>> David >>>> >>>>> I've uploaded webrev. Could you review it? >>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ >>>>> >>>>> I cannot access JPRT. So I need a sponsor. >>>>> >>>>> >>>>> Thanks, >>>>> >>>>> Yasumasa >>>>> >> From yasuenag at gmail.com Mon Mar 7 14:49:59 2016 From: yasuenag at gmail.com (Yasumasa Suenaga) Date: Mon, 7 Mar 2016 23:49:59 +0900 Subject: RFR: 8151351: HotSpot build process should regard --with-native-debug-symbols. In-Reply-To: <56DD9200.7080008@oracle.com> References: <56DCF7B6.7000404@gmail.com> <56DD346D.5010200@oracle.com> <56DD4FD9.1090600@oracle.com> <56DD9038.6050106@gmail.com> <56DD9200.7080008@oracle.com> Message-ID: <56DD9517.6050206@gmail.com> Thanks Erik, I understood. I closed this issue with Won't Fix. Yasumasa On 2016/03/07 23:36, Erik Joelsson wrote: > Hello Yasumasa, > > In build-infra, we still have the old Hotspot build present for reference in hotspot/make. The new build currently resides in hotspot/makefiles. Basically no files in hotspot/make are used by the new build. After we switch in JDK 9, we will have both build systems available for a short while (1-2 weeks if we don't see any major trouble) before we remove the old and move the new build into hotspot/make. > > To be clear, we do not use vm.make. > > /Erik > > On 2016-03-07 15:29, Yasumasa Suenaga wrote: >> Hi Erik, >> >>> If you like, you can take it for a spin yourself by cloning http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty good shape right now on Linux. >> >> Thanks! It looks good to me. >> >> BTW, Does build-infra use hotspot/make/linux/makefiles/vm.make ? >> vm.make have a bug in this issue yet. >> However, build-infra seems to use make/common/NativeCompilation.gmk . >> If so, I will close this issue. >> (Will hotspot/make remove at JDK-8150601 ? ) >> >> >> Thanks, >> >> Yasumasa >> >> >> On 2016/03/07 18:54, Erik Joelsson wrote: >>> Hello Yasumasa, >>> >>> Yes, it is indeed JEP 284 and I have verified that the new build there works as expected with the "internal" setting. >>> >>> If you like, you can take it for a spin yourself by cloning http://hg.openjdk.java.net/build-infra/jdk9. It should be in a pretty good shape right now on Linux. >>> >>> /Erik >>> >>> On 2016-03-07 10:34, Yasumasa Suenaga wrote: >>>> Hi David, >>>> >>>> Does "new hotspot build" mean JEP 284? >>>> If it so and this issue does not occur on JEP 284, I will close this issue. >>>> >>>> Thanks, >>>> >>>> Yasumasa >>>> 2016/03/07 16:57 "David Holmes" : >>>> >>>>> Hi Yasumasa, >>>>> >>>>> On 7/03/2016 1:38 PM, Yasumasa Suenaga wrote: >>>>>> Hi all, >>>>>> >>>>>> When I build fastdebug JDK (--enable-debug) with >>>>> --with-native-debug-symbols=internal, >>>>>> build process generated *.debuginfo for libjsig and libjvm. >>>>>> I think that build process should regard --with-native-debug-symbols. >>>>> As I wrote in the bug report we are getting very close to the switch >>>>> over to the new hotspot build and I'm assuming/hoping this is already >>>>> addressed there. We are avoiding non-urgent changes to the hotspot build >>>>> in the meantime to ease the change over. >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>>> I've uploaded webrev. Could you review it? >>>>>> http://cr.openjdk.java.net/~ysuenaga/JDK-8151351/webrev.00/ >>>>>> >>>>>> I cannot access JPRT. So I need a sponsor. >>>>>> >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Yasumasa >>>>>> >>> > From gromero at linux.vnet.ibm.com Mon Mar 7 15:27:11 2016 From: gromero at linux.vnet.ibm.com (Gustavo Romero) Date: Mon, 7 Mar 2016 12:27:11 -0300 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: References: <56CE0975.8060807@linux.vnet.ibm.com> <56CEB349.1050102@oracle.com> <56CEB73D.8030904@linux.vnet.ibm.com> <56CEB982.5030706@oracle.com> <56DCAEB7.8010003@linux.vnet.ibm.com> Message-ID: <56DD9DCF.8090703@linux.vnet.ibm.com> Hi Martin Sure, AIX is now included as well. Could you please host and review this updated version? Webrev: http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev_v3.zip src/cpu/ppc/vm/globalDefinitions_ppc.hpp: I merged the defines as Thomas suggested. src/cpu/ppc/vm/vm_version_ppc.cpp: Thomas, sorry for the cryptic comment about the kernel change. It refers to Linux kernel source tree and not to OpenJDK. I've improved the comment to reflect it. Regarding MAX_inst_size: I assumed that the ScratchBufferBlob issue is present only on PPC64 and, as Vladmir and Martin suggested, I made MAX_inst_size a platform specific value (changed only for PPC64 - AIX and Linux). Vladimir, thanks for doing additional analysis on x64 architecture. Regarding Linux version encoding: Keeping the values x.y.z together the same form it was done on AIX is more convenient, as Martin said, and besides that it's the way Linux kernel itself handles the Linux kernel versions. Hence it defines macro KERNEL_VERSION used whenever kernel version check/comparison is necessary and it does exactly what we are doing for AIX and Linux on PPC64: #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) So I think it's not a problem to assume true that each value in x.y.z is always less then 256 and also never something like 3.2 (x.y). To the best of my knowledge there is no rigid standard for that but by looking at mainline kernel versions we can trust this format too. However, as any distro can change it at will (although very unlikely), making it more robust in the sense Thomas and Martin commented is a good idea. I did it and checked if the kernel version format is what we expect (x.y.z format) and for x, y, and z less then 256. Thomas, in case of a version is unknown I decided for bailing out instead of just letting the VM continue with RTM disabled since it's the behavior, for instance, when the CPU doesn't support Transactional Memory and other similar conditions in the code around. But as method os_version_is_known() exists (instead of assert()'s in os_linux.cpp), it's possible to change this behavior easily in vm_version_ppc.cpp. Regarding Hotspot jtreg tests: No regression was observed. More 16 tests are passing now on Linux (PP64 LE): Passed: compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Passed: compiler/rtm/locking/TestRTMAbortRatio.java Passed: compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java Passed: compiler/rtm/locking/TestRTMTotalCountIncrRate.java Passed: compiler/rtm/locking/TestUseRTMDeopt.java Passed: compiler/rtm/locking/TestUseRTMForInflatedLocks.java Passed: compiler/rtm/locking/TestUseRTMForStackLocks.java Passed: compiler/rtm/method_options/TestNoRTMLockElidingOption.java Passed: compiler/rtm/method_options/TestUseRTMLockElidingOption.java Passed: gc/ergonomics/TestDynamicNumberOfGCThreads.java Kind regards, Gustavo On 07-03-2016 07:17, Doerr, Martin wrote: > Hi Gustavo, > > I?m back from vacation and I can host the webrev. Thanks for doing this change. It?s quite some work to get it into openjdk. > > May I ask you to increase the scratch buffer size for AIX as well (e.g. make it only dependent on PPC64, not on the OS in compile.hpp)? > We have the same problem there and we should try to make only one shared code change. We will have to ask someone from Oracle to push it (e.g. Vladimir Kozlov). > > Best regards, > Martin > > From: Thomas St?fe [mailto:thomas.stuefe at gmail.com] > Sent: Montag, 7. M?rz 2016 07:48 > To: Doerr, Martin > Subject: Fwd: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > > Hi Martin, kannst Du ?bernehmen? Bin erst morgen wieder da. > > Gru? Thomas > ---------- Forwarded message ---------- > From: "Gustavo Romero" > > Date: Mar 6, 2016 23:27 > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > To: "Thomas St?fe" > > Cc: "Doerr, Martin" >, "hotspot-dev at openjdk.java.net" >, > > > Hi Thomas > > Thanks for offering the hosting. :-) > > Thomas, could you please host this updated version that incorporates the > comments made by you, Martin, and Vladimir (Martin also kindly offered > the hosting but probably is yet out of office - but I'm not sure). > > Webrev updated version: > http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev.zip > > Thanks a lot. > > Best regards, > Gustavo > > On 25-02-2016 07:57, Thomas St?fe wrote: >> Hi Gustavo, >> >> I can host this for you, if you have no access to cr.openjdk.java.net. Just >> send me the patch file. >> >> About your change: >> >> src/cpu/ppc/vm/globalDefinitions_ppc.hpp >> >> small nit: Could be probably be merged with the paragraph above where we do >> the same thing for AIX, but I do not have strong emotions. >> >> >> src/cpu/ppc/vm/vm_version_ppc.cpp >> >> + // Please, refer to commit 4b4fadba057c1af7689fc8fa182b13baL7 >> Does this refer to an OpenJDK change? If yes, could you please instead >> mention the OpenJDK bug number instead? >> >> >> src/os/linux/vm/os_linux.cpp >> >> os::Linux::initialize_os_info() >> >> Please make this code more robust: >> - Check the return value of sscanf (must be 3, otherwise your assumption >> about the version format was wrong) >> - Could this happen: "3.2" ? If yes, could you please handle it too? >> - Please handle overflow - if any one of minor/fix is > 256, something >> sensible should happen (for major, this probably indicates an error). >> Possibly cap out at 256? >> >> If version cannot be read successfully, the VM should not abort imho but >> behave gracefully. Worst that should happen is that RTM gets deactivated. >> >> >> Kind Regards, Thomas >> >> >> On Thu, Feb 25, 2016 at 9:21 AM, David Holmes > >> wrote: >> >>> On 25/02/2016 6:11 PM, Gustavo Romero wrote: >>> >>>> Hi David, >>>> >>>> OK, I'll fix that. >>>> >>>> Should I re-send the RFR with the right URL and abandon this one? >>>> >>> >>> I think you can just post the new URL to this one. >>> >>> In case a contribution is not so small, even so is it fine to include it >>>> inline? >>>> >>> >>> Well it's preferable, for larger contributions, to find someone to host >>> the webrev for you. >>> >>> Cheers, >>> David >>> >>> >>> Thank you. >>>> >>>> Regards, >>>> Gustavo >>>> >>>> On 25-02-2016 04:54, David Holmes wrote: >>>> >>>>> Hi Gustavo, >>>>> >>>>> Just a point of order. All contributions to the OpenJDK must be made >>>>> through OpenJDK infrastructure. So you must either get someone to host your >>>>> webrev on cr.openjdk.java.net, or include it inline in >>>>> email (attachments tend to get stripped). >>>>> >>>>> Sorry for the inconvenience. >>>>> >>>>> David >>>>> >>>>> On 25/02/2016 5:50 AM, Gustavo Romero wrote: >>>>> >>>>>> Hi Martin, >>>>>> >>>>>> Both little and big endian Linux kernel contain the syscall change, so >>>>>> I did not include: >>>>>> >>>>>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>>>>> >>>>>> in globalDefinitions_ppc.hpp. >>>>>> >>>>>> Please, could you review the following change? >>>>>> >>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>>>>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>>>>> >>>>>> Summary: >>>>>> >>>>>> * Enable RTM support for Linux on PPC64 (LE and BE). >>>>>> * Fix C2 compiler buffer size issue. >>>>>> >>>>>> Thank you. >>>>>> >>>>>> Regards, >>>>>> Gustavo >>>>>> >>>>>> >>>>> >>>> >> From martin.doerr at sap.com Mon Mar 7 16:00:33 2016 From: martin.doerr at sap.com (Doerr, Martin) Date: Mon, 7 Mar 2016 16:00:33 +0000 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: <56DD9DCF.8090703@linux.vnet.ibm.com> References: <56CE0975.8060807@linux.vnet.ibm.com> <56CEB349.1050102@oracle.com> <56CEB73D.8030904@linux.vnet.ibm.com> <56CEB982.5030706@oracle.com> <56DCAEB7.8010003@linux.vnet.ibm.com> <56DD9DCF.8090703@linux.vnet.ibm.com> Message-ID: <4866933cb0424052a3eec45b38a6ee45@DEWDFE13DE14.global.corp.sap> Hi, looks good. Thanks for making the requested changes. The change modifies os_linux and shared C2 code. Can somebody from Oracle review and sponsor, please? The webrev is here: http://cr.openjdk.java.net/~mdoerr/8150353_RTM_linux_ppc64/webrev.00/ It was tested in jdk9/dev/hotspot, but it applies to jdk9/hs-comp/hotspot as well. Best regards, Martin -----Original Message----- From: Gustavo Romero [mailto:gromero at linux.vnet.ibm.com] Sent: Montag, 7. M?rz 2016 16:27 To: Doerr, Martin ; Vladimir Kozlov ; Thomas St?fe Cc: hotspot-dev at openjdk.java.net; Breno Leitao Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux Hi Martin Sure, AIX is now included as well. Could you please host and review this updated version? Webrev: http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev_v3.zip src/cpu/ppc/vm/globalDefinitions_ppc.hpp: I merged the defines as Thomas suggested. src/cpu/ppc/vm/vm_version_ppc.cpp: Thomas, sorry for the cryptic comment about the kernel change. It refers to Linux kernel source tree and not to OpenJDK. I've improved the comment to reflect it. Regarding MAX_inst_size: I assumed that the ScratchBufferBlob issue is present only on PPC64 and, as Vladmir and Martin suggested, I made MAX_inst_size a platform specific value (changed only for PPC64 - AIX and Linux). Vladimir, thanks for doing additional analysis on x64 architecture. Regarding Linux version encoding: Keeping the values x.y.z together the same form it was done on AIX is more convenient, as Martin said, and besides that it's the way Linux kernel itself handles the Linux kernel versions. Hence it defines macro KERNEL_VERSION used whenever kernel version check/comparison is necessary and it does exactly what we are doing for AIX and Linux on PPC64: #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) So I think it's not a problem to assume true that each value in x.y.z is always less then 256 and also never something like 3.2 (x.y). To the best of my knowledge there is no rigid standard for that but by looking at mainline kernel versions we can trust this format too. However, as any distro can change it at will (although very unlikely), making it more robust in the sense Thomas and Martin commented is a good idea. I did it and checked if the kernel version format is what we expect (x.y.z format) and for x, y, and z less then 256. Thomas, in case of a version is unknown I decided for bailing out instead of just letting the VM continue with RTM disabled since it's the behavior, for instance, when the CPU doesn't support Transactional Memory and other similar conditions in the code around. But as method os_version_is_known() exists (instead of assert()'s in os_linux.cpp), it's possible to change this behavior easily in vm_version_ppc.cpp. Regarding Hotspot jtreg tests: No regression was observed. More 16 tests are passing now on Linux (PP64 LE): Passed: compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Passed: compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Passed: compiler/rtm/locking/TestRTMAbortRatio.java Passed: compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java Passed: compiler/rtm/locking/TestRTMTotalCountIncrRate.java Passed: compiler/rtm/locking/TestUseRTMDeopt.java Passed: compiler/rtm/locking/TestUseRTMForInflatedLocks.java Passed: compiler/rtm/locking/TestUseRTMForStackLocks.java Passed: compiler/rtm/method_options/TestNoRTMLockElidingOption.java Passed: compiler/rtm/method_options/TestUseRTMLockElidingOption.java Passed: gc/ergonomics/TestDynamicNumberOfGCThreads.java Kind regards, Gustavo On 07-03-2016 07:17, Doerr, Martin wrote: > Hi Gustavo, > > I?m back from vacation and I can host the webrev. Thanks for doing this change. It?s quite some work to get it into openjdk. > > May I ask you to increase the scratch buffer size for AIX as well (e.g. make it only dependent on PPC64, not on the OS in compile.hpp)? > We have the same problem there and we should try to make only one shared code change. We will have to ask someone from Oracle to push it (e.g. Vladimir Kozlov). > > Best regards, > Martin > > From: Thomas St?fe [mailto:thomas.stuefe at gmail.com] > Sent: Montag, 7. M?rz 2016 07:48 > To: Doerr, Martin > Subject: Fwd: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > > Hi Martin, kannst Du ?bernehmen? Bin erst morgen wieder da. > > Gru? Thomas > ---------- Forwarded message ---------- > From: "Gustavo Romero" > > Date: Mar 6, 2016 23:27 > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > To: "Thomas St?fe" > > Cc: "Doerr, Martin" >, "hotspot-dev at openjdk.java.net" >, > > > Hi Thomas > > Thanks for offering the hosting. :-) > > Thomas, could you please host this updated version that incorporates the > comments made by you, Martin, and Vladimir (Martin also kindly offered > the hosting but probably is yet out of office - but I'm not sure). > > Webrev updated version: > http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev.zip > > Thanks a lot. > > Best regards, > Gustavo > > On 25-02-2016 07:57, Thomas St?fe wrote: >> Hi Gustavo, >> >> I can host this for you, if you have no access to cr.openjdk.java.net. Just >> send me the patch file. >> >> About your change: >> >> src/cpu/ppc/vm/globalDefinitions_ppc.hpp >> >> small nit: Could be probably be merged with the paragraph above where we do >> the same thing for AIX, but I do not have strong emotions. >> >> >> src/cpu/ppc/vm/vm_version_ppc.cpp >> >> + // Please, refer to commit 4b4fadba057c1af7689fc8fa182b13baL7 >> Does this refer to an OpenJDK change? If yes, could you please instead >> mention the OpenJDK bug number instead? >> >> >> src/os/linux/vm/os_linux.cpp >> >> os::Linux::initialize_os_info() >> >> Please make this code more robust: >> - Check the return value of sscanf (must be 3, otherwise your assumption >> about the version format was wrong) >> - Could this happen: "3.2" ? If yes, could you please handle it too? >> - Please handle overflow - if any one of minor/fix is > 256, something >> sensible should happen (for major, this probably indicates an error). >> Possibly cap out at 256? >> >> If version cannot be read successfully, the VM should not abort imho but >> behave gracefully. Worst that should happen is that RTM gets deactivated. >> >> >> Kind Regards, Thomas >> >> >> On Thu, Feb 25, 2016 at 9:21 AM, David Holmes > >> wrote: >> >>> On 25/02/2016 6:11 PM, Gustavo Romero wrote: >>> >>>> Hi David, >>>> >>>> OK, I'll fix that. >>>> >>>> Should I re-send the RFR with the right URL and abandon this one? >>>> >>> >>> I think you can just post the new URL to this one. >>> >>> In case a contribution is not so small, even so is it fine to include it >>>> inline? >>>> >>> >>> Well it's preferable, for larger contributions, to find someone to host >>> the webrev for you. >>> >>> Cheers, >>> David >>> >>> >>> Thank you. >>>> >>>> Regards, >>>> Gustavo >>>> >>>> On 25-02-2016 04:54, David Holmes wrote: >>>> >>>>> Hi Gustavo, >>>>> >>>>> Just a point of order. All contributions to the OpenJDK must be made >>>>> through OpenJDK infrastructure. So you must either get someone to host your >>>>> webrev on cr.openjdk.java.net, or include it inline in >>>>> email (attachments tend to get stripped). >>>>> >>>>> Sorry for the inconvenience. >>>>> >>>>> David >>>>> >>>>> On 25/02/2016 5:50 AM, Gustavo Romero wrote: >>>>> >>>>>> Hi Martin, >>>>>> >>>>>> Both little and big endian Linux kernel contain the syscall change, so >>>>>> I did not include: >>>>>> >>>>>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>>>>> >>>>>> in globalDefinitions_ppc.hpp. >>>>>> >>>>>> Please, could you review the following change? >>>>>> >>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>>>>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>>>>> >>>>>> Summary: >>>>>> >>>>>> * Enable RTM support for Linux on PPC64 (LE and BE). >>>>>> * Fix C2 compiler buffer size issue. >>>>>> >>>>>> Thank you. >>>>>> >>>>>> Regards, >>>>>> Gustavo >>>>>> >>>>>> >>>>> >>>> >> From gromero at linux.vnet.ibm.com Mon Mar 7 16:17:31 2016 From: gromero at linux.vnet.ibm.com (Gustavo Romero) Date: Mon, 7 Mar 2016 13:17:31 -0300 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: <4866933cb0424052a3eec45b38a6ee45@DEWDFE13DE14.global.corp.sap> References: <56CE0975.8060807@linux.vnet.ibm.com> <56CEB349.1050102@oracle.com> <56CEB73D.8030904@linux.vnet.ibm.com> <56CEB982.5030706@oracle.com> <56DCAEB7.8010003@linux.vnet.ibm.com> <56DD9DCF.8090703@linux.vnet.ibm.com> <4866933cb0424052a3eec45b38a6ee45@DEWDFE13DE14.global.corp.sap> Message-ID: <56DDA99B.4010205@linux.vnet.ibm.com> Thank you Martin for all the guidelines, comments and reviews. Best regards, Gustavo On 07-03-2016 13:00, Doerr, Martin wrote: > Hi, > > looks good. Thanks for making the requested changes. > > The change modifies os_linux and shared C2 code. > Can somebody from Oracle review and sponsor, please? > > The webrev is here: > http://cr.openjdk.java.net/~mdoerr/8150353_RTM_linux_ppc64/webrev.00/ > > It was tested in jdk9/dev/hotspot, but it applies to jdk9/hs-comp/hotspot as well. > > Best regards, > Martin > > -----Original Message----- > From: Gustavo Romero [mailto:gromero at linux.vnet.ibm.com] > Sent: Montag, 7. M?rz 2016 16:27 > To: Doerr, Martin ; Vladimir Kozlov ; Thomas St?fe > Cc: hotspot-dev at openjdk.java.net; Breno Leitao > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > Hi Martin > > Sure, AIX is now included as well. > > Could you please host and review this updated version? > > Webrev: > http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev_v3.zip > > src/cpu/ppc/vm/globalDefinitions_ppc.hpp: > > I merged the defines as Thomas suggested. > > > src/cpu/ppc/vm/vm_version_ppc.cpp: > > Thomas, sorry for the cryptic comment about the kernel change. It refers > to Linux kernel source tree and not to OpenJDK. I've improved the > comment to reflect it. > > > Regarding MAX_inst_size: > I assumed that the ScratchBufferBlob issue is present only on PPC64 > and, as Vladmir and Martin suggested, I made MAX_inst_size a platform > specific value (changed only for PPC64 - AIX and Linux). Vladimir, > thanks for doing additional analysis on x64 architecture. > > > Regarding Linux version encoding: > Keeping the values x.y.z together the same form it was done on AIX is > more convenient, as Martin said, and besides that it's the way Linux > kernel itself handles the Linux kernel versions. Hence it defines > macro KERNEL_VERSION used whenever kernel version check/comparison is > necessary and it does exactly what we are doing for AIX and Linux on > PPC64: > > #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) > > So I think it's not a problem to assume true that each value in x.y.z > is always less then 256 and also never something like 3.2 (x.y). To the > best of my knowledge there is no rigid standard for that but by looking > at mainline kernel versions we can trust this format too. However, as > any distro can change it at will (although very unlikely), making it > more robust in the sense Thomas and Martin commented is a good idea. I > did it and checked if the kernel version format is what we expect > (x.y.z format) and for x, y, and z less then 256. > > Thomas, in case of a version is unknown I decided for bailing out > instead of just letting the VM continue with RTM disabled since it's the > behavior, for instance, when the CPU doesn't support Transactional > Memory and other similar conditions in the code around. But as method > os_version_is_known() exists (instead of assert()'s in os_linux.cpp), > it's possible to change this behavior easily in vm_version_ppc.cpp. > > > Regarding Hotspot jtreg tests: > No regression was observed. More 16 tests are passing now on Linux > (PP64 LE): > > Passed: compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java > Passed: compiler/rtm/locking/TestRTMAbortRatio.java > Passed: compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java > Passed: compiler/rtm/locking/TestRTMTotalCountIncrRate.java > Passed: compiler/rtm/locking/TestUseRTMDeopt.java > Passed: compiler/rtm/locking/TestUseRTMForInflatedLocks.java > Passed: compiler/rtm/locking/TestUseRTMForStackLocks.java > Passed: compiler/rtm/method_options/TestNoRTMLockElidingOption.java > Passed: compiler/rtm/method_options/TestUseRTMLockElidingOption.java > Passed: gc/ergonomics/TestDynamicNumberOfGCThreads.java > > > Kind regards, > Gustavo > > On 07-03-2016 07:17, Doerr, Martin wrote: >> Hi Gustavo, >> >> I?m back from vacation and I can host the webrev. Thanks for doing this change. It?s quite some work to get it into openjdk. >> >> May I ask you to increase the scratch buffer size for AIX as well (e.g. make it only dependent on PPC64, not on the OS in compile.hpp)? >> We have the same problem there and we should try to make only one shared code change. We will have to ask someone from Oracle to push it (e.g. Vladimir Kozlov). >> >> Best regards, >> Martin >> >> From: Thomas St?fe [mailto:thomas.stuefe at gmail.com] >> Sent: Montag, 7. M?rz 2016 07:48 >> To: Doerr, Martin >> Subject: Fwd: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> >> >> Hi Martin, kannst Du ?bernehmen? Bin erst morgen wieder da. >> >> Gru? Thomas >> ---------- Forwarded message ---------- >> From: "Gustavo Romero" > >> Date: Mar 6, 2016 23:27 >> Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> To: "Thomas St?fe" > >> Cc: "Doerr, Martin" >, "hotspot-dev at openjdk.java.net" >, > >> >> Hi Thomas >> >> Thanks for offering the hosting. :-) >> >> Thomas, could you please host this updated version that incorporates the >> comments made by you, Martin, and Vladimir (Martin also kindly offered >> the hosting but probably is yet out of office - but I'm not sure). >> >> Webrev updated version: >> http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev.zip >> >> Thanks a lot. >> >> Best regards, >> Gustavo >> >> On 25-02-2016 07:57, Thomas St?fe wrote: >>> Hi Gustavo, >>> >>> I can host this for you, if you have no access to cr.openjdk.java.net. Just >>> send me the patch file. >>> >>> About your change: >>> >>> src/cpu/ppc/vm/globalDefinitions_ppc.hpp >>> >>> small nit: Could be probably be merged with the paragraph above where we do >>> the same thing for AIX, but I do not have strong emotions. >>> >>> >>> src/cpu/ppc/vm/vm_version_ppc.cpp >>> >>> + // Please, refer to commit 4b4fadba057c1af7689fc8fa182b13baL7 >>> Does this refer to an OpenJDK change? If yes, could you please instead >>> mention the OpenJDK bug number instead? >>> >>> >>> src/os/linux/vm/os_linux.cpp >>> >>> os::Linux::initialize_os_info() >>> >>> Please make this code more robust: >>> - Check the return value of sscanf (must be 3, otherwise your assumption >>> about the version format was wrong) >>> - Could this happen: "3.2" ? If yes, could you please handle it too? >>> - Please handle overflow - if any one of minor/fix is > 256, something >>> sensible should happen (for major, this probably indicates an error). >>> Possibly cap out at 256? >>> >>> If version cannot be read successfully, the VM should not abort imho but >>> behave gracefully. Worst that should happen is that RTM gets deactivated. >>> >>> >>> Kind Regards, Thomas >>> >>> >>> On Thu, Feb 25, 2016 at 9:21 AM, David Holmes > >>> wrote: >>> >>>> On 25/02/2016 6:11 PM, Gustavo Romero wrote: >>>> >>>>> Hi David, >>>>> >>>>> OK, I'll fix that. >>>>> >>>>> Should I re-send the RFR with the right URL and abandon this one? >>>>> >>>> >>>> I think you can just post the new URL to this one. >>>> >>>> In case a contribution is not so small, even so is it fine to include it >>>>> inline? >>>>> >>>> >>>> Well it's preferable, for larger contributions, to find someone to host >>>> the webrev for you. >>>> >>>> Cheers, >>>> David >>>> >>>> >>>> Thank you. >>>>> >>>>> Regards, >>>>> Gustavo >>>>> >>>>> On 25-02-2016 04:54, David Holmes wrote: >>>>> >>>>>> Hi Gustavo, >>>>>> >>>>>> Just a point of order. All contributions to the OpenJDK must be made >>>>>> through OpenJDK infrastructure. So you must either get someone to host your >>>>>> webrev on cr.openjdk.java.net, or include it inline in >>>>>> email (attachments tend to get stripped). >>>>>> >>>>>> Sorry for the inconvenience. >>>>>> >>>>>> David >>>>>> >>>>>> On 25/02/2016 5:50 AM, Gustavo Romero wrote: >>>>>> >>>>>>> Hi Martin, >>>>>>> >>>>>>> Both little and big endian Linux kernel contain the syscall change, so >>>>>>> I did not include: >>>>>>> >>>>>>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>>>>>> >>>>>>> in globalDefinitions_ppc.hpp. >>>>>>> >>>>>>> Please, could you review the following change? >>>>>>> >>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>>>>>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>>>>>> >>>>>>> Summary: >>>>>>> >>>>>>> * Enable RTM support for Linux on PPC64 (LE and BE). >>>>>>> * Fix C2 compiler buffer size issue. >>>>>>> >>>>>>> Thank you. >>>>>>> >>>>>>> Regards, >>>>>>> Gustavo >>>>>>> >>>>>>> >>>>>> >>>>> >>> > From jon.masamitsu at oracle.com Mon Mar 7 17:02:15 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Mon, 7 Mar 2016 09:02:15 -0800 Subject: RFR 8150013: ParNew: Prune nmethods scavengable list In-Reply-To: References: <56D8CCBE.4040900@oracle.com> <56D9D98A.8050407@oracle.com> Message-ID: <56DDB417.4040604@oracle.com> On 03/06/2016 05:51 PM, Carsten Varming wrote: > Dear Jon, > > Thank you for sponsoring. > > I am not sure about your intended change to the patch. If > fix_relocations, then there are two cases where I remove the nmethod > from the scavengable list: 1. If the nmethod is not live. 2. If the > nmethod is live and it does not have scavengable roots. With your > suggested code change I don't think I can cover both cases without > code duplication. So I think it is best to leave the logic as is. Ok. > > Regarding you proposed comment about the precision of > detect_scavenge_root_oops. > // Unless the relocations have been updated (fixed), the > // detect_scavenge_root_oops() will not be precise so skip > // the check to unlink. Note that not doing the unlinking > // is safe but less optimal. > > I don't know what you mean when you say "detect_scavenge_root_oops() > will not be precise". The method fix_relocations() in every closure > that might move an object returns true (I carefully checked all > collectors except G1 (which does not use the list)), so there should > never be a time where an nmethod is left in a state where > detect_scavenge_root_oops is wrong. You are right that non-scavengable > nmethods on the list is fine, but I disagree about it being less than > optimal (see next comment). > > The reason I chose to not prune nmethods when !fix_relocations is that > I don't expect to be able to prune any live nmethods. To prune a live > nmethod from the list all oops in the nmethod must be non-scavengable > (oops::is_scavengable() must return false). In all collectors today, > fix_relocations is true if an object might be moved. Hence the only > time the list might contain a non-scavengable nmethod is between line > 663 and 668 in my patch and between an oop moved by a full collection > and the prune method called at the end of said collection. As every > live nmethod on the list is expected to be scavengable (with the > exceptions already listed) pruning the list when objects have not > moved seems like a waste. What about dead nmethods? I don't think > pruning dead nmethods really makes a difference, but I would be happy > to change the code to prune them regardless of the value of > fix_relocations. I think you are correct so no need to make a change. > > I added the following comment > // The scavengable nmethod list must contain all methods with scavengable > // oops. It is safe to include more nmethod on the list, but we do not > // expect any live non-scavengable nmethods on the list. > I hope that covers your intention. Thanks for the added comment. > > I updated the webrev at > http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ > > with the comment. I'll push this version. Jon > > Carsten > > On Fri, Mar 4, 2016 at 1:52 PM, Jon Masamitsu > > wrote: > > Carsten, > > There will be a couple of days delay in pushing this > change. The runtime repository is closed at the > moment but hopefully will be open again in a day > or two. > > Jon > > > On 03/04/2016 10:23 AM, Carsten Varming wrote: >> Dear Christian, >> >> Thank you for your review. >> >> Carsten >> >> On Fri, Mar 4, 2016 at 12:50 PM, Christian Thalinger >> > > wrote: >> >> Jon asked me to have a quick look over the code cache >> changes. Looks good to me. >> >> > On Mar 3, 2016, at 1:46 PM, Jon Masamitsu >> > >> wrote: >> > >> > Carsten, >> > >> > Changes look good. >> > >> > A couple of suggestions. >> > >> > >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/src/share/vm/code/codeCache.cpp.frames.html >> >> > >> > 661 if (is_live) { >> > 662 // Perform cur->oops_do(f), maybe just once per >> nmethod. >> > 663 f->do_code_blob(cur); >> > 664 } >> > 665 nmethod* const next = cur->scavenge_root_link(); >> > 666 if (fix_relocations) { >> > 667 if (!is_live || !cur->detect_scavenge_root_oops()) { >> > 668 unlink_scavenge_root_nmethod(cur, prev); >> > 669 } else { >> > 670 prev = cur; >> > 671 } >> > 672 } >> > 673 cur = next; >> > >> > Although this does not change the actions, I find this >> easier to >> > read. You and Tony (and whoever else wants to) can vote >> > on it. >> > >> > if (is_live) { ... } else { >> > if (fix_relocations) { if >> (cur->detect_scavenge_root_oops()) { prev = cur; } else { >> unlink_scavenge_root_nmethod(cur, prev);} } cur = >> cur->scavenge_root_link(); } >> > >> > Also I'd suggest a comment before the if-test >> > if you find it correct. >> > >> > // Unless the relocations have been updated (fixed), the // >> detect_scavenge_root_oops() will not be precise so skip // >> the check to unlink. Note that not doing the unlinking // is >> safe but less optimal. if (fix_relocations) { >> > >> > The comment in the header file for fix_relocations helped >> > but a comment here might be helpful. >> > >> > I'll sponsor. >> > >> > Jon >> > >> > On 2/28/2016 6:16 PM, Carsten Varming wrote: >> >> Dear Hotspot developers, >> >> >> >> Any chance of a review of this patch? The patch cut >> between 7ms and 10ms of every ParNew with one application at >> Twitter and I expect a 1-2ms improvement for most applications. >> >> >> >> I touch the code cache and GenCollectedHeap, so I assume I >> need reviews from both gc and compiler reviewers. Thank you >> Tony Printezis for the review (posted on the hotspot-gc-dev >> list). >> >> >> >> I also need a sponsor. >> >> >> >> Carsten >> >> >> >> On Fri, Feb 19, 2016 at 10:52 AM, Carsten Varming > > >> wrote: >> >> >> >> Dear Hotspot developers, >> >> >> >> I would like to contribute a patch for JDK-8150013 >> >> . The >> current >> >> webrev can be found here: >> >> >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ >> >> >> >> . >> >> >> >> Suggestions for improvements are very welcome. >> >> >> >> Carsten >> >> >> >> >> > >> >> > > From Guy.Delamarter at oracle.com Mon Mar 7 17:30:52 2016 From: Guy.Delamarter at oracle.com (Guy Delamarter) Date: Mon, 7 Mar 2016 09:30:52 -0800 Subject: [9] RFR(S): 8144693: Intrinsify StringCoding.hasNegatives() on SPARC In-Reply-To: <56D7BFA6.1000401@oracle.com> References: <56D77856.1020707@oracle.com> <56D7BFA6.1000401@oracle.com> Message-ID: <56DDBACC.2020405@oracle.com> Hi, On 03/02/2016 08:37 PM, Vladimir Kozlov wrote: > Why you are avoiding the same register for src and dst in > instructions? For example: > > + add(t3, 0x80, t2); > > I think you can use less registers if you reuse registers. The less > registers you use - less registers will be spilled on stack in the > code which use your code. Spilling doesn't appear to be a problem in actual hasNegatives use. In the cases I've looked at, on entry the second parameter, size, is copied from one register (e.g. %i3) to %g3 and both are preserved all the way through the hasNegatives code, without prior spill. The former register is then the one used after exit. If register pressure and resulting spilling becomes an issue, hopefully there is some way to eliminate the duplication. > > > 'size' register is defined as 32-bit values in .ad file. It may have > garbage in apper bits - I would suggest to sign extend it before using: > Good to know. > signx(size); > > If size is small (t5 != 0 for unaligned header) may be we should just > jump to tail code to do right shift (to mov(0, result); instruction). > But I am not insisting on this. If I understand correctly that replaces two instructions with three, one of which is a branch, without providing additional function. I made the other changes, and after I noticed the minor problem, fixed it so unaligned array segments of size 0 won't perform any reads. New Webrevs: http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.01/ http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.01/ Thanks, Guy Delamarter > > > Thanks, > Vladimir > > On 3/2/16 3:33 PM, Guy Delamarter wrote: >> Hi, >> >> Please review the following patch adding a SPARC intrinsic for >> StringCoding.hasNegatives to hotspot and supporting changes. >> >> Tobias Hartmann (tobias.hartmann at oracle.com) has offered to >> sponsor these changes. >> >> >> Summary: >> >> hasNegatives is a utility method for encoding/decoding under the new >> Compact Strings framework, returning whether the given byte array >> (segment) contains any negative entries. hasNegatives is an intrinsic >> candidate, emitted by hotspot as a node in the latest Java 9 builds, >> but the SPARC node match and (inline assembly) implementation have >> been missing up to now. This implementation checks aligned 8-byte >> windows onto the array segment for negative bytes, carefully ignoring >> bytes in the window that happen to be outside the segment. >> >> It was discovered that the private access of the hasNegatives method >> prevented direct testing of the intrinsic from outside StringCoding, >> so that was changed to public. Subsequent to this change a compiler >> test class (TestHasNegatives) was added providing useful validation >> coverage. >> >> >> Webrevs: >> http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.00/ >> http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.00/ >> >> Issue: >> https://bugs.openjdk.java.net/browse/JDK-8144693 >> >> >> Thanks, >> Guy Delamarter >> From vladimir.kozlov at oracle.com Mon Mar 7 17:43:46 2016 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Mon, 7 Mar 2016 09:43:46 -0800 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: <4866933cb0424052a3eec45b38a6ee45@DEWDFE13DE14.global.corp.sap> References: <56CE0975.8060807@linux.vnet.ibm.com> <56CEB349.1050102@oracle.com> <56CEB73D.8030904@linux.vnet.ibm.com> <56CEB982.5030706@oracle.com> <56DCAEB7.8010003@linux.vnet.ibm.com> <56DD9DCF.8090703@linux.vnet.ibm.com> <4866933cb0424052a3eec45b38a6ee45@DEWDFE13DE14.global.corp.sap> Message-ID: <56DDBDD2.90100@oracle.com> Looks good. I will push it. Thanks, Vladimir On 3/7/16 8:00 AM, Doerr, Martin wrote: > Hi, > > looks good. Thanks for making the requested changes. > > The change modifies os_linux and shared C2 code. > Can somebody from Oracle review and sponsor, please? > > The webrev is here: > http://cr.openjdk.java.net/~mdoerr/8150353_RTM_linux_ppc64/webrev.00/ > > It was tested in jdk9/dev/hotspot, but it applies to jdk9/hs-comp/hotspot as well. > > Best regards, > Martin > > -----Original Message----- > From: Gustavo Romero [mailto:gromero at linux.vnet.ibm.com] > Sent: Montag, 7. M?rz 2016 16:27 > To: Doerr, Martin ; Vladimir Kozlov ; Thomas St?fe > Cc: hotspot-dev at openjdk.java.net; Breno Leitao > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > Hi Martin > > Sure, AIX is now included as well. > > Could you please host and review this updated version? > > Webrev: > http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev_v3.zip > > src/cpu/ppc/vm/globalDefinitions_ppc.hpp: > > I merged the defines as Thomas suggested. > > > src/cpu/ppc/vm/vm_version_ppc.cpp: > > Thomas, sorry for the cryptic comment about the kernel change. It refers > to Linux kernel source tree and not to OpenJDK. I've improved the > comment to reflect it. > > > Regarding MAX_inst_size: > I assumed that the ScratchBufferBlob issue is present only on PPC64 > and, as Vladmir and Martin suggested, I made MAX_inst_size a platform > specific value (changed only for PPC64 - AIX and Linux). Vladimir, > thanks for doing additional analysis on x64 architecture. > > > Regarding Linux version encoding: > Keeping the values x.y.z together the same form it was done on AIX is > more convenient, as Martin said, and besides that it's the way Linux > kernel itself handles the Linux kernel versions. Hence it defines > macro KERNEL_VERSION used whenever kernel version check/comparison is > necessary and it does exactly what we are doing for AIX and Linux on > PPC64: > > #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) > > So I think it's not a problem to assume true that each value in x.y.z > is always less then 256 and also never something like 3.2 (x.y). To the > best of my knowledge there is no rigid standard for that but by looking > at mainline kernel versions we can trust this format too. However, as > any distro can change it at will (although very unlikely), making it > more robust in the sense Thomas and Martin commented is a good idea. I > did it and checked if the kernel version format is what we expect > (x.y.z format) and for x, y, and z less then 256. > > Thomas, in case of a version is unknown I decided for bailing out > instead of just letting the VM continue with RTM disabled since it's the > behavior, for instance, when the CPU doesn't support Transactional > Memory and other similar conditions in the code around. But as method > os_version_is_known() exists (instead of assert()'s in os_linux.cpp), > it's possible to change this behavior easily in vm_version_ppc.cpp. > > > Regarding Hotspot jtreg tests: > No regression was observed. More 16 tests are passing now on Linux > (PP64 LE): > > Passed: compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java > Passed: compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java > Passed: compiler/rtm/locking/TestRTMAbortRatio.java > Passed: compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java > Passed: compiler/rtm/locking/TestRTMTotalCountIncrRate.java > Passed: compiler/rtm/locking/TestUseRTMDeopt.java > Passed: compiler/rtm/locking/TestUseRTMForInflatedLocks.java > Passed: compiler/rtm/locking/TestUseRTMForStackLocks.java > Passed: compiler/rtm/method_options/TestNoRTMLockElidingOption.java > Passed: compiler/rtm/method_options/TestUseRTMLockElidingOption.java > Passed: gc/ergonomics/TestDynamicNumberOfGCThreads.java > > > Kind regards, > Gustavo > > On 07-03-2016 07:17, Doerr, Martin wrote: >> Hi Gustavo, >> >> I?m back from vacation and I can host the webrev. Thanks for doing this change. It?s quite some work to get it into openjdk. >> >> May I ask you to increase the scratch buffer size for AIX as well (e.g. make it only dependent on PPC64, not on the OS in compile.hpp)? >> We have the same problem there and we should try to make only one shared code change. We will have to ask someone from Oracle to push it (e.g. Vladimir Kozlov). >> >> Best regards, >> Martin >> >> From: Thomas St?fe [mailto:thomas.stuefe at gmail.com] >> Sent: Montag, 7. M?rz 2016 07:48 >> To: Doerr, Martin >> Subject: Fwd: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> >> >> Hi Martin, kannst Du ?bernehmen? Bin erst morgen wieder da. >> >> Gru? Thomas >> ---------- Forwarded message ---------- >> From: "Gustavo Romero" > >> Date: Mar 6, 2016 23:27 >> Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> To: "Thomas St?fe" > >> Cc: "Doerr, Martin" >, "hotspot-dev at openjdk.java.net" >, > >> >> Hi Thomas >> >> Thanks for offering the hosting. :-) >> >> Thomas, could you please host this updated version that incorporates the >> comments made by you, Martin, and Vladimir (Martin also kindly offered >> the hosting but probably is yet out of office - but I'm not sure). >> >> Webrev updated version: >> http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev.zip >> >> Thanks a lot. >> >> Best regards, >> Gustavo >> >> On 25-02-2016 07:57, Thomas St?fe wrote: >>> Hi Gustavo, >>> >>> I can host this for you, if you have no access to cr.openjdk.java.net. Just >>> send me the patch file. >>> >>> About your change: >>> >>> src/cpu/ppc/vm/globalDefinitions_ppc.hpp >>> >>> small nit: Could be probably be merged with the paragraph above where we do >>> the same thing for AIX, but I do not have strong emotions. >>> >>> >>> src/cpu/ppc/vm/vm_version_ppc.cpp >>> >>> + // Please, refer to commit 4b4fadba057c1af7689fc8fa182b13baL7 >>> Does this refer to an OpenJDK change? If yes, could you please instead >>> mention the OpenJDK bug number instead? >>> >>> >>> src/os/linux/vm/os_linux.cpp >>> >>> os::Linux::initialize_os_info() >>> >>> Please make this code more robust: >>> - Check the return value of sscanf (must be 3, otherwise your assumption >>> about the version format was wrong) >>> - Could this happen: "3.2" ? If yes, could you please handle it too? >>> - Please handle overflow - if any one of minor/fix is > 256, something >>> sensible should happen (for major, this probably indicates an error). >>> Possibly cap out at 256? >>> >>> If version cannot be read successfully, the VM should not abort imho but >>> behave gracefully. Worst that should happen is that RTM gets deactivated. >>> >>> >>> Kind Regards, Thomas >>> >>> >>> On Thu, Feb 25, 2016 at 9:21 AM, David Holmes > >>> wrote: >>> >>>> On 25/02/2016 6:11 PM, Gustavo Romero wrote: >>>> >>>>> Hi David, >>>>> >>>>> OK, I'll fix that. >>>>> >>>>> Should I re-send the RFR with the right URL and abandon this one? >>>>> >>>> >>>> I think you can just post the new URL to this one. >>>> >>>> In case a contribution is not so small, even so is it fine to include it >>>>> inline? >>>>> >>>> >>>> Well it's preferable, for larger contributions, to find someone to host >>>> the webrev for you. >>>> >>>> Cheers, >>>> David >>>> >>>> >>>> Thank you. >>>>> >>>>> Regards, >>>>> Gustavo >>>>> >>>>> On 25-02-2016 04:54, David Holmes wrote: >>>>> >>>>>> Hi Gustavo, >>>>>> >>>>>> Just a point of order. All contributions to the OpenJDK must be made >>>>>> through OpenJDK infrastructure. So you must either get someone to host your >>>>>> webrev on cr.openjdk.java.net, or include it inline in >>>>>> email (attachments tend to get stripped). >>>>>> >>>>>> Sorry for the inconvenience. >>>>>> >>>>>> David >>>>>> >>>>>> On 25/02/2016 5:50 AM, Gustavo Romero wrote: >>>>>> >>>>>>> Hi Martin, >>>>>>> >>>>>>> Both little and big endian Linux kernel contain the syscall change, so >>>>>>> I did not include: >>>>>>> >>>>>>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>>>>>> >>>>>>> in globalDefinitions_ppc.hpp. >>>>>>> >>>>>>> Please, could you review the following change? >>>>>>> >>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>>>>>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>>>>>> >>>>>>> Summary: >>>>>>> >>>>>>> * Enable RTM support for Linux on PPC64 (LE and BE). >>>>>>> * Fix C2 compiler buffer size issue. >>>>>>> >>>>>>> Thank you. >>>>>>> >>>>>>> Regards, >>>>>>> Gustavo >>>>>>> >>>>>>> >>>>>> >>>>> >>> > From gromero at linux.vnet.ibm.com Mon Mar 7 17:53:30 2016 From: gromero at linux.vnet.ibm.com (Gustavo Romero) Date: Mon, 7 Mar 2016 14:53:30 -0300 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: <56DDBDD2.90100@oracle.com> References: <56CE0975.8060807@linux.vnet.ibm.com> <56CEB349.1050102@oracle.com> <56CEB73D.8030904@linux.vnet.ibm.com> <56CEB982.5030706@oracle.com> <56DCAEB7.8010003@linux.vnet.ibm.com> <56DD9DCF.8090703@linux.vnet.ibm.com> <4866933cb0424052a3eec45b38a6ee45@DEWDFE13DE14.global.corp.sap> <56DDBDD2.90100@oracle.com> Message-ID: <56DDC01A.9050105@linux.vnet.ibm.com> Thanks a lot Vladimir. Best regards, Gustavo On 07-03-2016 14:43, Vladimir Kozlov wrote: > Looks good. I will push it. > > Thanks, > Vladimir > > On 3/7/16 8:00 AM, Doerr, Martin wrote: >> Hi, >> >> looks good. Thanks for making the requested changes. >> >> The change modifies os_linux and shared C2 code. >> Can somebody from Oracle review and sponsor, please? >> >> The webrev is here: >> http://cr.openjdk.java.net/~mdoerr/8150353_RTM_linux_ppc64/webrev.00/ >> >> It was tested in jdk9/dev/hotspot, but it applies to jdk9/hs-comp/hotspot as well. >> >> Best regards, >> Martin >> >> -----Original Message----- >> From: Gustavo Romero [mailto:gromero at linux.vnet.ibm.com] >> Sent: Montag, 7. M?rz 2016 16:27 >> To: Doerr, Martin ; Vladimir Kozlov ; Thomas St?fe >> Cc: hotspot-dev at openjdk.java.net; Breno Leitao >> Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> >> Hi Martin >> >> Sure, AIX is now included as well. >> >> Could you please host and review this updated version? >> >> Webrev: >> http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev_v3.zip >> >> src/cpu/ppc/vm/globalDefinitions_ppc.hpp: >> >> I merged the defines as Thomas suggested. >> >> >> src/cpu/ppc/vm/vm_version_ppc.cpp: >> >> Thomas, sorry for the cryptic comment about the kernel change. It refers >> to Linux kernel source tree and not to OpenJDK. I've improved the >> comment to reflect it. >> >> >> Regarding MAX_inst_size: >> I assumed that the ScratchBufferBlob issue is present only on PPC64 >> and, as Vladmir and Martin suggested, I made MAX_inst_size a platform >> specific value (changed only for PPC64 - AIX and Linux). Vladimir, >> thanks for doing additional analysis on x64 architecture. >> >> >> Regarding Linux version encoding: >> Keeping the values x.y.z together the same form it was done on AIX is >> more convenient, as Martin said, and besides that it's the way Linux >> kernel itself handles the Linux kernel versions. Hence it defines >> macro KERNEL_VERSION used whenever kernel version check/comparison is >> necessary and it does exactly what we are doing for AIX and Linux on >> PPC64: >> >> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) >> >> So I think it's not a problem to assume true that each value in x.y.z >> is always less then 256 and also never something like 3.2 (x.y). To the >> best of my knowledge there is no rigid standard for that but by looking >> at mainline kernel versions we can trust this format too. However, as >> any distro can change it at will (although very unlikely), making it >> more robust in the sense Thomas and Martin commented is a good idea. I >> did it and checked if the kernel version format is what we expect >> (x.y.z format) and for x, y, and z less then 256. >> >> Thomas, in case of a version is unknown I decided for bailing out >> instead of just letting the VM continue with RTM disabled since it's the >> behavior, for instance, when the CPU doesn't support Transactional >> Memory and other similar conditions in the code around. But as method >> os_version_is_known() exists (instead of assert()'s in os_linux.cpp), >> it's possible to change this behavior easily in vm_version_ppc.cpp. >> >> >> Regarding Hotspot jtreg tests: >> No regression was observed. More 16 tests are passing now on Linux >> (PP64 LE): >> >> Passed: compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java >> Passed: compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java >> Passed: compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java >> Passed: compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java >> Passed: compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java >> Passed: compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java >> Passed: compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java >> Passed: compiler/rtm/locking/TestRTMAbortRatio.java >> Passed: compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java >> Passed: compiler/rtm/locking/TestRTMTotalCountIncrRate.java >> Passed: compiler/rtm/locking/TestUseRTMDeopt.java >> Passed: compiler/rtm/locking/TestUseRTMForInflatedLocks.java >> Passed: compiler/rtm/locking/TestUseRTMForStackLocks.java >> Passed: compiler/rtm/method_options/TestNoRTMLockElidingOption.java >> Passed: compiler/rtm/method_options/TestUseRTMLockElidingOption.java >> Passed: gc/ergonomics/TestDynamicNumberOfGCThreads.java >> >> >> Kind regards, >> Gustavo >> >> On 07-03-2016 07:17, Doerr, Martin wrote: >>> Hi Gustavo, >>> >>> I?m back from vacation and I can host the webrev. Thanks for doing this change. It?s quite some work to get it into openjdk. >>> >>> May I ask you to increase the scratch buffer size for AIX as well (e.g. make it only dependent on PPC64, not on the OS in compile.hpp)? >>> We have the same problem there and we should try to make only one shared code change. We will have to ask someone from Oracle to push it (e.g. Vladimir Kozlov). >>> >>> Best regards, >>> Martin >>> >>> From: Thomas St?fe [mailto:thomas.stuefe at gmail.com] >>> Sent: Montag, 7. M?rz 2016 07:48 >>> To: Doerr, Martin >>> Subject: Fwd: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >>> >>> >>> Hi Martin, kannst Du ?bernehmen? Bin erst morgen wieder da. >>> >>> Gru? Thomas >>> ---------- Forwarded message ---------- >>> From: "Gustavo Romero" > >>> Date: Mar 6, 2016 23:27 >>> Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >>> To: "Thomas St?fe" > >>> Cc: "Doerr, Martin" >, "hotspot-dev at openjdk.java.net" >>> >, > >>> >>> Hi Thomas >>> >>> Thanks for offering the hosting. :-) >>> >>> Thomas, could you please host this updated version that incorporates the >>> comments made by you, Martin, and Vladimir (Martin also kindly offered >>> the hosting but probably is yet out of office - but I'm not sure). >>> >>> Webrev updated version: >>> http://81.de.7a9f.ip4.static.sl-reverse.com./8150353/webrev.zip >>> >>> Thanks a lot. >>> >>> Best regards, >>> Gustavo >>> >>> On 25-02-2016 07:57, Thomas St?fe wrote: >>>> Hi Gustavo, >>>> >>>> I can host this for you, if you have no access to cr.openjdk.java.net. Just >>>> send me the patch file. >>>> >>>> About your change: >>>> >>>> src/cpu/ppc/vm/globalDefinitions_ppc.hpp >>>> >>>> small nit: Could be probably be merged with the paragraph above where we do >>>> the same thing for AIX, but I do not have strong emotions. >>>> >>>> >>>> src/cpu/ppc/vm/vm_version_ppc.cpp >>>> >>>> + // Please, refer to commit 4b4fadba057c1af7689fc8fa182b13baL7 >>>> Does this refer to an OpenJDK change? If yes, could you please instead >>>> mention the OpenJDK bug number instead? >>>> >>>> >>>> src/os/linux/vm/os_linux.cpp >>>> >>>> os::Linux::initialize_os_info() >>>> >>>> Please make this code more robust: >>>> - Check the return value of sscanf (must be 3, otherwise your assumption >>>> about the version format was wrong) >>>> - Could this happen: "3.2" ? If yes, could you please handle it too? >>>> - Please handle overflow - if any one of minor/fix is > 256, something >>>> sensible should happen (for major, this probably indicates an error). >>>> Possibly cap out at 256? >>>> >>>> If version cannot be read successfully, the VM should not abort imho but >>>> behave gracefully. Worst that should happen is that RTM gets deactivated. >>>> >>>> >>>> Kind Regards, Thomas >>>> >>>> >>>> On Thu, Feb 25, 2016 at 9:21 AM, David Holmes > >>>> wrote: >>>> >>>>> On 25/02/2016 6:11 PM, Gustavo Romero wrote: >>>>> >>>>>> Hi David, >>>>>> >>>>>> OK, I'll fix that. >>>>>> >>>>>> Should I re-send the RFR with the right URL and abandon this one? >>>>>> >>>>> >>>>> I think you can just post the new URL to this one. >>>>> >>>>> In case a contribution is not so small, even so is it fine to include it >>>>>> inline? >>>>>> >>>>> >>>>> Well it's preferable, for larger contributions, to find someone to host >>>>> the webrev for you. >>>>> >>>>> Cheers, >>>>> David >>>>> >>>>> >>>>> Thank you. >>>>>> >>>>>> Regards, >>>>>> Gustavo >>>>>> >>>>>> On 25-02-2016 04:54, David Holmes wrote: >>>>>> >>>>>>> Hi Gustavo, >>>>>>> >>>>>>> Just a point of order. All contributions to the OpenJDK must be made >>>>>>> through OpenJDK infrastructure. So you must either get someone to host your >>>>>>> webrev on cr.openjdk.java.net, or include it inline in >>>>>>> email (attachments tend to get stripped). >>>>>>> >>>>>>> Sorry for the inconvenience. >>>>>>> >>>>>>> David >>>>>>> >>>>>>> On 25/02/2016 5:50 AM, Gustavo Romero wrote: >>>>>>> >>>>>>>> Hi Martin, >>>>>>>> >>>>>>>> Both little and big endian Linux kernel contain the syscall change, so >>>>>>>> I did not include: >>>>>>>> >>>>>>>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>>>>>>> >>>>>>>> in globalDefinitions_ppc.hpp. >>>>>>>> >>>>>>>> Please, could you review the following change? >>>>>>>> >>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>>>>>>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>>>>>>> >>>>>>>> Summary: >>>>>>>> >>>>>>>> * Enable RTM support for Linux on PPC64 (LE and BE). >>>>>>>> * Fix C2 compiler buffer size issue. >>>>>>>> >>>>>>>> Thank you. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Gustavo >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>> >> > From vladimir.kozlov at oracle.com Mon Mar 7 18:17:43 2016 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Mon, 7 Mar 2016 10:17:43 -0800 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: References: <56CE0975.8060807@linux.vnet.ibm.com> <56CE42AE.7080605@oracle.com> <10c9a1cb6d9b40618a094283ac838038@DEWDFE13DE14.global.corp.sap> <56CFB72C.7030401@oracle.com> Message-ID: <56DDC5C7.3000105@oracle.com> RTM's assumption is: "RTM locking is most useful when there is high lock contention and low data contention. With high lock contention the lock is usually inflated and biased locking is not suitable for that case anyway." It is not the case with jbb2005. And that is why RTM is off by default. First RTM implementation used BiasedLocking bits in object's markword. Later it was implemented differently but there was still a concern that to make them work together we may need more changes. We thought that we will do that as separate project later. But currently we don't have a plan for doing this. Regards, Vladimir On 3/7/16 2:29 AM, Doerr, Martin wrote: > Hi Vladimir, > > thank you very much for the detailed analysis. > I hope an #ifdef PPC64 is ok in the shared code? > > I had written something to Gustavo about the performance problem we have with RTM in SPEC jbb2005: > >> The following issue is important for performance work: >> RTM does not work with BiasedLocking. The latter gets switched off if RTM is activated which has a large performance impact (especially in jbb2005). >> I would disable it for a reference measurement: >> -XX:-UseBiasedLocking >> >> Unfortunately, RTM was slower than BiasedLocking but faster than the reference (without both) which tells me that there's room for improvement. >> There are basically 3 classes of locks: >> 1. no contention >> 2. contention on lock, low contention on data >> 3. high contention on data >> >> I believe the optimal treatment for the cases would be: >> 1. Biased Locking >> 2. Transactional Memory >> 3. classical locking with lock inflating >> >> I think it would be good if the JVM could optimize for all these cases in the future. But that would add additional complexity and code size. > > Do you think this is something which should be improved in the future? > We could try e.g. the following approach > - try biased > - deoptimize if it doesn't work well, try transactional > - deoptimize if it doesn't work well, use classical locking (with inflating) > > Best regards, > Martin > > > -----Original Message----- > From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] > Sent: Freitag, 26. Februar 2016 03:24 > To: Doerr, Martin ; Gustavo Romero ; hotspot-dev at openjdk.java.net > Cc: brenohl at br.ibm.com > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > The problem with increasing ScratchBufferBlob size is that with Tiered > compilation we scale number of compiler threads based on cpu count and > increase space in CodeCache accordingly: > > code_buffers_size += c2_count * C2Compiler::initial_code_buffer_size(); > > I did experiment on Intel setting ON all RTM flags which can increase > size of lock code: > > $ java -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions > -XX:+UseRTMLocking -XX:+UseRTMDeopt -XX:+UseRTMForStackLocks > -XX:+PrintPreciseRTMLockingStatistics -XX:+PrintFlagsFinal -version > |grep RTM > Java HotSpot(TM) 64-Bit Server VM warning: UseRTMLocking is only > available as experimental option on this platform. > bool PrintPreciseRTMLockingStatistics := true > {C2 diagnostic} > intx RTMAbortRatio = 50 > {ARCH experimental} > intx RTMAbortThreshold = 1000 > {ARCH experimental} > intx RTMLockingCalculationDelay = 0 > {ARCH experimental} > intx RTMLockingThreshold = 10000 > {ARCH experimental} > uintx RTMRetryCount = 5 > {ARCH product} > intx RTMSpinLoopCount = 100 > {ARCH experimental} > intx RTMTotalCountIncrRate = 64 > {ARCH experimental} > bool UseRTMDeopt := true > {ARCH product} > bool UseRTMForStackLocks := true > {ARCH experimental} > bool UseRTMLocking := true > {ARCH product} > bool UseRTMXendForLockBusy = true > {ARCH experimental} > > > I added next lines to the end of Compile::scratch_emit_size() method: > > if (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_FastLock) { > tty->print_cr("======== FastLock size: %d ==========", > buf.total_content_size()); > } > if (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_FastUnlock) { > tty->print_cr("======== FastUnlock size: %d ==========", > buf.total_content_size()); > } > > and got: > > ======== FastLock size: 657 ========== > ======== FastUnlock size: 175 ========== > > Thanks, > Vladimir > > On 2/25/16 3:43 AM, Doerr, Martin wrote: >> Hi Vladimir, >> >> thanks for taking a look. >> >> About version values: >> We are using a similar scheme for version checks on AIX where we know that the version values are less than 256. >> It makes comparisons much more convenient. >> But I agree that we should double-check if it is guaranteed for linux as well (and possibly add an assertion). >> >> About scratch buffer size: >> We only noticed that the scratch buffer was too small when we enable all RTM features: >> -XX:+UnlockExperimentalVMOptions -XX:+UseRTMLocking -XX:+UseRTMForStackLocks -XX:+UseRTMDeopt >> We have only tried on PPC64, but I wonder if the current size is sufficient for x86. I currently don't have access to a Skylake machine. >> >> I think adding 1024 bytes to the scratch buffer doesn't hurt. >> (It may also lead to larger CodeBuffers in output.cpp but I don't think this is problematic as long as the real content gets copied to nmethods.) >> Would you agree? >> >> Best regards, >> Martin >> >> -----Original Message----- >> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] >> Sent: Donnerstag, 25. Februar 2016 00:54 >> To: Gustavo Romero ; Doerr, Martin ; hotspot-dev at openjdk.java.net >> Cc: brenohl at br.ibm.com >> Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> >> My concern (but I am not export) is Linux version encoding. Is it true >> that each value in x.y.z is less then 256? Why not keep them as separate >> int values? >> I also thought we have OS versions in make files but we check only gcc >> version there. >> >> Do you have problem with ScratchBufferBlob only on PPC or on some other >> platforms too? May be we should make MAX_inst_size as platform specific >> value. >> >> Thanks, >> Vladimir >> >> On 2/24/16 11:50 AM, Gustavo Romero wrote: >>> Hi Martin, >>> >>> Both little and big endian Linux kernel contain the syscall change, so >>> I did not include: >>> >>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>> >>> in globalDefinitions_ppc.hpp. >>> >>> Please, could you review the following change? >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>> >>> Summary: >>> >>> * Enable RTM support for Linux on PPC64 (LE and BE). >>> * Fix C2 compiler buffer size issue. >>> >>> Thank you. >>> >>> Regards, >>> Gustavo >>> From jon.masamitsu at oracle.com Mon Mar 7 18:46:25 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Mon, 7 Mar 2016 10:46:25 -0800 Subject: RFR 8150013: ParNew: Prune nmethods scavengable list In-Reply-To: <56DDB417.4040604@oracle.com> References: <56D8CCBE.4040900@oracle.com> <56D9D98A.8050407@oracle.com> <56DDB417.4040604@oracle.com> Message-ID: <56DDCC81.4030700@oracle.com> Carsten, Just to you. You have author status so you could commit the patch in mercurial and send me the patch for the changeset. That would then list you as the user who submitted the change. Or I could commit the patch and list you as the contributer. Which would you like to do. Jon On 03/07/2016 09:02 AM, Jon Masamitsu wrote: > > > On 03/06/2016 05:51 PM, Carsten Varming wrote: >> Dear Jon, >> >> Thank you for sponsoring. >> >> I am not sure about your intended change to the patch. If >> fix_relocations, then there are two cases where I remove the nmethod >> from the scavengable list: 1. If the nmethod is not live. 2. If the >> nmethod is live and it does not have scavengable roots. With your >> suggested code change I don't think I can cover both cases without >> code duplication. So I think it is best to leave the logic as is. > > Ok. > >> >> Regarding you proposed comment about the precision of >> detect_scavenge_root_oops. >> // Unless the relocations have been updated (fixed), the >> // detect_scavenge_root_oops() will not be precise so skip >> // the check to unlink. Note that not doing the unlinking >> // is safe but less optimal. >> >> I don't know what you mean when you say "detect_scavenge_root_oops() >> will not be precise". The method fix_relocations() in every closure >> that might move an object returns true (I carefully checked all >> collectors except G1 (which does not use the list)), so there should >> never be a time where an nmethod is left in a state where >> detect_scavenge_root_oops is wrong. You are right that >> non-scavengable nmethods on the list is fine, but I disagree about it >> being less than optimal (see next comment). >> >> The reason I chose to not prune nmethods when !fix_relocations is >> that I don't expect to be able to prune any live nmethods. To prune a >> live nmethod from the list all oops in the nmethod must be >> non-scavengable (oops::is_scavengable() must return false). In all >> collectors today, fix_relocations is true if an object might be >> moved. Hence the only time the list might contain a non-scavengable >> nmethod is between line 663 and 668 in my patch and between an oop >> moved by a full collection and the prune method called at the end of >> said collection. As every live nmethod on the list is expected to be >> scavengable (with the exceptions already listed) pruning the list >> when objects have not moved seems like a waste. What about dead >> nmethods? I don't think pruning dead nmethods really makes a >> difference, but I would be happy to change the code to prune them >> regardless of the value of fix_relocations. > > I think you are correct so no need to make a change. > >> >> I added the following comment >> // The scavengable nmethod list must contain all methods with >> scavengable >> // oops. It is safe to include more nmethod on the list, but we do not >> // expect any live non-scavengable nmethods on the list. >> I hope that covers your intention. > > Thanks for the added comment. >> >> I updated the webrev at >> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ >> >> with the comment. > > I'll push this version. > > Jon > >> >> Carsten >> >> On Fri, Mar 4, 2016 at 1:52 PM, Jon Masamitsu >> > wrote: >> >> Carsten, >> >> There will be a couple of days delay in pushing this >> change. The runtime repository is closed at the >> moment but hopefully will be open again in a day >> or two. >> >> Jon >> >> >> On 03/04/2016 10:23 AM, Carsten Varming wrote: >>> Dear Christian, >>> >>> Thank you for your review. >>> >>> Carsten >>> >>> On Fri, Mar 4, 2016 at 12:50 PM, Christian Thalinger >>> >> > wrote: >>> >>> Jon asked me to have a quick look over the code cache >>> changes. Looks good to me. >>> >>> > On Mar 3, 2016, at 1:46 PM, Jon Masamitsu >>> > >>> wrote: >>> > >>> > Carsten, >>> > >>> > Changes look good. >>> > >>> > A couple of suggestions. >>> > >>> > >>> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/src/share/vm/code/codeCache.cpp.frames.html >>> >>> > >>> > 661 if (is_live) { >>> > 662 // Perform cur->oops_do(f), maybe just once per >>> nmethod. >>> > 663 f->do_code_blob(cur); >>> > 664 } >>> > 665 nmethod* const next = cur->scavenge_root_link(); >>> > 666 if (fix_relocations) { >>> > 667 if (!is_live || !cur->detect_scavenge_root_oops()) { >>> > 668 unlink_scavenge_root_nmethod(cur, prev); >>> > 669 } else { >>> > 670 prev = cur; >>> > 671 } >>> > 672 } >>> > 673 cur = next; >>> > >>> > Although this does not change the actions, I find this >>> easier to >>> > read. You and Tony (and whoever else wants to) can vote >>> > on it. >>> > >>> > if (is_live) { ... } else { >>> > if (fix_relocations) { if >>> (cur->detect_scavenge_root_oops()) { prev = cur; } else { >>> unlink_scavenge_root_nmethod(cur, prev);} } cur = >>> cur->scavenge_root_link(); } >>> > >>> > Also I'd suggest a comment before the if-test >>> > if you find it correct. >>> > >>> > // Unless the relocations have been updated (fixed), the // >>> detect_scavenge_root_oops() will not be precise so skip // >>> the check to unlink. Note that not doing the unlinking // is >>> safe but less optimal. if (fix_relocations) { >>> > >>> > The comment in the header file for fix_relocations helped >>> > but a comment here might be helpful. >>> > >>> > I'll sponsor. >>> > >>> > Jon >>> > >>> > On 2/28/2016 6:16 PM, Carsten Varming wrote: >>> >> Dear Hotspot developers, >>> >> >>> >> Any chance of a review of this patch? The patch cut >>> between 7ms and 10ms of every ParNew with one application at >>> Twitter and I expect a 1-2ms improvement for most applications. >>> >> >>> >> I touch the code cache and GenCollectedHeap, so I assume I >>> need reviews from both gc and compiler reviewers. Thank you >>> Tony Printezis for the review (posted on the hotspot-gc-dev >>> list). >>> >> >>> >> I also need a sponsor. >>> >> >>> >> Carsten >>> >> >>> >> On Fri, Feb 19, 2016 at 10:52 AM, Carsten Varming >>> >> >> >> wrote: >>> >> >>> >> Dear Hotspot developers, >>> >> >>> >> I would like to contribute a patch for JDK-8150013 >>> >> . The >>> current >>> >> webrev can be found here: >>> >> >>> http://cr.openjdk.java.net/~cvarming/scavenge_nmethods_auto_prune/2/ >>> >>> >> >>> . >>> >> >>> >> Suggestions for improvements are very welcome. >>> >> >>> >> Carsten >>> >> >>> >> >>> > >>> >>> >> >> > From stefan.karlsson at oracle.com Tue Mar 8 10:33:30 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 8 Mar 2016 11:33:30 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps Message-ID: <56DEAA7A.1000200@oracle.com> Hi all, Please review this patch to remove the state variables from ArrayAllocator and make it an AllStatic class instead. The main motivation for this patch is to cleanup the BitMaps data structure and make the instances smaller. The patch builds on the fact that the current code invokes AllocateHeap with the default value AllocFailEnum:EXIT_OOM, and therefore never returns NULL. This means that use_malloc will never be reset and the allocation strategy used (malloc or mmap) can be determined by simply looking at the size input parameter. Instead of changing the code to use AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the current behavior so that we could cleanup and minimize the size of our BitMaps. http://cr.openjdk.java.net/~stefank/8151436/webrev/ https://bugs.openjdk.java.net/browse/JDK-8151436 Thanks, StefanK From stefan.karlsson at oracle.com Tue Mar 8 10:52:16 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 8 Mar 2016 11:52:16 +0100 Subject: RFR: 8151439: Inline the BitMap constructor Message-ID: <56DEAEE0.5020708@oracle.com> Hi all, Please review this patch to inline the BitMap constructor. This will allow us to efficiently use temporary, stack-allocated BitMaps. http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8151439 A code example of why we want to inline the BitMap constructor: void MyClass::set_bit(idx_t x) { BitMap(&_bits, BitsPerWord).par_set_bit(x). } We could have used an instance of a BitMap in MyClass, but that would store both a bm_word_t* and the size of the bitmap storage in MyClass. Since the size is a compile-time constant, we can use the above construct to only store a bm_word_t field in MyClass, and thereby reduce the size of MyClass. By inlining the constructor, we get rid of the extra overhead of creating a BitMap. Thanks, StefanK From thomas.schatzl at oracle.com Tue Mar 8 11:09:44 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Tue, 08 Mar 2016 12:09:44 +0100 Subject: RFR: 8151439: Inline the BitMap constructor In-Reply-To: <56DEAEE0.5020708@oracle.com> References: <56DEAEE0.5020708@oracle.com> Message-ID: <1457435384.2272.9.camel@oracle.com> Hi Stefan, On Tue, 2016-03-08 at 11:52 +0100, Stefan Karlsson wrote: > Hi all, > > Please review this patch to inline the BitMap constructor. This will > allow us to efficiently use temporary, stack-allocated BitMaps. > > http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8151439 > > A code example of why we want to inline the BitMap constructor: > void MyClass::set_bit(idx_t x) { > BitMap(&_bits, BitsPerWord).par_set_bit(x). > } > > We could have used an instance of a BitMap in MyClass, but that would > store both a bm_word_t* and the size of the bitmap storage in > MyClass. > Since the size is a compile-time constant, we can use the above > construct to only store a bm_word_t field in MyClass, and thereby > reduce > the size of MyClass. By inlining the constructor, we get rid of the > extra overhead of creating a BitMap. looks good. Thanks, Thomas From thomas.schatzl at oracle.com Tue Mar 8 11:10:55 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Tue, 08 Mar 2016 12:10:55 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56DEAA7A.1000200@oracle.com> References: <56DEAA7A.1000200@oracle.com> Message-ID: <1457435455.2272.10.camel@oracle.com> Hi Stefan, On Tue, 2016-03-08 at 11:33 +0100, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove the state variables from > ArrayAllocator and make it an AllStatic class instead. The main > motivation for this patch is to cleanup the BitMaps data structure > and > make the instances smaller. > > The patch builds on the fact that the current code invokes > AllocateHeap > with the default value AllocFailEnum:EXIT_OOM, and therefore never > returns NULL. This means that use_malloc will never be reset and the > allocation strategy used (malloc or mmap) can be determined by simply > looking at the size input parameter. Instead of changing the code to > use > AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the > current behavior so that we could cleanup and minimize the size of > our > BitMaps. > > http://cr.openjdk.java.net/~stefank/8151436/webrev/ > https://bugs.openjdk.java.net/browse/JDK-8151436 looks good. Thomas From stefan.karlsson at oracle.com Tue Mar 8 11:15:51 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 8 Mar 2016 12:15:51 +0100 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: <56DEB3FF.1020200@oracle.com> References: <56DEB3FF.1020200@oracle.com> Message-ID: <56DEB467.3040807@oracle.com> This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc-dev. Please reply to this mail to review this patch. StefanK On 2016-03-08 12:14, Stefan Karlsson wrote: > Hi all, > > Please review to fix include problems with the bitMap files. > > http://cr.openjdk.java.net/~stefank/8151440/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8151440 > > Some verification code in bitMap.inline.hpp is used from bitMap.hpp. > This adds a requirement that bitMap.inline.hpp always have to be > included when bitMap.hpp is included, otherwise the compiler will > complain. > > The patch fixes this by moving the verification/debugging code to the > cpp file, and the move some inlined functions from bitMap.hpp to > bitMap.inline.hpp. > > Thanks, > StefanK From thomas.schatzl at oracle.com Tue Mar 8 11:19:13 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Tue, 08 Mar 2016 12:19:13 +0100 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: <56DEB467.3040807@oracle.com> References: <56DEB3FF.1020200@oracle.com> <56DEB467.3040807@oracle.com> Message-ID: <1457435953.2272.11.camel@oracle.com> Hi, On Tue, 2016-03-08 at 12:15 +0100, Stefan Karlsson wrote: > This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc > -dev. > > Please reply to this mail to review this patch. > looks good. Thomas From martin.doerr at sap.com Tue Mar 8 11:33:01 2016 From: martin.doerr at sap.com (Doerr, Martin) Date: Tue, 8 Mar 2016 11:33:01 +0000 Subject: RFR(M) 8150353: PPC64LE: Support RTM on linux In-Reply-To: <56DDC5C7.3000105@oracle.com> References: <56CE0975.8060807@linux.vnet.ibm.com> <56CE42AE.7080605@oracle.com> <10c9a1cb6d9b40618a094283ac838038@DEWDFE13DE14.global.corp.sap> <56CFB72C.7030401@oracle.com> <56DDC5C7.3000105@oracle.com> Message-ID: Hi Vladimir, thanks for the explanation and for sponsoring the change. We have noticed that jbb2005 benefits from both, RTM stack locking (with RTM deopt) and from Biased Locking so we thought it would be nice to have both. But UseRTMForStackLocks is still experimental. Seems like there are plenty of things people could play with in the future. Best regards, Martin -----Original Message----- From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] Sent: Montag, 7. M?rz 2016 19:18 To: Doerr, Martin ; Gustavo Romero ; hotspot-dev at openjdk.java.net Cc: brenohl at br.ibm.com Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux RTM's assumption is: "RTM locking is most useful when there is high lock contention and low data contention. With high lock contention the lock is usually inflated and biased locking is not suitable for that case anyway." It is not the case with jbb2005. And that is why RTM is off by default. First RTM implementation used BiasedLocking bits in object's markword. Later it was implemented differently but there was still a concern that to make them work together we may need more changes. We thought that we will do that as separate project later. But currently we don't have a plan for doing this. Regards, Vladimir On 3/7/16 2:29 AM, Doerr, Martin wrote: > Hi Vladimir, > > thank you very much for the detailed analysis. > I hope an #ifdef PPC64 is ok in the shared code? > > I had written something to Gustavo about the performance problem we have with RTM in SPEC jbb2005: > >> The following issue is important for performance work: >> RTM does not work with BiasedLocking. The latter gets switched off if RTM is activated which has a large performance impact (especially in jbb2005). >> I would disable it for a reference measurement: >> -XX:-UseBiasedLocking >> >> Unfortunately, RTM was slower than BiasedLocking but faster than the reference (without both) which tells me that there's room for improvement. >> There are basically 3 classes of locks: >> 1. no contention >> 2. contention on lock, low contention on data >> 3. high contention on data >> >> I believe the optimal treatment for the cases would be: >> 1. Biased Locking >> 2. Transactional Memory >> 3. classical locking with lock inflating >> >> I think it would be good if the JVM could optimize for all these cases in the future. But that would add additional complexity and code size. > > Do you think this is something which should be improved in the future? > We could try e.g. the following approach > - try biased > - deoptimize if it doesn't work well, try transactional > - deoptimize if it doesn't work well, use classical locking (with inflating) > > Best regards, > Martin > > > -----Original Message----- > From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] > Sent: Freitag, 26. Februar 2016 03:24 > To: Doerr, Martin ; Gustavo Romero ; hotspot-dev at openjdk.java.net > Cc: brenohl at br.ibm.com > Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux > > The problem with increasing ScratchBufferBlob size is that with Tiered > compilation we scale number of compiler threads based on cpu count and > increase space in CodeCache accordingly: > > code_buffers_size += c2_count * C2Compiler::initial_code_buffer_size(); > > I did experiment on Intel setting ON all RTM flags which can increase > size of lock code: > > $ java -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions > -XX:+UseRTMLocking -XX:+UseRTMDeopt -XX:+UseRTMForStackLocks > -XX:+PrintPreciseRTMLockingStatistics -XX:+PrintFlagsFinal -version > |grep RTM > Java HotSpot(TM) 64-Bit Server VM warning: UseRTMLocking is only > available as experimental option on this platform. > bool PrintPreciseRTMLockingStatistics := true > {C2 diagnostic} > intx RTMAbortRatio = 50 > {ARCH experimental} > intx RTMAbortThreshold = 1000 > {ARCH experimental} > intx RTMLockingCalculationDelay = 0 > {ARCH experimental} > intx RTMLockingThreshold = 10000 > {ARCH experimental} > uintx RTMRetryCount = 5 > {ARCH product} > intx RTMSpinLoopCount = 100 > {ARCH experimental} > intx RTMTotalCountIncrRate = 64 > {ARCH experimental} > bool UseRTMDeopt := true > {ARCH product} > bool UseRTMForStackLocks := true > {ARCH experimental} > bool UseRTMLocking := true > {ARCH product} > bool UseRTMXendForLockBusy = true > {ARCH experimental} > > > I added next lines to the end of Compile::scratch_emit_size() method: > > if (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_FastLock) { > tty->print_cr("======== FastLock size: %d ==========", > buf.total_content_size()); > } > if (n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_FastUnlock) { > tty->print_cr("======== FastUnlock size: %d ==========", > buf.total_content_size()); > } > > and got: > > ======== FastLock size: 657 ========== > ======== FastUnlock size: 175 ========== > > Thanks, > Vladimir > > On 2/25/16 3:43 AM, Doerr, Martin wrote: >> Hi Vladimir, >> >> thanks for taking a look. >> >> About version values: >> We are using a similar scheme for version checks on AIX where we know that the version values are less than 256. >> It makes comparisons much more convenient. >> But I agree that we should double-check if it is guaranteed for linux as well (and possibly add an assertion). >> >> About scratch buffer size: >> We only noticed that the scratch buffer was too small when we enable all RTM features: >> -XX:+UnlockExperimentalVMOptions -XX:+UseRTMLocking -XX:+UseRTMForStackLocks -XX:+UseRTMDeopt >> We have only tried on PPC64, but I wonder if the current size is sufficient for x86. I currently don't have access to a Skylake machine. >> >> I think adding 1024 bytes to the scratch buffer doesn't hurt. >> (It may also lead to larger CodeBuffers in output.cpp but I don't think this is problematic as long as the real content gets copied to nmethods.) >> Would you agree? >> >> Best regards, >> Martin >> >> -----Original Message----- >> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] >> Sent: Donnerstag, 25. Februar 2016 00:54 >> To: Gustavo Romero ; Doerr, Martin ; hotspot-dev at openjdk.java.net >> Cc: brenohl at br.ibm.com >> Subject: Re: RFR(M) 8150353: PPC64LE: Support RTM on linux >> >> My concern (but I am not export) is Linux version encoding. Is it true >> that each value in x.y.z is less then 256? Why not keep them as separate >> int values? >> I also thought we have OS versions in make files but we check only gcc >> version there. >> >> Do you have problem with ScratchBufferBlob only on PPC or on some other >> platforms too? May be we should make MAX_inst_size as platform specific >> value. >> >> Thanks, >> Vladimir >> >> On 2/24/16 11:50 AM, Gustavo Romero wrote: >>> Hi Martin, >>> >>> Both little and big endian Linux kernel contain the syscall change, so >>> I did not include: >>> >>> #if defined(COMPILER2) && (defined(AIX) || defined(VM_LITTLE_ENDIAN) >>> >>> in globalDefinitions_ppc.hpp. >>> >>> Please, could you review the following change? >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8150353 >>> Webrev (hotspot): http://81.de.7a9f.ip4.static.sl-reverse.com/webrev/ >>> >>> Summary: >>> >>> * Enable RTM support for Linux on PPC64 (LE and BE). >>> * Fix C2 compiler buffer size issue. >>> >>> Thank you. >>> >>> Regards, >>> Gustavo >>> From per.liden at oracle.com Tue Mar 8 12:35:54 2016 From: per.liden at oracle.com (Per Liden) Date: Tue, 8 Mar 2016 13:35:54 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56DEAA7A.1000200@oracle.com> References: <56DEAA7A.1000200@oracle.com> Message-ID: <56DEC72A.6010102@oracle.com> Looks good! /Per On 2016-03-08 11:33, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove the state variables from > ArrayAllocator and make it an AllStatic class instead. The main > motivation for this patch is to cleanup the BitMaps data structure and > make the instances smaller. > > The patch builds on the fact that the current code invokes AllocateHeap > with the default value AllocFailEnum:EXIT_OOM, and therefore never > returns NULL. This means that use_malloc will never be reset and the > allocation strategy used (malloc or mmap) can be determined by simply > looking at the size input parameter. Instead of changing the code to use > AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the > current behavior so that we could cleanup and minimize the size of our > BitMaps. > > http://cr.openjdk.java.net/~stefank/8151436/webrev/ > https://bugs.openjdk.java.net/browse/JDK-8151436 > > Thanks, > StefanK From per.liden at oracle.com Tue Mar 8 12:37:37 2016 From: per.liden at oracle.com (Per Liden) Date: Tue, 8 Mar 2016 13:37:37 +0100 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: <56DEB467.3040807@oracle.com> References: <56DEB3FF.1020200@oracle.com> <56DEB467.3040807@oracle.com> Message-ID: <56DEC791.6040108@oracle.com> Looks good! /Per On 2016-03-08 12:15, Stefan Karlsson wrote: > This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc-dev. > > Please reply to this mail to review this patch. > > StefanK > > On 2016-03-08 12:14, Stefan Karlsson wrote: >> Hi all, >> >> Please review to fix include problems with the bitMap files. >> >> http://cr.openjdk.java.net/~stefank/8151440/webrev.00/ >> https://bugs.openjdk.java.net/browse/JDK-8151440 >> >> Some verification code in bitMap.inline.hpp is used from bitMap.hpp. >> This adds a requirement that bitMap.inline.hpp always have to be >> included when bitMap.hpp is included, otherwise the compiler will >> complain. >> >> The patch fixes this by moving the verification/debugging code to the >> cpp file, and the move some inlined functions from bitMap.hpp to >> bitMap.inline.hpp. >> >> Thanks, >> StefanK > From per.liden at oracle.com Tue Mar 8 12:38:42 2016 From: per.liden at oracle.com (Per Liden) Date: Tue, 8 Mar 2016 13:38:42 +0100 Subject: RFR: 8151439: Inline the BitMap constructor In-Reply-To: <56DEAEE0.5020708@oracle.com> References: <56DEAEE0.5020708@oracle.com> Message-ID: <56DEC7D2.3020108@oracle.com> Looks good! /Per On 2016-03-08 11:52, Stefan Karlsson wrote: > Hi all, > > Please review this patch to inline the BitMap constructor. This will > allow us to efficiently use temporary, stack-allocated BitMaps. > > http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8151439 > > A code example of why we want to inline the BitMap constructor: > void MyClass::set_bit(idx_t x) { > BitMap(&_bits, BitsPerWord).par_set_bit(x). > } > > We could have used an instance of a BitMap in MyClass, but that would > store both a bm_word_t* and the size of the bitmap storage in MyClass. > Since the size is a compile-time constant, we can use the above > construct to only store a bm_word_t field in MyClass, and thereby reduce > the size of MyClass. By inlining the constructor, we get rid of the > extra overhead of creating a BitMap. > > Thanks, > StefanK From paul.sandoz at oracle.com Tue Mar 8 13:06:37 2016 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 8 Mar 2016 14:06:37 +0100 Subject: RFR 8151163 All Buffer implementations should leverage Unsafe unaligned accessors Message-ID: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> Hi, Please pre-emptively review a fix to update the buffer implementations to leverage the Unsafe unaligned accessors: http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access/webrev/ http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access-hotspot/webrev/ The JDK changes depend on those for the following which is in CCC review: https://bugs.openjdk.java.net/browse/JDK-8149469 ByteBuffer API and implementation enhancements for VarHandles http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8149469-byte-buffer-align-and-unifying-enhancements/webrev/ The changes in this webrev take advantage of those for JDK-8149469 and apply the unsafe double addressing scheme so certain byte buffer view implementations can work across heap and direct buffers. This should improve the performance on x86 for: 1) direct ByteBuffers using the wider unit size method accessors; and 2) wider unit size views over heap ByteBuffers. As a consequence Bits.java has greatly reduced in size :-) The HotSpot changes update the test that was originally added when the heap ByteBuffer method accessors were updated to utilise unsafe unaligned access. I split the test out so as to reduce the execution time, since I doubled the amount of tests. These tests could be improved for views at various unaligned/unaligned positions in the byte buffer, but i left that for now. I plan to push through hs-comp since JDK-8149469 will go through hs-comp. Later on today i will kick of a JPRT hotspot test run. ? This is a small step towards unifying the buffer implementations using the unsafe double addressing scheme: https://bugs.openjdk.java.net/browse/JDK-6509032 Thanks, Paul. From aleksey.shipilev at oracle.com Tue Mar 8 13:37:39 2016 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Tue, 8 Mar 2016 16:37:39 +0300 Subject: RFR 8151163 All Buffer implementations should leverage Unsafe unaligned accessors In-Reply-To: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> References: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> Message-ID: <56DED5A3.8030603@oracle.com> On 03/08/2016 04:06 PM, Paul Sandoz wrote: > Please pre-emptively review a fix to update the buffer implementations to leverage the Unsafe unaligned accessors: > > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access/webrev/ *) My concern with using double-register Unsafe calls is that compilers are unable to speculate on (hb == null) value, which means you will have the additional field read on the fast path. See: https://bugs.openjdk.java.net/browse/JDK-8150921 http://cr.openjdk.java.net/~shade/8150921/notes.txt So, while I agree that using double-register unaligned accessors are cleaner, I'd try to special-case (bb.hb == null) case for Heap* buffers. Current patch might still be better than going through Bits though. > The changes in this webrev take advantage of those for JDK-8149469 > and apply the unsafe double addressing scheme so certain byte buffer > view implementations can work across heap and direct buffers. This > should improve the performance on x86 for: I understand the idea, but I think we would need to verify this before pushing. Thanks, -Aleksey From paul.sandoz at oracle.com Tue Mar 8 18:27:33 2016 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 8 Mar 2016 19:27:33 +0100 Subject: RFR 8151163 All Buffer implementations should leverage Unsafe unaligned accessors In-Reply-To: <56DED5A3.8030603@oracle.com> References: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> <56DED5A3.8030603@oracle.com> Message-ID: > On 8 Mar 2016, at 14:37, Aleksey Shipilev wrote: > > On 03/08/2016 04:06 PM, Paul Sandoz wrote: >> Please pre-emptively review a fix to update the buffer implementations to leverage the Unsafe unaligned accessors: >> >> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access/webrev/ > > *) My concern with using double-register Unsafe calls is that compilers > are unable to speculate on (hb == null) value, which means you will have > the additional field read on the fast path. See: > https://bugs.openjdk.java.net/browse/JDK-8150921 > http://cr.openjdk.java.net/~shade/8150921/notes.txt > > So, while I agree that using double-register unaligned accessors are > cleaner, I'd try to special-case (bb.hb == null) case for Heap* buffers. > Current patch might still be better than going through Bits though. > The fix is conservative. I did not change anything in direct buffer that currently uses the single addressing mode, that?s a much larger change of course, and as you point out requires deeper investigation. To clarify there are two kinds of change: 1) The access methods of direct ByteBuffer, such as getInt etc now use the unaligned accessors. Direct-X-Buffer-bin.java.template ? private $type$ get$Type$(long a) { - if (unaligned) { - $memtype$ x = unsafe.get$Memtype$(a); - return $fromBits$(nativeByteOrder ? x : Bits.swap(x)); - } - return Bits.get$Type$(a, bigEndian); + $memtype$ x = unsafe.get$Memtype$Unaligned(null, a, bigEndian); + return $fromBits$(x); } public $type$ get$Type$() { @@ -51,12 +48,8 @@ private ByteBuffer put$Type$(long a, $type$ x) { #if[rw] - if (unaligned) { - $memtype$ y = $toBits$(x); - unsafe.put$Memtype$(a, (nativeByteOrder ? y : Bits.swap(y))); - } else { - Bits.put$Type$(a, x, bigEndian); - } + $memtype$ y = $toBits$(x); + unsafe.put$Memtype$Unaligned(null, a, y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); Note the use of null here, so we should fine for this case. 2) Changes to the view implementations used by heap buffer for aligned and misaligned access and direct byte buffer for misaligned access. This is where we replace the singular call to bits: ByteBufferAs-X-Buffer.java.template ? public $type$ get() { - return Bits.get$Type$$BO$(bb, ix(nextGetIndex())); + $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, bb.address + ix(nextGetIndex()), + {#if[boB]?true:false}); + return $fromBits$(x); } public $type$ get(int i) { - return Bits.get$Type$$BO$(bb, ix(checkIndex(i))); + $memtype$ x = unsafe.get$Memtype$Unaligned(bb.hb, bb.address + ix(checkIndex(i)), + {#if[boB]?true:false}); + return $fromBits$(x); } This should be an improvement when used by heap ByteBuffer implementations, much the same way it was when previously changing the heap ByteBuffer accessors to use Unsafe unaligned access. So that leaves the direct ByteBuffer case: DirectByteBuffer ? public IntBuffer asIntBuffer() { int off = this.position(); int lim = this.limit(); assert (off <= lim); int rem = (off <= lim ? lim - off : 0); int size = rem >> 2; if (!unaligned && ((address + off) % (1 << 2) != 0)) { return (bigEndian ? (IntBuffer)(new ByteBufferAsIntBufferB(this, -1, 0, size, size, off)) : (IntBuffer)(new ByteBufferAsIntBufferL(this, -1, 0, size, size, off))); Specially the same implementations used by heap ByteBuffers are used here for misaligned view access. In this case it?s Bits (with N ByteBuffer.get/put calls + composition to/from the wider unit) vs. Unsafe unaligned access + field read of hb (which is null), where the latter Unsafe access might be an intrinsic. On x86 that should be a win. One goal here is to consistently use the Unsafe unaligned access to leverage any intrinsification now, or in the future, on other platforms e.g. SPARC. >> The changes in this webrev take advantage of those for JDK-8149469 >> and apply the unsafe double addressing scheme so certain byte buffer >> view implementations can work across heap and direct buffers. This >> should improve the performance on x86 for: > > I understand the idea, but I think we would need to verify this before > pushing. > Admittedly i am leaning on the rational/motivation for the previous changes to use Unsafe unaligned accessors. I less confident about the impact on non-x86 platforms. I have some VarHandles related benchmark code [*] i can use to get some numbers. Paul. [*] But getting side-tracked with a VH perf regressions i observed when running the test, something has changed underneath me in hs-comp that is causing the linkage to not wire up optimally :-( From kim.barrett at oracle.com Tue Mar 8 19:31:46 2016 From: kim.barrett at oracle.com (Kim Barrett) Date: Tue, 8 Mar 2016 14:31:46 -0500 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56DEAA7A.1000200@oracle.com> References: <56DEAA7A.1000200@oracle.com> Message-ID: <81BAD17B-729E-4591-9073-1D3579DF4439@oracle.com> > On Mar 8, 2016, at 5:33 AM, Stefan Karlsson wrote: > > Hi all, > > Please review this patch to remove the state variables from ArrayAllocator and make it an AllStatic class instead. The main motivation for this patch is to cleanup the BitMaps data structure and make the instances smaller. > > The patch builds on the fact that the current code invokes AllocateHeap with the default value AllocFailEnum:EXIT_OOM, and therefore never returns NULL. This means that use_malloc will never be reset and the allocation strategy used (malloc or mmap) can be determined by simply looking at the size input parameter. Instead of changing the code to use AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the current behavior so that we could cleanup and minimize the size of our BitMaps. > > http://cr.openjdk.java.net/~stefank/8151436/webrev/ > https://bugs.openjdk.java.net/browse/JDK-8151436 > > Thanks, > StefanK Looks good. From kim.barrett at oracle.com Tue Mar 8 19:32:24 2016 From: kim.barrett at oracle.com (Kim Barrett) Date: Tue, 8 Mar 2016 14:32:24 -0500 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: <56DEB467.3040807@oracle.com> References: <56DEB3FF.1020200@oracle.com> <56DEB467.3040807@oracle.com> Message-ID: > On Mar 8, 2016, at 6:15 AM, Stefan Karlsson wrote: > > This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc-dev. > > Please reply to this mail to review this patch. > > StefanK > > On 2016-03-08 12:14, Stefan Karlsson wrote: >> Hi all, >> >> Please review to fix include problems with the bitMap files. >> >> http://cr.openjdk.java.net/~stefank/8151440/webrev.00/ >> https://bugs.openjdk.java.net/browse/JDK-8151440 >> >> Some verification code in bitMap.inline.hpp is used from bitMap.hpp. This adds a requirement that bitMap.inline.hpp always have to be included when bitMap.hpp is included, otherwise the compiler will complain. >> >> The patch fixes this by moving the verification/debugging code to the cpp file, and the move some inlined functions from bitMap.hpp to bitMap.inline.hpp. >> >> Thanks, >> StefanK Looks good. From kim.barrett at oracle.com Tue Mar 8 19:39:02 2016 From: kim.barrett at oracle.com (Kim Barrett) Date: Tue, 8 Mar 2016 14:39:02 -0500 Subject: RFR: 8151439: Inline the BitMap constructor In-Reply-To: <56DEAEE0.5020708@oracle.com> References: <56DEAEE0.5020708@oracle.com> Message-ID: > On Mar 8, 2016, at 5:52 AM, Stefan Karlsson wrote: > > Hi all, > > Please review this patch to inline the BitMap constructor. This will allow us to efficiently use temporary, stack-allocated BitMaps. > > http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ > https://bugs.openjdk.java.net/browse/JDK-8151439 > > A code example of why we want to inline the BitMap constructor: > void MyClass::set_bit(idx_t x) { > BitMap(&_bits, BitsPerWord).par_set_bit(x). > } > > We could have used an instance of a BitMap in MyClass, but that would store both a bm_word_t* and the size of the bitmap storage in MyClass. Since the size is a compile-time constant, we can use the above construct to only store a bm_word_t field in MyClass, and thereby reduce the size of MyClass. By inlining the constructor, we get rid of the extra overhead of creating a BitMap. > > Thanks, > StefanK Looks good. ------------------------------------------------------------------------------ src/share/vm/utilities/bitMap.cpp 37 assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption."); This assert can be removed too, due to the new STATIC_ASSERT. ------------------------------------------------------------------------------ From dmitry.dmitriev at oracle.com Wed Mar 9 10:58:03 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 9 Mar 2016 13:58:03 +0300 Subject: RFR(XS): 8151304: Remove unused develop options(ClearInterpreterLocals and others) Message-ID: <56E001BB.1050300@oracle.com> Hello, Please, review this small patch which removes 4 unused develop options. Code for these options was removed some time ago(additional details can be found in the JBS). JBS: https://bugs.openjdk.java.net/browse/JDK-8151304 webrev.00: http://cr.openjdk.java.net/~ddmitriev/8151304/webrev.00/ Testing: jprt Thanks, Dmitry From stefan.karlsson at oracle.com Wed Mar 9 11:36:55 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:36:55 +0100 Subject: RFR: 8151439: Inline the BitMap constructor In-Reply-To: <1457435384.2272.9.camel@oracle.com> References: <56DEAEE0.5020708@oracle.com> <1457435384.2272.9.camel@oracle.com> Message-ID: <56E00AD7.3050200@oracle.com> Thanks, Thomas. StefanK On 2016-03-08 12:09, Thomas Schatzl wrote: > Hi Stefan, > > On Tue, 2016-03-08 at 11:52 +0100, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to inline the BitMap constructor. This will >> allow us to efficiently use temporary, stack-allocated BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ >> https://bugs.openjdk.java.net/browse/JDK-8151439 >> >> A code example of why we want to inline the BitMap constructor: >> void MyClass::set_bit(idx_t x) { >> BitMap(&_bits, BitsPerWord).par_set_bit(x). >> } >> >> We could have used an instance of a BitMap in MyClass, but that would >> store both a bm_word_t* and the size of the bitmap storage in >> MyClass. >> Since the size is a compile-time constant, we can use the above >> construct to only store a bm_word_t field in MyClass, and thereby >> reduce >> the size of MyClass. By inlining the constructor, we get rid of the >> extra overhead of creating a BitMap. > looks good. > > Thanks, > Thomas From stefan.karlsson at oracle.com Wed Mar 9 11:37:12 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:37:12 +0100 Subject: RFR: 8151439: Inline the BitMap constructor In-Reply-To: <56DEC7D2.3020108@oracle.com> References: <56DEAEE0.5020708@oracle.com> <56DEC7D2.3020108@oracle.com> Message-ID: <56E00AE8.5010807@oracle.com> Thanks, Per. StefanK On 2016-03-08 13:38, Per Liden wrote: > Looks good! > > /Per > > On 2016-03-08 11:52, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to inline the BitMap constructor. This will >> allow us to efficiently use temporary, stack-allocated BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ >> https://bugs.openjdk.java.net/browse/JDK-8151439 >> >> A code example of why we want to inline the BitMap constructor: >> void MyClass::set_bit(idx_t x) { >> BitMap(&_bits, BitsPerWord).par_set_bit(x). >> } >> >> We could have used an instance of a BitMap in MyClass, but that would >> store both a bm_word_t* and the size of the bitmap storage in MyClass. >> Since the size is a compile-time constant, we can use the above >> construct to only store a bm_word_t field in MyClass, and thereby reduce >> the size of MyClass. By inlining the constructor, we get rid of the >> extra overhead of creating a BitMap. >> >> Thanks, >> StefanK From stefan.karlsson at oracle.com Wed Mar 9 11:37:40 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:37:40 +0100 Subject: RFR: 8151439: Inline the BitMap constructor In-Reply-To: References: <56DEAEE0.5020708@oracle.com> Message-ID: <56E00B04.7020807@oracle.com> On 2016-03-08 20:39, Kim Barrett wrote: >> On Mar 8, 2016, at 5:52 AM, Stefan Karlsson wrote: >> >> Hi all, >> >> Please review this patch to inline the BitMap constructor. This will allow us to efficiently use temporary, stack-allocated BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151439/webrev.00/ >> https://bugs.openjdk.java.net/browse/JDK-8151439 >> >> A code example of why we want to inline the BitMap constructor: >> void MyClass::set_bit(idx_t x) { >> BitMap(&_bits, BitsPerWord).par_set_bit(x). >> } >> >> We could have used an instance of a BitMap in MyClass, but that would store both a bm_word_t* and the size of the bitmap storage in MyClass. Since the size is a compile-time constant, we can use the above construct to only store a bm_word_t field in MyClass, and thereby reduce the size of MyClass. By inlining the constructor, we get rid of the extra overhead of creating a BitMap. >> >> Thanks, >> StefanK > Looks good. Thanks. > > ------------------------------------------------------------------------------ > src/share/vm/utilities/bitMap.cpp > 37 assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption."); > > This assert can be removed too, due to the new STATIC_ASSERT. > > ------------------------------------------------------------------------------ > I'll remove this before pushing. StefanK From stefan.karlsson at oracle.com Wed Mar 9 11:38:26 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:38:26 +0100 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: <1457435953.2272.11.camel@oracle.com> References: <56DEB3FF.1020200@oracle.com> <56DEB467.3040807@oracle.com> <1457435953.2272.11.camel@oracle.com> Message-ID: <56E00B32.1010003@oracle.com> Thanks, Thomas. StefanK On 2016-03-08 12:19, Thomas Schatzl wrote: > Hi, > > On Tue, 2016-03-08 at 12:15 +0100, Stefan Karlsson wrote: >> This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc >> -dev. >> >> Please reply to this mail to review this patch. >> > looks good. > > Thomas From stefan.karlsson at oracle.com Wed Mar 9 11:38:40 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:38:40 +0100 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: <56DEC791.6040108@oracle.com> References: <56DEB3FF.1020200@oracle.com> <56DEB467.3040807@oracle.com> <56DEC791.6040108@oracle.com> Message-ID: <56E00B40.5010500@oracle.com> Thanks, Per. StefanK On 2016-03-08 13:37, Per Liden wrote: > Looks good! > > /Per > > On 2016-03-08 12:15, Stefan Karlsson wrote: >> This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc-dev. >> >> Please reply to this mail to review this patch. >> >> StefanK >> >> On 2016-03-08 12:14, Stefan Karlsson wrote: >>> Hi all, >>> >>> Please review to fix include problems with the bitMap files. >>> >>> http://cr.openjdk.java.net/~stefank/8151440/webrev.00/ >>> https://bugs.openjdk.java.net/browse/JDK-8151440 >>> >>> Some verification code in bitMap.inline.hpp is used from bitMap.hpp. >>> This adds a requirement that bitMap.inline.hpp always have to be >>> included when bitMap.hpp is included, otherwise the compiler will >>> complain. >>> >>> The patch fixes this by moving the verification/debugging code to the >>> cpp file, and the move some inlined functions from bitMap.hpp to >>> bitMap.inline.hpp. >>> >>> Thanks, >>> StefanK >> From stefan.karlsson at oracle.com Wed Mar 9 11:38:53 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:38:53 +0100 Subject: RFR: 8151440: Move BitMap verfication inline functions out from bitMap.hpp In-Reply-To: References: <56DEB3FF.1020200@oracle.com> <56DEB467.3040807@oracle.com> Message-ID: <56E00B4D.4090808@oracle.com> Thanks, Kim. StefanK On 2016-03-08 20:32, Kim Barrett wrote: >> On Mar 8, 2016, at 6:15 AM, Stefan Karlsson wrote: >> >> This was intended to go to the hotspot-dev list. BCC:ing hotspot-gc-dev. >> >> Please reply to this mail to review this patch. >> >> StefanK >> >> On 2016-03-08 12:14, Stefan Karlsson wrote: >>> Hi all, >>> >>> Please review to fix include problems with the bitMap files. >>> >>> http://cr.openjdk.java.net/~stefank/8151440/webrev.00/ >>> https://bugs.openjdk.java.net/browse/JDK-8151440 >>> >>> Some verification code in bitMap.inline.hpp is used from bitMap.hpp. This adds a requirement that bitMap.inline.hpp always have to be included when bitMap.hpp is included, otherwise the compiler will complain. >>> >>> The patch fixes this by moving the verification/debugging code to the cpp file, and the move some inlined functions from bitMap.hpp to bitMap.inline.hpp. >>> >>> Thanks, >>> StefanK > Looks good. > From stefan.karlsson at oracle.com Wed Mar 9 11:39:11 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:39:11 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <1457435455.2272.10.camel@oracle.com> References: <56DEAA7A.1000200@oracle.com> <1457435455.2272.10.camel@oracle.com> Message-ID: <56E00B5F.2040504@oracle.com> Thanks, Thomas. StefanK On 2016-03-08 12:10, Thomas Schatzl wrote: > Hi Stefan, > > On Tue, 2016-03-08 at 11:33 +0100, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove the state variables from >> ArrayAllocator and make it an AllStatic class instead. The main >> motivation for this patch is to cleanup the BitMaps data structure >> and >> make the instances smaller. >> >> The patch builds on the fact that the current code invokes >> AllocateHeap >> with the default value AllocFailEnum:EXIT_OOM, and therefore never >> returns NULL. This means that use_malloc will never be reset and the >> allocation strategy used (malloc or mmap) can be determined by simply >> looking at the size input parameter. Instead of changing the code to >> use >> AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the >> current behavior so that we could cleanup and minimize the size of >> our >> BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151436/webrev/ >> https://bugs.openjdk.java.net/browse/JDK-8151436 > looks good. > > Thomas > From stefan.karlsson at oracle.com Wed Mar 9 11:39:24 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:39:24 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56DEC72A.6010102@oracle.com> References: <56DEAA7A.1000200@oracle.com> <56DEC72A.6010102@oracle.com> Message-ID: <56E00B6C.4030505@oracle.com> Thanks, Per. StefanK On 2016-03-08 13:35, Per Liden wrote: > Looks good! > > /Per > > On 2016-03-08 11:33, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove the state variables from >> ArrayAllocator and make it an AllStatic class instead. The main >> motivation for this patch is to cleanup the BitMaps data structure and >> make the instances smaller. >> >> The patch builds on the fact that the current code invokes AllocateHeap >> with the default value AllocFailEnum:EXIT_OOM, and therefore never >> returns NULL. This means that use_malloc will never be reset and the >> allocation strategy used (malloc or mmap) can be determined by simply >> looking at the size input parameter. Instead of changing the code to use >> AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the >> current behavior so that we could cleanup and minimize the size of our >> BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151436/webrev/ >> https://bugs.openjdk.java.net/browse/JDK-8151436 >> >> Thanks, >> StefanK From stefan.karlsson at oracle.com Wed Mar 9 11:39:37 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 12:39:37 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <81BAD17B-729E-4591-9073-1D3579DF4439@oracle.com> References: <56DEAA7A.1000200@oracle.com> <81BAD17B-729E-4591-9073-1D3579DF4439@oracle.com> Message-ID: <56E00B79.9080602@oracle.com> Thanks, Kim. StefanK On 2016-03-08 20:31, Kim Barrett wrote: >> On Mar 8, 2016, at 5:33 AM, Stefan Karlsson wrote: >> >> Hi all, >> >> Please review this patch to remove the state variables from ArrayAllocator and make it an AllStatic class instead. The main motivation for this patch is to cleanup the BitMaps data structure and make the instances smaller. >> >> The patch builds on the fact that the current code invokes AllocateHeap with the default value AllocFailEnum:EXIT_OOM, and therefore never returns NULL. This means that use_malloc will never be reset and the allocation strategy used (malloc or mmap) can be determined by simply looking at the size input parameter. Instead of changing the code to use AllocateHeap with AllocFailEnum::RETURN_NULL, I chose to keep the current behavior so that we could cleanup and minimize the size of our BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151436/webrev/ >> https://bugs.openjdk.java.net/browse/JDK-8151436 >> >> Thanks, >> StefanK > Looks good. > From jesper.wilhelmsson at oracle.com Wed Mar 9 13:12:46 2016 From: jesper.wilhelmsson at oracle.com (Jesper Wilhelmsson) Date: Wed, 9 Mar 2016 14:12:46 +0100 Subject: RFR(XS): 8151304: Remove unused develop options(ClearInterpreterLocals and others) In-Reply-To: <56E001BB.1050300@oracle.com> References: <56E001BB.1050300@oracle.com> Message-ID: <56E0214E.8050206@oracle.com> Looks good! /Jesper Den 9/3/16 kl. 11:58, skrev Dmitry Dmitriev: > Hello, > > Please, review this small patch which removes 4 unused develop options. Code for > these options was removed some time ago(additional details can be found in the > JBS). > > JBS: https://bugs.openjdk.java.net/browse/JDK-8151304 > webrev.00: http://cr.openjdk.java.net/~ddmitriev/8151304/webrev.00/ > > Testing: jprt > > Thanks, > Dmitry From coleen.phillimore at oracle.com Wed Mar 9 13:20:52 2016 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Wed, 9 Mar 2016 08:20:52 -0500 Subject: RFR(XS): 8151304: Remove unused develop options(ClearInterpreterLocals and others) In-Reply-To: <56E0214E.8050206@oracle.com> References: <56E001BB.1050300@oracle.com> <56E0214E.8050206@oracle.com> Message-ID: <56E02334.90304@oracle.com> Looks good! Coleen On 3/9/16 8:12 AM, Jesper Wilhelmsson wrote: > Looks good! > /Jesper > > Den 9/3/16 kl. 11:58, skrev Dmitry Dmitriev: >> Hello, >> >> Please, review this small patch which removes 4 unused develop >> options. Code for >> these options was removed some time ago(additional details can be >> found in the >> JBS). >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8151304 >> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8151304/webrev.00/ >> >> Testing: jprt >> >> Thanks, >> Dmitry From stefan.karlsson at oracle.com Wed Mar 9 14:28:02 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 15:28:02 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56DEAA7A.1000200@oracle.com> References: <56DEAA7A.1000200@oracle.com> Message-ID: <56E032F2.4050405@oracle.com> Hi all, I found a bug in the ArrayAllocator code. ArrayAllocator::free incorrectly calls should_use_malloc(size_for_malloc(length)) when the call should be should_use_malloc(length). There is an -XX:+ExecuteInternalVMTests that exercises this code path, and try to find these kinds of bugs. The test actually manages to call allocate_malloc and then tries to free the memory with free_mmap, but the JVM doesn't crash. One reason why it doesn't crash is that os::release_memory, which is used by free_mmap, fails to unmap the malloced memory and we silently ignores that. This patch: 1) Adds an assert to ensure that the os::release_memory call succeeds. This immediately shows the problem when we execute our internal vm tests. 2) Moves the implementation of should_use_malloc to the inline file, so that it can reuse size_for_malloc. 3) Fix the bug. http://cr.openjdk.java.net/~stefank/8151436/webrev.01.delta/ http://cr.openjdk.java.net/~stefank/8151436/webrev.01/ Thanks, StefanK On 2016-03-08 11:33, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove the state variables from > ArrayAllocator and make it an AllStatic class instead. The main > motivation for this patch is to cleanup the BitMaps data structure and > make the instances smaller. > > The patch builds on the fact that the current code invokes > AllocateHeap with the default value AllocFailEnum:EXIT_OOM, and > therefore never returns NULL. This means that use_malloc will never be > reset and the allocation strategy used (malloc or mmap) can be > determined by simply looking at the size input parameter. Instead of > changing the code to use AllocateHeap with AllocFailEnum::RETURN_NULL, > I chose to keep the current behavior so that we could cleanup and > minimize the size of our BitMaps. > > http://cr.openjdk.java.net/~stefank/8151436/webrev/ > https://bugs.openjdk.java.net/browse/JDK-8151436 > > Thanks, > StefanK From dmitry.dmitriev at oracle.com Wed Mar 9 15:21:40 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 9 Mar 2016 18:21:40 +0300 Subject: RFR(XS): 8151304: Remove unused develop options(ClearInterpreterLocals and others) In-Reply-To: <56E0214E.8050206@oracle.com> References: <56E001BB.1050300@oracle.com> <56E0214E.8050206@oracle.com> Message-ID: <56E03F84.9070600@oracle.com> Jesper, thank you for the review! Dmitry On 09.03.2016 16:12, Jesper Wilhelmsson wrote: > Looks good! > /Jesper > > Den 9/3/16 kl. 11:58, skrev Dmitry Dmitriev: >> Hello, >> >> Please, review this small patch which removes 4 unused develop >> options. Code for >> these options was removed some time ago(additional details can be >> found in the >> JBS). >> >> JBS: https://bugs.openjdk.java.net/browse/JDK-8151304 >> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8151304/webrev.00/ >> >> Testing: jprt >> >> Thanks, >> Dmitry From dmitry.dmitriev at oracle.com Wed Mar 9 15:22:34 2016 From: dmitry.dmitriev at oracle.com (Dmitry Dmitriev) Date: Wed, 9 Mar 2016 18:22:34 +0300 Subject: RFR(XS): 8151304: Remove unused develop options(ClearInterpreterLocals and others) In-Reply-To: <56E02334.90304@oracle.com> References: <56E001BB.1050300@oracle.com> <56E0214E.8050206@oracle.com> <56E02334.90304@oracle.com> Message-ID: <56E03FBA.6050903@oracle.com> Coleen, thank you for the review! Dmitry On 09.03.2016 16:20, Coleen Phillimore wrote: > Looks good! > Coleen > > On 3/9/16 8:12 AM, Jesper Wilhelmsson wrote: >> Looks good! >> /Jesper >> >> Den 9/3/16 kl. 11:58, skrev Dmitry Dmitriev: >>> Hello, >>> >>> Please, review this small patch which removes 4 unused develop >>> options. Code for >>> these options was removed some time ago(additional details can be >>> found in the >>> JBS). >>> >>> JBS: https://bugs.openjdk.java.net/browse/JDK-8151304 >>> webrev.00: http://cr.openjdk.java.net/~ddmitriev/8151304/webrev.00/ >>> >>> Testing: jprt >>> >>> Thanks, >>> Dmitry > From per.liden at oracle.com Wed Mar 9 15:26:42 2016 From: per.liden at oracle.com (Per Liden) Date: Wed, 9 Mar 2016 16:26:42 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56E032F2.4050405@oracle.com> References: <56DEAA7A.1000200@oracle.com> <56E032F2.4050405@oracle.com> Message-ID: <56E040B2.3070605@oracle.com> On 2016-03-09 15:28, Stefan Karlsson wrote: > Hi all, > > I found a bug in the ArrayAllocator code. ArrayAllocator::free > incorrectly calls should_use_malloc(size_for_malloc(length)) when the > call should be should_use_malloc(length). > > There is an -XX:+ExecuteInternalVMTests that exercises this code path, > and try to find these kinds of bugs. The test actually manages to call > allocate_malloc and then tries to free the memory with free_mmap, but > the JVM doesn't crash. One reason why it doesn't crash is that > os::release_memory, which is used by free_mmap, fails to unmap the > malloced memory and we silently ignores that. > > This patch: > 1) Adds an assert to ensure that the os::release_memory call succeeds. > This immediately shows the problem when we execute our internal vm tests. > 2) Moves the implementation of should_use_malloc to the inline file, so > that it can reuse size_for_malloc. > 3) Fix the bug. > > http://cr.openjdk.java.net/~stefank/8151436/webrev.01.delta/ > http://cr.openjdk.java.net/~stefank/8151436/webrev.01/ Looks good. /Per > > Thanks, > StefanK > > On 2016-03-08 11:33, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove the state variables from >> ArrayAllocator and make it an AllStatic class instead. The main >> motivation for this patch is to cleanup the BitMaps data structure and >> make the instances smaller. >> >> The patch builds on the fact that the current code invokes >> AllocateHeap with the default value AllocFailEnum:EXIT_OOM, and >> therefore never returns NULL. This means that use_malloc will never be >> reset and the allocation strategy used (malloc or mmap) can be >> determined by simply looking at the size input parameter. Instead of >> changing the code to use AllocateHeap with AllocFailEnum::RETURN_NULL, >> I chose to keep the current behavior so that we could cleanup and >> minimize the size of our BitMaps. >> >> http://cr.openjdk.java.net/~stefank/8151436/webrev/ >> https://bugs.openjdk.java.net/browse/JDK-8151436 >> >> Thanks, >> StefanK > From stefan.karlsson at oracle.com Wed Mar 9 15:50:33 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 16:50:33 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56E040B2.3070605@oracle.com> References: <56DEAA7A.1000200@oracle.com> <56E032F2.4050405@oracle.com> <56E040B2.3070605@oracle.com> Message-ID: <56E04649.8060301@oracle.com> Thanks, Per. StefanK On 2016-03-09 16:26, Per Liden wrote: > On 2016-03-09 15:28, Stefan Karlsson wrote: >> Hi all, >> >> I found a bug in the ArrayAllocator code. ArrayAllocator::free >> incorrectly calls should_use_malloc(size_for_malloc(length)) when the >> call should be should_use_malloc(length). >> >> There is an -XX:+ExecuteInternalVMTests that exercises this code path, >> and try to find these kinds of bugs. The test actually manages to call >> allocate_malloc and then tries to free the memory with free_mmap, but >> the JVM doesn't crash. One reason why it doesn't crash is that >> os::release_memory, which is used by free_mmap, fails to unmap the >> malloced memory and we silently ignores that. >> >> This patch: >> 1) Adds an assert to ensure that the os::release_memory call succeeds. >> This immediately shows the problem when we execute our internal vm >> tests. >> 2) Moves the implementation of should_use_malloc to the inline file, so >> that it can reuse size_for_malloc. >> 3) Fix the bug. >> >> http://cr.openjdk.java.net/~stefank/8151436/webrev.01.delta/ >> http://cr.openjdk.java.net/~stefank/8151436/webrev.01/ > > Looks good. > > /Per > >> >> Thanks, >> StefanK >> >> On 2016-03-08 11:33, Stefan Karlsson wrote: >>> Hi all, >>> >>> Please review this patch to remove the state variables from >>> ArrayAllocator and make it an AllStatic class instead. The main >>> motivation for this patch is to cleanup the BitMaps data structure and >>> make the instances smaller. >>> >>> The patch builds on the fact that the current code invokes >>> AllocateHeap with the default value AllocFailEnum:EXIT_OOM, and >>> therefore never returns NULL. This means that use_malloc will never be >>> reset and the allocation strategy used (malloc or mmap) can be >>> determined by simply looking at the size input parameter. Instead of >>> changing the code to use AllocateHeap with AllocFailEnum::RETURN_NULL, >>> I chose to keep the current behavior so that we could cleanup and >>> minimize the size of our BitMaps. >>> >>> http://cr.openjdk.java.net/~stefank/8151436/webrev/ >>> https://bugs.openjdk.java.net/browse/JDK-8151436 >>> >>> Thanks, >>> StefanK >> From thomas.schatzl at oracle.com Wed Mar 9 15:56:39 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Wed, 09 Mar 2016 16:56:39 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <56E032F2.4050405@oracle.com> References: <56DEAA7A.1000200@oracle.com> <56E032F2.4050405@oracle.com> Message-ID: <1457538999.2275.47.camel@oracle.com> Hi, On Wed, 2016-03-09 at 15:28 +0100, Stefan Karlsson wrote: > Hi all, > > I found a bug in the ArrayAllocator code. ArrayAllocator::free > incorrectly calls should_use_malloc(size_for_malloc(length)) when the > call should be should_use_malloc(length). > > There is an -XX:+ExecuteInternalVMTests that exercises this code > path, > and try to find these kinds of bugs. The test actually manages to > call > allocate_malloc and then tries to free the memory with free_mmap, but > the JVM doesn't crash. One reason why it doesn't crash is that > os::release_memory, which is used by free_mmap, fails to unmap the > malloced memory and we silently ignores that. > > This patch: > 1) Adds an assert to ensure that the os::release_memory call > succeeds. > This immediately shows the problem when we execute our internal vm > tests. > 2) Moves the implementation of should_use_malloc to the inline file, > so > that it can reuse size_for_malloc. > 3) Fix the bug. > > http://cr.openjdk.java.net/~stefank/8151436/webrev.01.delta/ > http://cr.openjdk.java.net/~stefank/8151436/webrev.01/ looks good. Thomas From stefan.karlsson at oracle.com Wed Mar 9 15:58:43 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 16:58:43 +0100 Subject: RFR: 8151436: Leaner ArrayAllocator and BitMaps In-Reply-To: <1457538999.2275.47.camel@oracle.com> References: <56DEAA7A.1000200@oracle.com> <56E032F2.4050405@oracle.com> <1457538999.2275.47.camel@oracle.com> Message-ID: <56E04833.9030809@oracle.com> Thanks, Thomas. StefanK On 2016-03-09 16:56, Thomas Schatzl wrote: > Hi, > > On Wed, 2016-03-09 at 15:28 +0100, Stefan Karlsson wrote: >> Hi all, >> >> I found a bug in the ArrayAllocator code. ArrayAllocator::free >> incorrectly calls should_use_malloc(size_for_malloc(length)) when the >> call should be should_use_malloc(length). >> >> There is an -XX:+ExecuteInternalVMTests that exercises this code >> path, >> and try to find these kinds of bugs. The test actually manages to >> call >> allocate_malloc and then tries to free the memory with free_mmap, but >> the JVM doesn't crash. One reason why it doesn't crash is that >> os::release_memory, which is used by free_mmap, fails to unmap the >> malloced memory and we silently ignores that. >> >> This patch: >> 1) Adds an assert to ensure that the os::release_memory call >> succeeds. >> This immediately shows the problem when we execute our internal vm >> tests. >> 2) Moves the implementation of should_use_malloc to the inline file, >> so >> that it can reuse size_for_malloc. >> 3) Fix the bug. >> >> http://cr.openjdk.java.net/~stefank/8151436/webrev.01.delta/ >> http://cr.openjdk.java.net/~stefank/8151436/webrev.01/ > looks good. > > Thomas > From stefan.karlsson at oracle.com Wed Mar 9 16:25:07 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 17:25:07 +0100 Subject: RFR: 8151534: Refactor ArrayAllocator for easier reuse Message-ID: <56E04E63.9050405@oracle.com> Hi all, Please review this patch to refactor the ArrayAllocator code. http://cr.openjdk.java.net/~stefank/8151534/webrev.00 https://bugs.openjdk.java.net/browse/JDK-8151534 ArrayAllocator is used to either allocate an array with malloc or mmap. This patch extracts the allocation code into two separate classes: MmapArrayAllocator and MallocArrayAllocator. ArrayAllocator will dispatch to one of these classes depending on the size of the allocation. The main motivation for this patch is to allow the fix for JDK-8077144 to reuse the code in MmapArrayAllocator. Thanks, StefanK From stefan.karlsson at oracle.com Wed Mar 9 16:44:19 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 17:44:19 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures Message-ID: <56E052E3.2040209@oracle.com> Hi all, Please review this patch to remove a bunch of redundant AlwaysTrueClosure classes. http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8151539 I've created an overloaded JNIHandles::weak_oops_do that uses its own AlwaysTrueClosure classes. This way callers of JNIHandles::weak_oops_do, that don't want to filter out any oops, can call the overloaded version without providing an instance of BoolObjectClosure. Thanks, StefanK From matthias.baesken at sap.com Wed Mar 9 17:01:07 2016 From: matthias.baesken at sap.com (Baesken, Matthias) Date: Wed, 9 Mar 2016 17:01:07 +0000 Subject: jdk9 : forcing inlining in src/share/vm/oops/instanceKlass.inline.hpp for xlc Message-ID: <63dad1e5ed7945439306b95a7ac48571@DEWDFE13DE02.global.corp.sap> Hello , CR 8075955: "Replace the macro based implementation of oop_oop_iterate with a template based solution" changed src/share/vm/oops/instanceKlass.inline.hpp and replaced macro based oop iteration by templates. For performance reason, the change (and a follow up change for Oracle Studio) introduced forcing of inlining for some places in src/share/vm/oops/instanceKlass.inline.hpp , see http://hg.openjdk.java.net/jdk9/dev/hotspot/file/797e6aac6d53/src/share/vm/oops/instanceKlass.inline.hpp .... // The iteration over the oops in objects is a hot path in the GC code. // By force inlining the following functions, we get similar GC performance // as the previous macro based implementation. #ifdef TARGET_COMPILER_visCPP #define INLINE __forceinline #elif defined(TARGET_COMPILER_sparcWorks) #define INLINE __attribute__((always_inline)) #else #define INLINE inline #endif .... (which is compiler dependent) Should we do this for the AIX port too ? http://www.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/language_ref/function_attributes.html?lang=en describes the function attributes of xlc which can be used. Diff to instanceKlass.inline.hpp : 43,44d42 < #elif defined(TARGET_COMPILER_xlc) < #define INLINE __attribute__((always_inline)) Regards, Matthias From mikael.gerdin at oracle.com Wed Mar 9 19:39:56 2016 From: mikael.gerdin at oracle.com (Mikael Gerdin) Date: Wed, 9 Mar 2016 20:39:56 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E052E3.2040209@oracle.com> References: <56E052E3.2040209@oracle.com> Message-ID: <56E07C0C.5000804@oracle.com> Hi Stefan, On 2016-03-09 17:44, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove a bunch of redundant > AlwaysTrueClosure classes. > > http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ There is still 2128 // This should be moved to the shared markSweep code! 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { 2130 public: 2131 bool do_object_b(oop p) { return true; } 2132 }; 2133 static PSAlwaysTrueClosure always_true; in psParallelCompact.cpp Otherwise the change looks good, I don't need to see an updated webrev. /Mikael > https://bugs.openjdk.java.net/browse/JDK-8151539 > > I've created an overloaded JNIHandles::weak_oops_do that uses its own > AlwaysTrueClosure classes. This way callers of JNIHandles::weak_oops_do, > that don't want to filter out any oops, can call the overloaded version > without providing an instance of BoolObjectClosure. > > Thanks, > StefanK From stefan.karlsson at oracle.com Wed Mar 9 20:01:27 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 21:01:27 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E07C0C.5000804@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> Message-ID: <56E08117.1090706@oracle.com> Hi Mikael, On 2016-03-09 20:39, Mikael Gerdin wrote: > Hi Stefan, > > On 2016-03-09 17:44, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove a bunch of redundant >> AlwaysTrueClosure classes. >> >> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ > > There is still > 2128 // This should be moved to the shared markSweep code! > 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { > 2130 public: > 2131 bool do_object_b(oop p) { return true; } > 2132 }; > 2133 static PSAlwaysTrueClosure always_true; > in psParallelCompact.cpp > > Otherwise the change looks good, I don't need to see an updated webrev. Great that you saw this! I've uploaded a new webrev, to make it easier for the second reviewer: http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ Thanks, StefanK > > /Mikael > >> https://bugs.openjdk.java.net/browse/JDK-8151539 >> >> I've created an overloaded JNIHandles::weak_oops_do that uses its own >> AlwaysTrueClosure classes. This way callers of JNIHandles::weak_oops_do, >> that don't want to filter out any oops, can call the overloaded version >> without providing an instance of BoolObjectClosure. >> >> Thanks, >> StefanK From thomas.schatzl at oracle.com Wed Mar 9 20:26:05 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Wed, 09 Mar 2016 21:26:05 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E08117.1090706@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> Message-ID: <1457555165.2695.5.camel@oracle.com> Hi, On Wed, 2016-03-09 at 21:01 +0100, Stefan Karlsson wrote: > Hi Mikael, > > On 2016-03-09 20:39, Mikael Gerdin wrote: > > Hi Stefan, > > > > On 2016-03-09 17:44, Stefan Karlsson wrote: > > > Hi all, > > > > > > Please review this patch to remove a bunch of redundant > > > AlwaysTrueClosure classes. > > > > > > http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ > > > > There is still > > 2128 // This should be moved to the shared markSweep code! > > 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { > > 2130 public: > > 2131 bool do_object_b(oop p) { return true; } > > 2132 }; > > 2133 static PSAlwaysTrueClosure always_true; > > in psParallelCompact.cpp > > > > Otherwise the change looks good, I don't need to see an updated > > webrev. > > Great that you saw this! > > I've uploaded a new webrev, to make it easier for the second > reviewer: > http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ looks good. Thomas From stefan.karlsson at oracle.com Wed Mar 9 20:36:08 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Wed, 9 Mar 2016 21:36:08 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <1457555165.2695.5.camel@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <1457555165.2695.5.camel@oracle.com> Message-ID: <56E08938.4090307@oracle.com> Thanks, Thomas. StefanK On 2016-03-09 21:26, Thomas Schatzl wrote: > Hi, > > On Wed, 2016-03-09 at 21:01 +0100, Stefan Karlsson wrote: >> Hi Mikael, >> >> On 2016-03-09 20:39, Mikael Gerdin wrote: >>> Hi Stefan, >>> >>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>> Hi all, >>>> >>>> Please review this patch to remove a bunch of redundant >>>> AlwaysTrueClosure classes. >>>> >>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>> There is still >>> 2128 // This should be moved to the shared markSweep code! >>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>> 2130 public: >>> 2131 bool do_object_b(oop p) { return true; } >>> 2132 }; >>> 2133 static PSAlwaysTrueClosure always_true; >>> in psParallelCompact.cpp >>> >>> Otherwise the change looks good, I don't need to see an updated >>> webrev. >> Great that you saw this! >> >> I've uploaded a new webrev, to make it easier for the second >> reviewer: >> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ > looks good. > > Thomas > From kim.barrett at oracle.com Wed Mar 9 23:11:17 2016 From: kim.barrett at oracle.com (Kim Barrett) Date: Wed, 9 Mar 2016 18:11:17 -0500 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E08117.1090706@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> Message-ID: > On Mar 9, 2016, at 3:01 PM, Stefan Karlsson wrote: > > Hi Mikael, > > On 2016-03-09 20:39, Mikael Gerdin wrote: >> Hi Stefan, >> >> On 2016-03-09 17:44, Stefan Karlsson wrote: >>> Hi all, >>> >>> Please review this patch to remove a bunch of redundant >>> AlwaysTrueClosure classes. >>> >>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >> >> There is still >> 2128 // This should be moved to the shared markSweep code! >> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >> 2130 public: >> 2131 bool do_object_b(oop p) { return true; } >> 2132 }; >> 2133 static PSAlwaysTrueClosure always_true; >> in psParallelCompact.cpp >> >> Otherwise the change looks good, I don't need to see an updated webrev. > > Great that you saw this! > > I've uploaded a new webrev, to make it easier for the second reviewer: > http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ A couple of things below; otherwise looks good. I don't need a new webrev for these. ------------------------------------------------------------------------------ src/share/vm/runtime/jniHandles.cpp 136 static AlwaysTrueClosure always_true; Function-scoped static initialization is not thread-safe in C++03. I don't think there's any noticable benefit to a static here even with thread-safe initialization, as the construction is probably pretty simple. (It might be simple enough that there's no actual thread-safety issue, but why take that chance.) ------------------------------------------------------------------------------ src/share/vm/gc/shared/referenceProcessor.cpp 269 class AlwaysAliveClosure: public BoolObjectClosure { This local class can go away too. ------------------------------------------------------------------------------ src/share/vm/gc/shared/genCollectedHeap.cpp [removed] 688 class AlwaysTrueClosure: public BoolObjectClosure { src/share/vm/gc/parallel/psMarkSweep.cpp [removed] 574 class PSAlwaysTrueClosure: public BoolObjectClosure { src/share/vm/gc/parallel/psParallelCompact.cpp [removed] 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { Nice! Fortunately, these aren't technically ODR violations, since the same-named definitions are identical. ------------------------------------------------------------------------------ From derek.white at oracle.com Wed Mar 9 23:46:44 2016 From: derek.white at oracle.com (Derek White) Date: Wed, 9 Mar 2016 18:46:44 -0500 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> Message-ID: <56E0B5E4.4040106@oracle.com> Looks nice! Are there ever enough weak JNI handles that it would pay off to re-implement JNIHandles::weak_oops_do(OopClosure* f) so it doesn't even do the callback? I'd guess not, but thought I'd ask! - Derek On 3/9/16 6:11 PM, Kim Barrett wrote: >> On Mar 9, 2016, at 3:01 PM, Stefan Karlsson wrote: >> >> Hi Mikael, >> >> On 2016-03-09 20:39, Mikael Gerdin wrote: >>> Hi Stefan, >>> >>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>> Hi all, >>>> >>>> Please review this patch to remove a bunch of redundant >>>> AlwaysTrueClosure classes. >>>> >>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>> There is still >>> 2128 // This should be moved to the shared markSweep code! >>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>> 2130 public: >>> 2131 bool do_object_b(oop p) { return true; } >>> 2132 }; >>> 2133 static PSAlwaysTrueClosure always_true; >>> in psParallelCompact.cpp >>> >>> Otherwise the change looks good, I don't need to see an updated webrev. >> Great that you saw this! >> >> I've uploaded a new webrev, to make it easier for the second reviewer: >> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ > A couple of things below; otherwise looks good. I don't need a new > webrev for these. > > ------------------------------------------------------------------------------ > src/share/vm/runtime/jniHandles.cpp > 136 static AlwaysTrueClosure always_true; > > Function-scoped static initialization is not thread-safe in C++03. > > I don't think there's any noticable benefit to a static here even with > thread-safe initialization, as the construction is probably pretty > simple. (It might be simple enough that there's no actual > thread-safety issue, but why take that chance.) > > ------------------------------------------------------------------------------ > src/share/vm/gc/shared/referenceProcessor.cpp > 269 class AlwaysAliveClosure: public BoolObjectClosure { > > This local class can go away too. > > ------------------------------------------------------------------------------ > src/share/vm/gc/shared/genCollectedHeap.cpp > [removed] > 688 class AlwaysTrueClosure: public BoolObjectClosure { > > src/share/vm/gc/parallel/psMarkSweep.cpp > [removed] > 574 class PSAlwaysTrueClosure: public BoolObjectClosure { > > src/share/vm/gc/parallel/psParallelCompact.cpp > [removed] > 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { > > Nice! Fortunately, these aren't technically ODR violations, since the > same-named definitions are identical. > > ------------------------------------------------------------------------------ > From volker.simonis at gmail.com Thu Mar 10 08:12:53 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Thu, 10 Mar 2016 09:12:53 +0100 Subject: jdk9 : forcing inlining in src/share/vm/oops/instanceKlass.inline.hpp for xlc In-Reply-To: <63dad1e5ed7945439306b95a7ac48571@DEWDFE13DE02.global.corp.sap> References: <63dad1e5ed7945439306b95a7ac48571@DEWDFE13DE02.global.corp.sap> Message-ID: Hi Matthias, thanks for reporting this. I've opened "8151593: AIX: add support for xlC 'always_inline' compiler attribute" (https://bugs.openjdk.java.net/browse/JDK-8151593) to track this issue. Regards, Volker On Wed, Mar 9, 2016 at 6:01 PM, Baesken, Matthias wrote: > Hello , > > CR 8075955: "Replace the macro based implementation of oop_oop_iterate with > a template based solution" > > > > changed src/share/vm/oops/instanceKlass.inline.hpp > > > > and replaced macro based oop iteration by templates. > > For performance reason, the change (and a follow up change for Oracle > Studio) introduced forcing of inlining for some places in > > src/share/vm/oops/instanceKlass.inline.hpp , see > > > > > > http://hg.openjdk.java.net/jdk9/dev/hotspot/file/797e6aac6d53/src/share/vm/oops/instanceKlass.inline.hpp > > > > .... > > // The iteration over the oops in objects is a hot path in the GC code. > > // By force inlining the following functions, we get similar GC performance > > // as the previous macro based implementation. > > #ifdef TARGET_COMPILER_visCPP > > #define INLINE __forceinline > > #elif defined(TARGET_COMPILER_sparcWorks) > > #define INLINE __attribute__((always_inline)) > > #else > > #define INLINE inline > > #endif > > .... > > > > (which is compiler dependent) > > Should we do this for the AIX port too ? > > > > http://www.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/language_ref/function_attributes.html?lang=en > > > > > > describes the function attributes of xlc which can be used. > > Diff to instanceKlass.inline.hpp : > > > > 43,44d42 > > < #elif defined(TARGET_COMPILER_xlc) > > < #define INLINE __attribute__((always_inline)) > > > > > > Regards, Matthias From stefan.karlsson at oracle.com Thu Mar 10 08:58:43 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Thu, 10 Mar 2016 09:58:43 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> Message-ID: <56E13743.4030802@oracle.com> Hi Kim, Updated webrevs: http://cr.openjdk.java.net/~stefank/8151539/webrev.02.delta/ http://cr.openjdk.java.net/~stefank/8151539/webrev.02/ I moved the AlwaysTrueClosure to iterator.hpp, and created a stack local instance in jniHandles.cpp. I also found that there's an AlwaysFalseClosure, so I took the liberty of moving this to iterator.hpp as well. Just a few comments inlined: On 2016-03-10 00:11, Kim Barrett wrote: >> On Mar 9, 2016, at 3:01 PM, Stefan Karlsson wrote: >> >> Hi Mikael, >> >> On 2016-03-09 20:39, Mikael Gerdin wrote: >>> Hi Stefan, >>> >>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>> Hi all, >>>> >>>> Please review this patch to remove a bunch of redundant >>>> AlwaysTrueClosure classes. >>>> >>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>> There is still >>> 2128 // This should be moved to the shared markSweep code! >>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>> 2130 public: >>> 2131 bool do_object_b(oop p) { return true; } >>> 2132 }; >>> 2133 static PSAlwaysTrueClosure always_true; >>> in psParallelCompact.cpp >>> >>> Otherwise the change looks good, I don't need to see an updated webrev. >> Great that you saw this! >> >> I've uploaded a new webrev, to make it easier for the second reviewer: >> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ > A couple of things below; otherwise looks good. I don't need a new > webrev for these. > > ------------------------------------------------------------------------------ > src/share/vm/runtime/jniHandles.cpp > 136 static AlwaysTrueClosure always_true; > > Function-scoped static initialization is not thread-safe in C++03. Thanks for pointing that out. It's not a problem here though, but I'll clean this out to prevent future bugs our questions. > > I don't think there's any noticable benefit to a static here even with > thread-safe initialization, as the construction is probably pretty > simple. (It might be simple enough that there's no actual > thread-safety issue, but why take that chance.) I agree. I've changed it to a stack instance. > > ------------------------------------------------------------------------------ > src/share/vm/gc/shared/referenceProcessor.cpp > 269 class AlwaysAliveClosure: public BoolObjectClosure { > > This local class can go away too. Done. Thanks, StefanK > > ------------------------------------------------------------------------------ > src/share/vm/gc/shared/genCollectedHeap.cpp > [removed] > 688 class AlwaysTrueClosure: public BoolObjectClosure { > > src/share/vm/gc/parallel/psMarkSweep.cpp > [removed] > 574 class PSAlwaysTrueClosure: public BoolObjectClosure { > > src/share/vm/gc/parallel/psParallelCompact.cpp > [removed] > 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { > > Nice! Fortunately, these aren't technically ODR violations, since the > same-named definitions are identical. > > ------------------------------------------------------------------------------ > From stefan.karlsson at oracle.com Thu Mar 10 09:27:33 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Thu, 10 Mar 2016 10:27:33 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E0B5E4.4040106@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <56E0B5E4.4040106@oracle.com> Message-ID: <56E13E05.7070901@oracle.com> Hi Derek, On 2016-03-10 00:46, Derek White wrote: > Looks nice! Thanks. > > Are there ever enough weak JNI handles that it would pay off to > re-implement JNIHandles::weak_oops_do(OopClosure* f) so it doesn't > even do the callback? I'd guess not, but thought I'd ask! It might be worth optimizing this for some workloads, especially since this is called from single-threaded code at the moment. If it's really important, then we might also want to devirtualize the do_oop calls inside JNIHandles::weak_oops_do. I think we would need a benchmark that shows that this is a problem, before we start to optimize this. Thanks, StefanK > > - Derek > > On 3/9/16 6:11 PM, Kim Barrett wrote: >>> On Mar 9, 2016, at 3:01 PM, Stefan Karlsson >>> wrote: >>> >>> Hi Mikael, >>> >>> On 2016-03-09 20:39, Mikael Gerdin wrote: >>>> Hi Stefan, >>>> >>>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>>> Hi all, >>>>> >>>>> Please review this patch to remove a bunch of redundant >>>>> AlwaysTrueClosure classes. >>>>> >>>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>>> There is still >>>> 2128 // This should be moved to the shared markSweep code! >>>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>>> 2130 public: >>>> 2131 bool do_object_b(oop p) { return true; } >>>> 2132 }; >>>> 2133 static PSAlwaysTrueClosure always_true; >>>> in psParallelCompact.cpp >>>> >>>> Otherwise the change looks good, I don't need to see an updated >>>> webrev. >>> Great that you saw this! >>> >>> I've uploaded a new webrev, to make it easier for the second reviewer: >>> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ >> A couple of things below; otherwise looks good. I don't need a new >> webrev for these. >> >> ------------------------------------------------------------------------------ >> >> src/share/vm/runtime/jniHandles.cpp >> 136 static AlwaysTrueClosure always_true; >> >> Function-scoped static initialization is not thread-safe in C++03. >> >> I don't think there's any noticable benefit to a static here even with >> thread-safe initialization, as the construction is probably pretty >> simple. (It might be simple enough that there's no actual >> thread-safety issue, but why take that chance.) >> >> ------------------------------------------------------------------------------ >> >> src/share/vm/gc/shared/referenceProcessor.cpp >> 269 class AlwaysAliveClosure: public BoolObjectClosure { >> >> This local class can go away too. >> >> ------------------------------------------------------------------------------ >> >> src/share/vm/gc/shared/genCollectedHeap.cpp >> [removed] >> 688 class AlwaysTrueClosure: public BoolObjectClosure { >> >> src/share/vm/gc/parallel/psMarkSweep.cpp >> [removed] >> 574 class PSAlwaysTrueClosure: public BoolObjectClosure { >> >> src/share/vm/gc/parallel/psParallelCompact.cpp >> [removed] >> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >> >> Nice! Fortunately, these aren't technically ODR violations, since the >> same-named definitions are identical. >> >> ------------------------------------------------------------------------------ >> >> > From thomas.schatzl at oracle.com Thu Mar 10 11:41:20 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Thu, 10 Mar 2016 12:41:20 +0100 Subject: RFR: 8151534: Refactor ArrayAllocator for easier reuse In-Reply-To: <56E04E63.9050405@oracle.com> References: <56E04E63.9050405@oracle.com> Message-ID: <1457610080.2780.6.camel@oracle.com> Hi, On Wed, 2016-03-09 at 17:25 +0100, Stefan Karlsson wrote: > Hi all, > > Please review this patch to refactor the ArrayAllocator code. > > http://cr.openjdk.java.net/~stefank/8151534/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8151534 > > ArrayAllocator is used to either allocate an array with malloc or > mmap. > This patch extracts the allocation code into two separate classes: > MmapArrayAllocator and MallocArrayAllocator. ArrayAllocator will > dispatch to one of these classes depending on the size of the > allocation. The main motivation for this patch is to allow the fix > for > JDK-8077144 to reuse the code in MmapArrayAllocator. looks good. I will put MmapArrayAllocator to good use :) Thanks, Thomas From vladimir.x.ivanov at oracle.com Thu Mar 10 14:02:36 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Thu, 10 Mar 2016 17:02:36 +0300 Subject: [9] RFR (S): 8141420: Compiler runtime entries don't hold Klass* from being GCed Message-ID: <56E17E7C.3010304@oracle.com> http://cr.openjdk.java.net/~vlivanov/8141420/webrev.01/ https://bugs.openjdk.java.net/browse/JDK-8141420 Though compiler runtime entries use raw Klass*, they don't ensure the classes can't be unloaded. It causes rare crashes when Full GC and class unloading happens when freshly loaded class is being constructed and the only live reference to it is the Klass* passed into the runtime call. There are KlassHandles/instanceKlassHandles, but they don't do anything after PermGen was removed. The fix is to add mirror handles to keep classes alive across safepoints during the runtime calls. FTR handles aren't needed for primitive arrays. I chose the conservative fix, since I plan to backport it into 8u. Filed JDK-8141420 [1] to refactor the code to use mirrors instead. It should simplify the logic to track class liveness. No regression test provided, since I wasn't able to write one w/o instrumenting the JVM. Testing: manual (instrumented build which triggers class unloading from runtime entries), JPRT. Thanks! Best regards, Vladimir Ivanov [1] https://bugs.openjdk.java.net/browse/JDK-8141420 From coleen.phillimore at oracle.com Thu Mar 10 14:45:40 2016 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Thu, 10 Mar 2016 09:45:40 -0500 Subject: [9] RFR (S): 8141420: Compiler runtime entries don't hold Klass* from being GCed In-Reply-To: <56E17E7C.3010304@oracle.com> References: <56E17E7C.3010304@oracle.com> Message-ID: <56E18894.6070206@oracle.com> http://cr.openjdk.java.net/~vlivanov/8141420/webrev.01/src/share/vm/opto/runtime.cpp.udiff.html In new_instance_C, why not put the holder at the top at line 220 and be done with it? It's a nice cleanup of the logic though. Otherwise, looks good. Thank you for diagnosing this problem! Coleen On 3/10/16 9:02 AM, Vladimir Ivanov wrote: > http://cr.openjdk.java.net/~vlivanov/8141420/webrev.01/ > https://bugs.openjdk.java.net/browse/JDK-8141420 > > Though compiler runtime entries use raw Klass*, they don't ensure the > classes can't be unloaded. It causes rare crashes when Full GC and > class unloading happens when freshly loaded class is being constructed > and the only live reference to it is the Klass* passed into the > runtime call. > > There are KlassHandles/instanceKlassHandles, but they don't do > anything after PermGen was removed. > > The fix is to add mirror handles to keep classes alive across > safepoints during the runtime calls. FTR handles aren't needed for > primitive arrays. > > I chose the conservative fix, since I plan to backport it into 8u. > Filed JDK-8141420 [1] to refactor the code to use mirrors instead. It > should simplify the logic to track class liveness. > > No regression test provided, since I wasn't able to write one w/o > instrumenting the JVM. > > Testing: manual (instrumented build which triggers class unloading > from runtime entries), JPRT. > > Thanks! > > Best regards, > Vladimir Ivanov > > [1] https://bugs.openjdk.java.net/browse/JDK-8141420 From paul.sandoz at oracle.com Thu Mar 10 17:06:05 2016 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 10 Mar 2016 18:06:05 +0100 Subject: RFR 8151163 All Buffer implementations should leverage Unsafe unaligned accessors In-Reply-To: References: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> <56DED5A3.8030603@oracle.com> Message-ID: <98B79CA5-4B34-443D-A921-B33390E165B9@oracle.com> > On 8 Mar 2016, at 19:27, Paul Sandoz wrote: > >>> The changes in this webrev take advantage of those for JDK-8149469 >>> and apply the unsafe double addressing scheme so certain byte buffer >>> view implementations can work across heap and direct buffers. This >>> should improve the performance on x86 for: >> >> I understand the idea, but I think we would need to verify this before >> pushing. >> > > Admittedly i am leaning on the rational/motivation for the previous changes to use Unsafe unaligned accessors. > > I less confident about the impact on non-x86 platforms. > > I have some VarHandles related benchmark code [*] i can use to get some numbers. > Here is some prelimiary perf numbers for x86 so far: http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access/perf/ArrayViewTest.java Observations: - no regression for aligned and misaligned access - big performance boost for LongBuffer view accesses over a managed ByteBuffer. - there are some curious smaller differences between ByteBuffer.getLong, LongBuffer.get, direct and managed [*], which may come down to the addressing mode used for access in unrolled loops (and how variables are hoisted out of the loop). Need to analyse the generated code. Those are not blockers and could be swept up in another issue. I need to run this on SPARC, but so far it is looking good. Paul. [*] bb_direct_long_view < bb_direct_long = bb_managed_long < bb_managed_long_view From volker.simonis at gmail.com Thu Mar 10 17:10:12 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Thu, 10 Mar 2016 18:10:12 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support Message-ID: Hi, can I please have a review and a sponsor for the following clean-up change: http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ https://bugs.openjdk.java.net/browse/JDK-8151593 First I only wanted to implement the INLINE macro for xlC in instanceKlass.inline.hpp. But then I realized that we also define NOINLINE in various other files so I decided to do it "the right way" and clean up the code a little bit. I've now moved the definition of the INLINE/NOINLINE macros to globalDefinitions_.hpp. In the case where there is no compiler-specific definition, globalDefinitions.hpp defines empty defaults for the macros. I've also renamed INLINE to ALWAYSINLINE to match its intention more clearly. Currently NOINLINE is really only defined on Linux. This is the same behavior we had before the change. Following some more details: os_linux.cpp - removed the handling for gcc < 3 (even we at SAP don't use this anymore :) objectMonitor.cpp, synchronizer.cpp - completely removed the annotation with NOINLNE which is there since pre-OpenJDK times already. The comment mentions that this was required to prevent build-time failures with 'older' versions of GCC. But we already build without 'NOINLINE' on Linux/ppc64 since years and I've also tested that it still works on Linux/x86. I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, Solaris/SPARC, MacOS X, AIX and Windows. Regards, Volker From christian.thalinger at oracle.com Thu Mar 10 17:11:58 2016 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Thu, 10 Mar 2016 07:11:58 -1000 Subject: [9] RFR (S): 8141420: Compiler runtime entries don't hold Klass* from being GCed In-Reply-To: <56E17E7C.3010304@oracle.com> References: <56E17E7C.3010304@oracle.com> Message-ID: <11092161-DC6B-4CB9-9C11-5D21CE78FD58@oracle.com> Looks good. > On Mar 10, 2016, at 4:02 AM, Vladimir Ivanov wrote: > > http://cr.openjdk.java.net/~vlivanov/8141420/webrev.01/ > https://bugs.openjdk.java.net/browse/JDK-8141420 > > Though compiler runtime entries use raw Klass*, they don't ensure the classes can't be unloaded. It causes rare crashes when Full GC and class unloading happens when freshly loaded class is being constructed and the only live reference to it is the Klass* passed into the runtime call. > > There are KlassHandles/instanceKlassHandles, but they don't do anything after PermGen was removed. > > The fix is to add mirror handles to keep classes alive across safepoints during the runtime calls. FTR handles aren't needed for primitive arrays. > > I chose the conservative fix, since I plan to backport it into 8u. Filed JDK-8141420 [1] to refactor the code to use mirrors instead. It should simplify the logic to track class liveness. > > No regression test provided, since I wasn't able to write one w/o instrumenting the JVM. > > Testing: manual (instrumented build which triggers class unloading from runtime entries), JPRT. > > Thanks! > > Best regards, > Vladimir Ivanov > > [1] https://bugs.openjdk.java.net/browse/JDK-8141420 From aleksey.shipilev at oracle.com Thu Mar 10 17:14:57 2016 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 10 Mar 2016 20:14:57 +0300 Subject: RFR 8151163 All Buffer implementations should leverage Unsafe unaligned accessors In-Reply-To: <98B79CA5-4B34-443D-A921-B33390E165B9@oracle.com> References: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> <56DED5A3.8030603@oracle.com> <98B79CA5-4B34-443D-A921-B33390E165B9@oracle.com> Message-ID: <56E1AB91.2090801@oracle.com> On 03/10/2016 08:06 PM, Paul Sandoz wrote: >> On 8 Mar 2016, at 19:27, Paul Sandoz wrote: >> >>>> The changes in this webrev take advantage of those for JDK-8149469 >>>> and apply the unsafe double addressing scheme so certain byte buffer >>>> view implementations can work across heap and direct buffers. This >>>> should improve the performance on x86 for: >>> >>> I understand the idea, but I think we would need to verify this before >>> pushing. >>> >> >> Admittedly i am leaning on the rational/motivation for the previous changes to use Unsafe unaligned accessors. >> >> I less confident about the impact on non-x86 platforms. >> >> I have some VarHandles related benchmark code [*] i can use to get some numbers. >> > > Here is some prelimiary perf numbers for x86 so far: > > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access/perf/ArrayViewTest.java Okay, the performance data looks good. This addresses my concerns for this issue, thanks! Cheers, -Aleksey From daniel.daugherty at oracle.com Thu Mar 10 17:56:34 2016 From: daniel.daugherty at oracle.com (Daniel D. Daugherty) Date: Thu, 10 Mar 2016 10:56:34 -0700 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: Message-ID: <56E1B552.6080400@oracle.com> Hi Volker, The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked via: JDK-8049103 investigate whether inlining still needs to be inhibited in objectMonitor.cpp and synchronizer.cpp https://bugs.openjdk.java.net/browse/JDK-8049103 Feel free use both bug IDs in your changeset. Dan On 3/10/16 10:10 AM, Volker Simonis wrote: > Hi, > > can I please have a review and a sponsor for the following clean-up change: > > http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ > https://bugs.openjdk.java.net/browse/JDK-8151593 > > First I only wanted to implement the INLINE macro for xlC in > instanceKlass.inline.hpp. But then I realized that we also define > NOINLINE in various other files so I decided to do it "the right way" > and clean up the code a little bit. > > I've now moved the definition of the INLINE/NOINLINE macros to > globalDefinitions_.hpp. In the case where there is no > compiler-specific definition, globalDefinitions.hpp defines empty > defaults for the macros. > > I've also renamed INLINE to ALWAYSINLINE to match its intention more clearly. > > Currently NOINLINE is really only defined on Linux. This is the same > behavior we had before the change. Following some more details: > > os_linux.cpp > > - removed the handling for gcc < 3 (even we at SAP don't use this anymore :) > > objectMonitor.cpp, synchronizer.cpp > > - completely removed the annotation with NOINLNE which is there since > pre-OpenJDK times already. The comment mentions that this was required > to prevent build-time failures with 'older' versions of GCC. But we > already build without 'NOINLINE' on Linux/ppc64 since years and I've > also tested that it still works on Linux/x86. > > I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, > Solaris/SPARC, MacOS X, AIX and Windows. > > Regards, > Volker From vladimir.x.ivanov at oracle.com Thu Mar 10 18:55:23 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Thu, 10 Mar 2016 21:55:23 +0300 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries Message-ID: <56E1C31B.8070008@oracle.com> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 https://bugs.openjdk.java.net/browse/JDK-8151623 Zap freed Metaspace chunks in non-product binaries to catch stray accesses to unloaded classes. Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, vm.gc.testlist, BigApps w/ fastdebug binaries. Thanks! Best regards, Vladimir Ivanov From vladimir.kozlov at oracle.com Thu Mar 10 19:10:31 2016 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Thu, 10 Mar 2016 11:10:31 -0800 Subject: [9] RFR (S): 8141420: Compiler runtime entries don't hold Klass* from being GCed In-Reply-To: <56E17E7C.3010304@oracle.com> References: <56E17E7C.3010304@oracle.com> Message-ID: <56E1C6A7.8020709@oracle.com> Looks good. > Filed JDK-8141420 [1] to refactor the code to use mirrors instead. Should be https://bugs.openjdk.java.net/browse/JDK-8151620 Thanks, Vladimir K On 3/10/16 6:02 AM, Vladimir Ivanov wrote: > http://cr.openjdk.java.net/~vlivanov/8141420/webrev.01/ > https://bugs.openjdk.java.net/browse/JDK-8141420 > > Though compiler runtime entries use raw Klass*, they don't ensure the > classes can't be unloaded. It causes rare crashes when Full GC and class > unloading happens when freshly loaded class is being constructed and the > only live reference to it is the Klass* passed into the runtime call. > > There are KlassHandles/instanceKlassHandles, but they don't do anything > after PermGen was removed. > > The fix is to add mirror handles to keep classes alive across safepoints > during the runtime calls. FTR handles aren't needed for primitive arrays. > > I chose the conservative fix, since I plan to backport it into 8u. Filed > JDK-8141420 [1] to refactor the code to use mirrors instead. It should > simplify the logic to track class liveness. > > No regression test provided, since I wasn't able to write one w/o > instrumenting the JVM. > > Testing: manual (instrumented build which triggers class unloading from > runtime entries), JPRT. > > Thanks! > > Best regards, > Vladimir Ivanov > > [1] https://bugs.openjdk.java.net/browse/JDK-8141420 From thomas.stuefe at gmail.com Thu Mar 10 19:22:22 2016 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 10 Mar 2016 20:22:22 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: Message-ID: Hi Volker, nice work! Some remarks: http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/src/share/vm/utilities/globalDefinitions_visCPP.hpp.udiff.html According to http://stackoverflow.com/questions/3329214/is-it-possible-to-force-a-function-not-to-be-inlined , declspec(noinline) may work for non-member functions too, albeit undocumented. Would be at least worth to try. http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/src/share/vm/utilities/stack.inline.hpp.udiff.html So, if now a platform decides to specify NOINLINE, this will change compilation for Stack<> even though the issue is only described as a gcc problem? Kind Regards, Thomas On Thu, Mar 10, 2016 at 6:10 PM, Volker Simonis wrote: > Hi, > > can I please have a review and a sponsor for the following clean-up change: > > http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ > https://bugs.openjdk.java.net/browse/JDK-8151593 > > First I only wanted to implement the INLINE macro for xlC in > instanceKlass.inline.hpp. But then I realized that we also define > NOINLINE in various other files so I decided to do it "the right way" > and clean up the code a little bit. > > I've now moved the definition of the INLINE/NOINLINE macros to > globalDefinitions_.hpp. In the case where there is no > compiler-specific definition, globalDefinitions.hpp defines empty > defaults for the macros. > > I've also renamed INLINE to ALWAYSINLINE to match its intention more > clearly. > > Currently NOINLINE is really only defined on Linux. This is the same > behavior we had before the change. Following some more details: > > os_linux.cpp > > - removed the handling for gcc < 3 (even we at SAP don't use this anymore > :) > > objectMonitor.cpp, synchronizer.cpp > > - completely removed the annotation with NOINLNE which is there since > pre-OpenJDK times already. The comment mentions that this was required > to prevent build-time failures with 'older' versions of GCC. But we > already build without 'NOINLINE' on Linux/ppc64 since years and I've > also tested that it still works on Linux/x86. > > I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, > Solaris/SPARC, MacOS X, AIX and Windows. > > Regards, > Volker > From dean.long at oracle.com Thu Mar 10 19:43:51 2016 From: dean.long at oracle.com (Dean Long) Date: Thu, 10 Mar 2016 11:43:51 -0800 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1C31B.8070008@oracle.com> References: <56E1C31B.8070008@oracle.com> Message-ID: <56E1CE77.7020106@oracle.com> This looks good. I was experimenting with a similar change. The comment nearby saying "Do not mangle freed Metachunks" made me wonder if it was safe. Could you update the comment if this is indeed safe? Also, is there a Zap flag we can use to turn this off and on? dl On 3/10/2016 10:55 AM, Vladimir Ivanov wrote: > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8151623 > > Zap freed Metaspace chunks in non-product binaries to catch stray > accesses to unloaded classes. > > Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, > jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, > vm.gc.testlist, BigApps w/ fastdebug binaries. > > Thanks! > > Best regards, > Vladimir Ivanov From vladimir.x.ivanov at oracle.com Thu Mar 10 21:15:26 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 11 Mar 2016 00:15:26 +0300 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1CE77.7020106@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1CE77.7020106@oracle.com> Message-ID: <56E1E3EE.7090909@oracle.com> Thanks, Dean. Updated version: http://cr.openjdk.java.net/~vlivanov/8151623/webrev.01 On 3/10/16 10:43 PM, Dean Long wrote: > This looks good. I was experimenting with a similar change. The > comment nearby saying > "Do not mangle freed Metachunks" made me wonder if it was safe. Could > you update the Good catch, fixed. Unless there's something useful stored after the header in a free chunk, it should be safe. > comment if this is indeed safe? Also, is there a Zap flag we > can use to turn > this off and on? Do you suggest a non-product or a diagnostic flag (to be able to turn it on in product binaries)? Best regards, Vladimir Ivanov > On 3/10/2016 10:55 AM, Vladimir Ivanov wrote: >> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 >> https://bugs.openjdk.java.net/browse/JDK-8151623 >> >> Zap freed Metaspace chunks in non-product binaries to catch stray >> accesses to unloaded classes. >> >> Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, >> jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, >> vm.gc.testlist, BigApps w/ fastdebug binaries. >> >> Thanks! >> >> Best regards, >> Vladimir Ivanov > From dean.long at oracle.com Thu Mar 10 21:28:05 2016 From: dean.long at oracle.com (Dean Long) Date: Thu, 10 Mar 2016 13:28:05 -0800 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1E3EE.7090909@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1CE77.7020106@oracle.com> <56E1E3EE.7090909@oracle.com> Message-ID: <56E1E6E5.2060900@oracle.com> On 3/10/2016 1:15 PM, Vladimir Ivanov wrote: > Thanks, Dean. > > Updated version: > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.01 > Still good. > On 3/10/16 10:43 PM, Dean Long wrote: >> This looks good. I was experimenting with a similar change. The >> comment nearby saying >> "Do not mangle freed Metachunks" made me wonder if it was safe. Could >> you update the > Good catch, fixed. Unless there's something useful stored after the > header in a free chunk, it should be safe. > >> comment if this is indeed safe? Also, is there a Zap flag we >> can use to turn >> this off and on? > Do you suggest a non-product or a diagnostic flag (to be able to turn > it on in product binaries)? > I thought there was a Zap flag for metadata, but maybe not. I don't know if it's worth the trouble to add a new flag. dl > Best regards, > Vladimir Ivanov > >> On 3/10/2016 10:55 AM, Vladimir Ivanov wrote: >>> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 >>> https://bugs.openjdk.java.net/browse/JDK-8151623 >>> >>> Zap freed Metaspace chunks in non-product binaries to catch stray >>> accesses to unloaded classes. >>> >>> Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, >>> jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, >>> vm.gc.testlist, BigApps w/ fastdebug binaries. >>> >>> Thanks! >>> >>> Best regards, >>> Vladimir Ivanov >> From jon.masamitsu at oracle.com Thu Mar 10 21:40:19 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Thu, 10 Mar 2016 13:40:19 -0800 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1C31B.8070008@oracle.com> References: <56E1C31B.8070008@oracle.com> Message-ID: <56E1E9C3.40006@oracle.com> Vladimir, http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00/src/share/vm/memory/metachunk.cpp.frames.html Did you consider adding the "wordValue" parameter 101 static void overwrite_chunk_payload(Metachunk* chunk, juint wordValue) { to the original Metachunk::mangle() so that it becomes 101 void Metachunk::mangle(juint wordValue) { ... 106 Copy::fill_to_words(start, size, wordValue); Jon On 03/10/2016 10:55 AM, Vladimir Ivanov wrote: > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8151623 > > Zap freed Metaspace chunks in non-product binaries to catch stray > accesses to unloaded classes. > > Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, > jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, > vm.gc.testlist, BigApps w/ fastdebug binaries. > > Thanks! > > Best regards, > Vladimir Ivanov From vladimir.x.ivanov at oracle.com Thu Mar 10 22:15:58 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 11 Mar 2016 01:15:58 +0300 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1E9C3.40006@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1E9C3.40006@oracle.com> Message-ID: <56E1F21E.80106@oracle.com> Jon, something like the following? http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/ Best regards, Vladimir Ivanov On 3/11/16 12:40 AM, Jon Masamitsu wrote: > Vladimir, > > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00/src/share/vm/memory/metachunk.cpp.frames.html > > > Did you consider adding the "wordValue" parameter > > 101 static void overwrite_chunk_payload(Metachunk* chunk, juint > wordValue) { > > to the original Metachunk::mangle() so that it becomes > > 101 void Metachunk::mangle(juint wordValue) { ... 106 > Copy::fill_to_words(start, size, wordValue); > > > Jon > > On 03/10/2016 10:55 AM, Vladimir Ivanov wrote: >> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 >> https://bugs.openjdk.java.net/browse/JDK-8151623 >> >> Zap freed Metaspace chunks in non-product binaries to catch stray >> accesses to unloaded classes. >> >> Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, >> jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, >> vm.gc.testlist, BigApps w/ fastdebug binaries. >> >> Thanks! >> >> Best regards, >> Vladimir Ivanov > From jon.masamitsu at oracle.com Thu Mar 10 22:48:08 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Thu, 10 Mar 2016 14:48:08 -0800 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1F21E.80106@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1E9C3.40006@oracle.com> <56E1F21E.80106@oracle.com> Message-ID: <56E1F9A8.2000608@oracle.com> On 03/10/2016 02:15 PM, Vladimir Ivanov wrote: > Jon, something like the following? > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/ Yes, like that. The change in the Metachunk constructor changes semantics in that the original code mangled the whole chunk, not just the payload. I'd prefer that the original code is left. The little bit of code duplication is OK. http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/src/share/vm/memory/metachunk.hpp.frames.html Please use the style "word_value" instead of "wordValue". If there is a mistake in the mangling of a Metablock, that would show up when the Metaspace shrinks. Can you check that the testing has some Metaspace shrinking. I think that -Xlog:gc*=trace would show the needed output. Jon > > Best regards, > Vladimir Ivanov > > On 3/11/16 12:40 AM, Jon Masamitsu wrote: >> Vladimir, >> >> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00/src/share/vm/memory/metachunk.cpp.frames.html >> >> >> >> Did you consider adding the "wordValue" parameter >> >> 101 static void overwrite_chunk_payload(Metachunk* chunk, juint >> wordValue) { >> >> to the original Metachunk::mangle() so that it becomes >> >> 101 void Metachunk::mangle(juint wordValue) { ... 106 >> Copy::fill_to_words(start, size, wordValue); >> >> >> Jon >> >> On 03/10/2016 10:55 AM, Vladimir Ivanov wrote: >>> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.00 >>> https://bugs.openjdk.java.net/browse/JDK-8151623 >>> >>> Zap freed Metaspace chunks in non-product binaries to catch stray >>> accesses to unloaded classes. >>> >>> Testing: JPRT, RBT (in progress): hotspot/test:hotspot_all, >>> jdk/test:tier1 & tier2, vm.parallel_class_loading.testlist, >>> vm.gc.testlist, BigApps w/ fastdebug binaries. >>> >>> Thanks! >>> >>> Best regards, >>> Vladimir Ivanov >> From david.holmes at oracle.com Fri Mar 11 02:12:56 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 11 Mar 2016 12:12:56 +1000 Subject: UL: logging before initialization? In-Reply-To: References: Message-ID: <56E229A8.4020907@oracle.com> Hi Thomas, Expanding to hotspot-dev as UL was not designed/built by the runtime team. My comments below based on my limited understanding of UL. On 11/03/2016 2:25 AM, Thomas St?fe wrote: > Hi all, > > I wanted to use UL to log some information from early OS initialization but > found that we initialize logging quite late. It is initialized way after > os::init() runs. There are various dependencies in the unified logging framework that prevent it (or at least parts of it) from being used early eg: - argument parsing and log configuration - existence of current thread (for logStreams) > I also see that warnings and errors are printed unconditionally even > before, only log calls for levels <= info are quietly swallowed. Are those warnings/errors using UL? I suspect not. Silent swallowing is not good though. > Would there be a way to move UL initialization and parsing of -Xlog > Arguments to an earlier point to be able to use logging in os::init()? I don't see how you could utilize tags and levels until after full initialization of the logging system, so that would preclude using it as early as os::init. > Or, if that is not possible, would there be a way to delay printing of > early logging calls to after logging initialization and then print them out > in one go? I think this would be not trivial though: one would have to > collect all logging output in memory somewhere - because we do not yet know > which tags are switched on - and then, once -Xlog is parsed, filter it by > tag before printing it out. Yeah that seems difficult/complex given the problem that the VM is in the early stages of initialization > What do you think, would that be a worthwhile change? I am a bit unhappy > about how logging calls are quietly swallowed, so for any code which runs > at VM initialization, one always has to keep in mind that UL may not yet be > initialized. Not a new problem (adding more code during VM initialization) but one that is getting more complicated :) Cheers, David > Kind Regards, Thomas > From vladimir.x.ivanov at oracle.com Fri Mar 11 07:55:25 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 11 Mar 2016 10:55:25 +0300 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1F9A8.2000608@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1E9C3.40006@oracle.com> <56E1F21E.80106@oracle.com> <56E1F9A8.2000608@oracle.com> Message-ID: <56E279ED.4070008@oracle.com> >> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/ > > Yes, like that. > > The change in the Metachunk constructor changes semantics in that > the original code mangled the whole chunk, not just the payload. I'd > prefer that the original code is left. The little bit of code > duplication is > OK. I think they are equivalent: _top = initial_top(); size_t data_word_size = pointer_delta(end(), _top, sizeof(MetaWord)); Copy::fill_to_words((HeapWord*)_top, data_word_size, metadata_chunk_initialize); vs HeapWord* start = (HeapWord*)initial_top(); size_t size = word_size() - overhead(); Copy::fill_to_words(start, size, word_value); _top == initial_top() and data_word_size == size: end() == this + _word_size pointer_delta == (end() - _top) / sizeof(MetaWord) > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/src/share/vm/memory/metachunk.hpp.frames.html > > Please use the style "word_value" instead of "wordValue". Will fix. > If there is a mistake in the mangling of a Metablock, that would > show up when the Metaspace shrinks. Can you check that the testing > has some Metaspace shrinking. I think that -Xlog:gc*=trace would > show the needed output. Ok, I'll verify that. Best regards, Vladimir Ivanov From vladimir.x.ivanov at oracle.com Fri Mar 11 08:04:42 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 11 Mar 2016 11:04:42 +0300 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1E6E5.2060900@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1CE77.7020106@oracle.com> <56E1E3EE.7090909@oracle.com> <56E1E6E5.2060900@oracle.com> Message-ID: <56E27C1A.5020707@oracle.com> > I thought there was a Zap flag for metadata, but maybe not. I don't > know if it's worth the trouble to add a new flag. There are many Zap* flags, but ZapMetadata is not among them: develop(bool, ZapResourceArea, trueInDebug, "Zap freed resource/arena space with 0xABABABAB") notproduct(bool, ZapVMHandleArea, trueInDebug, "Zap freed VM handle space with 0xBCBCBCBC") develop(bool, ZapJNIHandleArea, trueInDebug, "Zap freed JNI handle space with 0xFEFEFEFE") notproduct(bool, ZapStackSegments, trueInDebug, "Zap allocated/freed stack segments with 0xFADFADED") develop(bool, ZapUnusedHeapArea, trueInDebug, "Zap unused heap space with 0xBAADBABE") develop(bool, ZapFillerObjects, trueInDebug, "Zap filler objects with 0xDEAFBABE") I don't have a strong opinion here. The usefulness of these flags looks questionable, considering: (1) zapping is turned on by default in debug builds and (2) there is not way to turn it on in product. They can be switched on in optimized build, but it is not that popular these days. Best regards, Vladimir Ivanov From vladimir.x.ivanov at oracle.com Fri Mar 11 08:09:32 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 11 Mar 2016 11:09:32 +0300 Subject: [9] RFR (S): 8141420: Compiler runtime entries don't hold Klass* from being GCed In-Reply-To: <56E18894.6070206@oracle.com> References: <56E17E7C.3010304@oracle.com> <56E18894.6070206@oracle.com> Message-ID: <56E27D3C.2080101@oracle.com> Coleen, Vladimir, thanks! > In new_instance_C, why not put the holder at the top at line 220 and be > done with it? It's a nice cleanup of the logic though. Sounds reasonable. Will do. Best regards, Vladimir Ivanov From marcus.larsson at oracle.com Fri Mar 11 08:14:05 2016 From: marcus.larsson at oracle.com (Marcus Larsson) Date: Fri, 11 Mar 2016 09:14:05 +0100 Subject: UL: logging before initialization? In-Reply-To: <56E229A8.4020907@oracle.com> References: <56E229A8.4020907@oracle.com> Message-ID: <56E27E4D.3060108@oracle.com> Hi, On 2016-03-11 03:12, David Holmes wrote: > Hi Thomas, > > Expanding to hotspot-dev as UL was not designed/built by the runtime > team. > > My comments below based on my limited understanding of UL. > > On 11/03/2016 2:25 AM, Thomas St?fe wrote: >> Hi all, >> >> I wanted to use UL to log some information from early OS >> initialization but >> found that we initialize logging quite late. It is initialized way after >> os::init() runs. > > There are various dependencies in the unified logging framework that > prevent it (or at least parts of it) from being used early eg: > - argument parsing and log configuration > - existence of current thread (for logStreams) Currently, the framework can be used as soon as static initialization is done. This doesn't include the logStreams of course since they require resource allocations. The problem is as you say that there is no way to configure the logging before parsing the -Xlog command. This means up until that point the default configuration will apply, which means warnings and errors to stdout. > >> I also see that warnings and errors are printed unconditionally even >> before, only log calls for levels <= info are quietly swallowed. > > Are those warnings/errors using UL? I suspect not. They could be, since errors and warnings are enabled by default. > > Silent swallowing is not good though. > >> Would there be a way to move UL initialization and parsing of -Xlog >> Arguments to an earlier point to be able to use logging in os::init()? > > I don't see how you could utilize tags and levels until after full > initialization of the logging system, so that would preclude using it > as early as os::init. It is a possible solution I guess. I don't know how dependent argument parsing is on other initialization. There would always be some part of the initialization where you only have warning and error logging unless we do the parsing first thing during startup, which I assume will be impossible. > >> Or, if that is not possible, would there be a way to delay printing of >> early logging calls to after logging initialization and then print >> them out >> in one go? I think this would be not trivial though: one would have to >> collect all logging output in memory somewhere - because we do not >> yet know >> which tags are switched on - and then, once -Xlog is parsed, filter >> it by >> tag before printing it out. > > Yeah that seems difficult/complex given the problem that the VM is in > the early stages of initialization > >> What do you think, would that be a worthwhile change? I am a bit unhappy >> about how logging calls are quietly swallowed, so for any code which >> runs >> at VM initialization, one always has to keep in mind that UL may not >> yet be >> initialized. > > Not a new problem (adding more code during VM initialization) but one > that is getting more complicated :) I think it would perhaps be worthwhile if there's demand for a bunch of info to trace level logging from startup code (before argument parsing). Thanks, Marcus > > Cheers, > David > >> Kind Regards, Thomas >> From volker.simonis at gmail.com Fri Mar 11 08:28:01 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 11 Mar 2016 09:28:01 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: Message-ID: On Thu, Mar 10, 2016 at 8:22 PM, Thomas St?fe wrote: > Hi Volker, > > nice work! > Some remarks: > > http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/src/share/vm/utilities/globalDefinitions_visCPP.hpp.udiff.html > > According to > http://stackoverflow.com/questions/3329214/is-it-possible-to-force-a-function-not-to-be-inlined > , declspec(noinline) may work for non-member functions too, albeit > undocumented. Would be at least worth to try. > Good to know. As you correctly noticed, NOINLINE hasn't been used on Windows until now and I tried not to change the behavior with my change. But I've put the information into the comment if somebody wants to use it eventually. > http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/src/share/vm/utilities/stack.inline.hpp.udiff.html > > So, if now a platform decides to specify NOINLINE, this will change > compilation for Stack<> even though the issue is only described as a gcc > problem? > Right, but this should only apply to functions which are not performance critical anyway. So I think that should do no harm. > Kind Regards, Thomas > > > > > > > > > > On Thu, Mar 10, 2016 at 6:10 PM, Volker Simonis > wrote: >> >> Hi, >> >> can I please have a review and a sponsor for the following clean-up >> change: >> >> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >> https://bugs.openjdk.java.net/browse/JDK-8151593 >> >> First I only wanted to implement the INLINE macro for xlC in >> instanceKlass.inline.hpp. But then I realized that we also define >> NOINLINE in various other files so I decided to do it "the right way" >> and clean up the code a little bit. >> >> I've now moved the definition of the INLINE/NOINLINE macros to >> globalDefinitions_.hpp. In the case where there is no >> compiler-specific definition, globalDefinitions.hpp defines empty >> defaults for the macros. >> >> I've also renamed INLINE to ALWAYSINLINE to match its intention more >> clearly. >> >> Currently NOINLINE is really only defined on Linux. This is the same >> behavior we had before the change. Following some more details: >> >> os_linux.cpp >> >> - removed the handling for gcc < 3 (even we at SAP don't use this anymore >> :) >> >> objectMonitor.cpp, synchronizer.cpp >> >> - completely removed the annotation with NOINLNE which is there since >> pre-OpenJDK times already. The comment mentions that this was required >> to prevent build-time failures with 'older' versions of GCC. But we >> already build without 'NOINLINE' on Linux/ppc64 since years and I've >> also tested that it still works on Linux/x86. >> >> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >> Solaris/SPARC, MacOS X, AIX and Windows. >> >> Regards, >> Volker > > From volker.simonis at gmail.com Fri Mar 11 09:31:21 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 11 Mar 2016 10:31:21 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: <56E1B552.6080400@oracle.com> References: <56E1B552.6080400@oracle.com> Message-ID: Hi Dan, thanks for the hint. I've linked the two issues together in JBS and I can close the second one as duplicate once the fix is committed. How can I use two bug IDs in a changeset? Should I just put it in an additional "Summary:" line? As regards to content, I really think the annotations aren't needed any more. I've tried with gcc4.1.2 which is the oldest we are using it it works perfectly. Regards, Volker On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty wrote: > Hi Volker, > > The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked via: > > JDK-8049103 investigate whether inlining still needs to be inhibited in > objectMonitor.cpp and synchronizer.cpp > https://bugs.openjdk.java.net/browse/JDK-8049103 > > Feel free use both bug IDs in your changeset. > > Dan > > > > On 3/10/16 10:10 AM, Volker Simonis wrote: >> >> Hi, >> >> can I please have a review and a sponsor for the following clean-up >> change: >> >> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >> https://bugs.openjdk.java.net/browse/JDK-8151593 >> >> First I only wanted to implement the INLINE macro for xlC in >> instanceKlass.inline.hpp. But then I realized that we also define >> NOINLINE in various other files so I decided to do it "the right way" >> and clean up the code a little bit. >> >> I've now moved the definition of the INLINE/NOINLINE macros to >> globalDefinitions_.hpp. In the case where there is no >> compiler-specific definition, globalDefinitions.hpp defines empty >> defaults for the macros. >> >> I've also renamed INLINE to ALWAYSINLINE to match its intention more >> clearly. >> >> Currently NOINLINE is really only defined on Linux. This is the same >> behavior we had before the change. Following some more details: >> >> os_linux.cpp >> >> - removed the handling for gcc < 3 (even we at SAP don't use this anymore >> :) >> >> objectMonitor.cpp, synchronizer.cpp >> >> - completely removed the annotation with NOINLNE which is there since >> pre-OpenJDK times already. The comment mentions that this was required >> to prevent build-time failures with 'older' versions of GCC. But we >> already build without 'NOINLINE' on Linux/ppc64 since years and I've >> also tested that it still works on Linux/x86. >> >> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >> Solaris/SPARC, MacOS X, AIX and Windows. >> >> Regards, >> Volker > > From mikael.gerdin at oracle.com Fri Mar 11 09:36:30 2016 From: mikael.gerdin at oracle.com (Mikael Gerdin) Date: Fri, 11 Mar 2016 10:36:30 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: <56E1B552.6080400@oracle.com> Message-ID: <56E2919E.5080400@oracle.com> Volker, On 2016-03-11 10:31, Volker Simonis wrote: > Hi Dan, > > thanks for the hint. I've linked the two issues together in JBS and I > can close the second one as duplicate once the fix is committed. > > How can I use two bug IDs in a changeset? Should I just put it in an > additional "Summary:" line? The changeset format actually allows multiple bug ids in a single commit, the format is: XXXXXXX: Bug title 1 YYYYYYY: Bug title 2 Summary: foo Reviewed-by: bar See http://openjdk.java.net/guide/producingChangeset.html /Mikael > > As regards to content, I really think the annotations aren't needed > any more. I've tried with gcc4.1.2 which is the oldest we are using it > it works perfectly. > > Regards, > Volker > > On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty > wrote: >> Hi Volker, >> >> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked via: >> >> JDK-8049103 investigate whether inlining still needs to be inhibited in >> objectMonitor.cpp and synchronizer.cpp >> https://bugs.openjdk.java.net/browse/JDK-8049103 >> >> Feel free use both bug IDs in your changeset. >> >> Dan >> >> >> >> On 3/10/16 10:10 AM, Volker Simonis wrote: >>> >>> Hi, >>> >>> can I please have a review and a sponsor for the following clean-up >>> change: >>> >>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>> >>> First I only wanted to implement the INLINE macro for xlC in >>> instanceKlass.inline.hpp. But then I realized that we also define >>> NOINLINE in various other files so I decided to do it "the right way" >>> and clean up the code a little bit. >>> >>> I've now moved the definition of the INLINE/NOINLINE macros to >>> globalDefinitions_.hpp. In the case where there is no >>> compiler-specific definition, globalDefinitions.hpp defines empty >>> defaults for the macros. >>> >>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>> clearly. >>> >>> Currently NOINLINE is really only defined on Linux. This is the same >>> behavior we had before the change. Following some more details: >>> >>> os_linux.cpp >>> >>> - removed the handling for gcc < 3 (even we at SAP don't use this anymore >>> :) >>> >>> objectMonitor.cpp, synchronizer.cpp >>> >>> - completely removed the annotation with NOINLNE which is there since >>> pre-OpenJDK times already. The comment mentions that this was required >>> to prevent build-time failures with 'older' versions of GCC. But we >>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>> also tested that it still works on Linux/x86. >>> >>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>> Solaris/SPARC, MacOS X, AIX and Windows. >>> >>> Regards, >>> Volker >> >> From volker.simonis at gmail.com Fri Mar 11 09:40:33 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 11 Mar 2016 10:40:33 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: <56E1B552.6080400@oracle.com> Message-ID: New webrev with fixed copyright header in instanceKlass.inline.hpp, extended comment on '__declspec(noinline)' in globalDefinitions_visCPP.hpp: http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593.v1/ On Fri, Mar 11, 2016 at 10:31 AM, Volker Simonis wrote: > Hi Dan, > > thanks for the hint. I've linked the two issues together in JBS and I > can close the second one as duplicate once the fix is committed. > > How can I use two bug IDs in a changeset? Should I just put it in an > additional "Summary:" line? > > As regards to content, I really think the annotations aren't needed > any more. I've tried with gcc4.1.2 which is the oldest we are using it > it works perfectly. > > Regards, > Volker > > On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty > wrote: >> Hi Volker, >> >> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked via: >> >> JDK-8049103 investigate whether inlining still needs to be inhibited in >> objectMonitor.cpp and synchronizer.cpp >> https://bugs.openjdk.java.net/browse/JDK-8049103 >> >> Feel free use both bug IDs in your changeset. >> >> Dan >> >> >> >> On 3/10/16 10:10 AM, Volker Simonis wrote: >>> >>> Hi, >>> >>> can I please have a review and a sponsor for the following clean-up >>> change: >>> >>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>> >>> First I only wanted to implement the INLINE macro for xlC in >>> instanceKlass.inline.hpp. But then I realized that we also define >>> NOINLINE in various other files so I decided to do it "the right way" >>> and clean up the code a little bit. >>> >>> I've now moved the definition of the INLINE/NOINLINE macros to >>> globalDefinitions_.hpp. In the case where there is no >>> compiler-specific definition, globalDefinitions.hpp defines empty >>> defaults for the macros. >>> >>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>> clearly. >>> >>> Currently NOINLINE is really only defined on Linux. This is the same >>> behavior we had before the change. Following some more details: >>> >>> os_linux.cpp >>> >>> - removed the handling for gcc < 3 (even we at SAP don't use this anymore >>> :) >>> >>> objectMonitor.cpp, synchronizer.cpp >>> >>> - completely removed the annotation with NOINLNE which is there since >>> pre-OpenJDK times already. The comment mentions that this was required >>> to prevent build-time failures with 'older' versions of GCC. But we >>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>> also tested that it still works on Linux/x86. >>> >>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>> Solaris/SPARC, MacOS X, AIX and Windows. >>> >>> Regards, >>> Volker >> >> From volker.simonis at gmail.com Fri Mar 11 09:45:33 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 11 Mar 2016 10:45:33 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: <56E2919E.5080400@oracle.com> References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> Message-ID: On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin wrote: > Volker, > > On 2016-03-11 10:31, Volker Simonis wrote: >> >> Hi Dan, >> >> thanks for the hint. I've linked the two issues together in JBS and I >> can close the second one as duplicate once the fix is committed. >> >> How can I use two bug IDs in a changeset? Should I just put it in an >> additional "Summary:" line? > > > The changeset format actually allows multiple bug ids in a single commit, > the format is: > > XXXXXXX: Bug title 1 > YYYYYYY: Bug title 2 > Summary: foo > Reviewed-by: bar > > See > http://openjdk.java.net/guide/producingChangeset.html > Ah, I see. Thanks for the info. Nevertheless I'd prefer to use one single bug only and close the other as duplicate. I personally think multiple bug IDs are confusing (and they break our internal integration scripts :) Regards, Volker > /Mikael > > >> >> As regards to content, I really think the annotations aren't needed >> any more. I've tried with gcc4.1.2 which is the oldest we are using it >> it works perfectly. >> >> Regards, >> Volker >> >> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >> wrote: >>> >>> Hi Volker, >>> >>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked via: >>> >>> JDK-8049103 investigate whether inlining still needs to be inhibited in >>> objectMonitor.cpp and synchronizer.cpp >>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>> >>> Feel free use both bug IDs in your changeset. >>> >>> Dan >>> >>> >>> >>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>> >>>> >>>> Hi, >>>> >>>> can I please have a review and a sponsor for the following clean-up >>>> change: >>>> >>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>> >>>> First I only wanted to implement the INLINE macro for xlC in >>>> instanceKlass.inline.hpp. But then I realized that we also define >>>> NOINLINE in various other files so I decided to do it "the right way" >>>> and clean up the code a little bit. >>>> >>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>> globalDefinitions_.hpp. In the case where there is no >>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>> defaults for the macros. >>>> >>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>> clearly. >>>> >>>> Currently NOINLINE is really only defined on Linux. This is the same >>>> behavior we had before the change. Following some more details: >>>> >>>> os_linux.cpp >>>> >>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>> anymore >>>> :) >>>> >>>> objectMonitor.cpp, synchronizer.cpp >>>> >>>> - completely removed the annotation with NOINLNE which is there since >>>> pre-OpenJDK times already. The comment mentions that this was required >>>> to prevent build-time failures with 'older' versions of GCC. But we >>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>> also tested that it still works on Linux/x86. >>>> >>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>> >>>> Regards, >>>> Volker >>> >>> >>> > From aph at redhat.com Fri Mar 11 10:37:04 2016 From: aph at redhat.com (Andrew Haley) Date: Fri, 11 Mar 2016 10:37:04 +0000 Subject: [aarch64-port-dev ] RFR: 8151502: aarch64: optimize pd_disjoint_words and pd_conjoint_words In-Reply-To: <1457687145.25635.2.camel@mint> References: <1457525861.10946.31.camel@mint> <56E01DB7.1070609@redhat.com> <1457532432.10946.77.camel@mint> <56E02F07.4040005@redhat.com> <1457554508.29918.13.camel@mint> <56E16B7E.4040409@redhat.com> <1457618711.14420.5.camel@mint> <56E180A6.20100@redhat.com> <1457619657.14420.11.camel@mint> <56E1862F.3090105@redhat.com> <1457622690.14420.25.camel@mint> <1457624353.18091.5.camel@mint> <56E1D647.4050609@redhat.com> <1457687145.25635.2.camel@mint> Message-ID: <56E29FD0.5060307@redhat.com> On 11/03/16 09:05, Edward Nevill wrote: > On Thu, 2016-03-10 at 20:17 +0000, Andrew Haley wrote: >> On 10/03/16 15:39, Edward Nevill wrote: >>> So the difference is 0.05% which is noise. >> >> OK, thanks. I can live with the shorter of these two patches. >> > > http://cr.openjdk.java.net/~enevill/8151502/webrev.4/ OK. Andrew. From paul.sandoz at oracle.com Fri Mar 11 10:49:14 2016 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 11 Mar 2016 11:49:14 +0100 Subject: RFR 8151163 All Buffer implementations should leverage Unsafe unaligned accessors In-Reply-To: <56E1AB91.2090801@oracle.com> References: <142D9ABF-C144-42E6-9FA2-48A90A51C3A9@oracle.com> <56DED5A3.8030603@oracle.com> <98B79CA5-4B34-443D-A921-B33390E165B9@oracle.com> <56E1AB91.2090801@oracle.com> Message-ID: > On 10 Mar 2016, at 18:14, Aleksey Shipilev wrote: > > On 03/10/2016 08:06 PM, Paul Sandoz wrote: >>> On 8 Mar 2016, at 19:27, Paul Sandoz wrote: >>> >>>>> The changes in this webrev take advantage of those for JDK-8149469 >>>>> and apply the unsafe double addressing scheme so certain byte buffer >>>>> view implementations can work across heap and direct buffers. This >>>>> should improve the performance on x86 for: >>>> >>>> I understand the idea, but I think we would need to verify this before >>>> pushing. >>>> >>> >>> Admittedly i am leaning on the rational/motivation for the previous changes to use Unsafe unaligned accessors. >>> >>> I less confident about the impact on non-x86 platforms. >>> >>> I have some VarHandles related benchmark code [*] i can use to get some numbers. >>> >> >> Here is some prelimiary perf numbers for x86 so far: >> >> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151163-buffer-unsafe-unaligned-access/perf/ArrayViewTest.java > > Okay, the performance data looks good. This addresses my concerns for > this issue, thanks! > Thanks, i added you as a reviewer. Paul. From thomas.stuefe at gmail.com Fri Mar 11 10:52:17 2016 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Fri, 11 Mar 2016 11:52:17 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: <56E1B552.6080400@oracle.com> Message-ID: Hi Volker, looks fine. Kind Regards, Thomas On Fri, Mar 11, 2016 at 10:40 AM, Volker Simonis wrote: > New webrev with fixed copyright header in instanceKlass.inline.hpp, > extended comment on '__declspec(noinline)' in > globalDefinitions_visCPP.hpp: > > http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593.v1/ > > > On Fri, Mar 11, 2016 at 10:31 AM, Volker Simonis > wrote: > > Hi Dan, > > > > thanks for the hint. I've linked the two issues together in JBS and I > > can close the second one as duplicate once the fix is committed. > > > > How can I use two bug IDs in a changeset? Should I just put it in an > > additional "Summary:" line? > > > > As regards to content, I really think the annotations aren't needed > > any more. I've tried with gcc4.1.2 which is the oldest we are using it > > it works perfectly. > > > > Regards, > > Volker > > > > On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty > > wrote: > >> Hi Volker, > >> > >> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked > via: > >> > >> JDK-8049103 investigate whether inlining still needs to be inhibited in > >> objectMonitor.cpp and synchronizer.cpp > >> https://bugs.openjdk.java.net/browse/JDK-8049103 > >> > >> Feel free use both bug IDs in your changeset. > >> > >> Dan > >> > >> > >> > >> On 3/10/16 10:10 AM, Volker Simonis wrote: > >>> > >>> Hi, > >>> > >>> can I please have a review and a sponsor for the following clean-up > >>> change: > >>> > >>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ > >>> https://bugs.openjdk.java.net/browse/JDK-8151593 > >>> > >>> First I only wanted to implement the INLINE macro for xlC in > >>> instanceKlass.inline.hpp. But then I realized that we also define > >>> NOINLINE in various other files so I decided to do it "the right way" > >>> and clean up the code a little bit. > >>> > >>> I've now moved the definition of the INLINE/NOINLINE macros to > >>> globalDefinitions_.hpp. In the case where there is no > >>> compiler-specific definition, globalDefinitions.hpp defines empty > >>> defaults for the macros. > >>> > >>> I've also renamed INLINE to ALWAYSINLINE to match its intention more > >>> clearly. > >>> > >>> Currently NOINLINE is really only defined on Linux. This is the same > >>> behavior we had before the change. Following some more details: > >>> > >>> os_linux.cpp > >>> > >>> - removed the handling for gcc < 3 (even we at SAP don't use this > anymore > >>> :) > >>> > >>> objectMonitor.cpp, synchronizer.cpp > >>> > >>> - completely removed the annotation with NOINLNE which is there since > >>> pre-OpenJDK times already. The comment mentions that this was required > >>> to prevent build-time failures with 'older' versions of GCC. But we > >>> already build without 'NOINLINE' on Linux/ppc64 since years and I've > >>> also tested that it still works on Linux/x86. > >>> > >>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, > >>> Solaris/SPARC, MacOS X, AIX and Windows. > >>> > >>> Regards, > >>> Volker > >> > >> > From thomas.stuefe at gmail.com Fri Mar 11 11:22:48 2016 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Fri, 11 Mar 2016 12:22:48 +0100 Subject: UL: logging before initialization? In-Reply-To: <56E27E4D.3060108@oracle.com> References: <56E229A8.4020907@oracle.com> <56E27E4D.3060108@oracle.com> Message-ID: Hi David, Marcus, thanks for thinking about this! Please find my comments inline. On Fri, Mar 11, 2016 at 9:14 AM, Marcus Larsson wrote: > Hi, > > On 2016-03-11 03:12, David Holmes wrote: > >> Hi Thomas, >> >> Expanding to hotspot-dev as UL was not designed/built by the runtime team. >> >> My comments below based on my limited understanding of UL. >> >> On 11/03/2016 2:25 AM, Thomas St?fe wrote: >> >>> Hi all, >>> >>> I wanted to use UL to log some information from early OS initialization >>> but >>> found that we initialize logging quite late. It is initialized way after >>> os::init() runs. >>> >> >> There are various dependencies in the unified logging framework that >> prevent it (or at least parts of it) from being used early eg: >> - argument parsing and log configuration >> - existence of current thread (for logStreams) >> > > Currently, the framework can be used as soon as static initialization is > done. This doesn't include the logStreams of course since they require > resource allocations. The problem is as you say that there is no way to > configure the logging before parsing the -Xlog command. This means up until > that point the default configuration will apply, which means warnings and > errors to stdout. > > >> I also see that warnings and errors are printed unconditionally even >>> before, only log calls for levels <= info are quietly swallowed. >>> >> >> Are those warnings/errors using UL? I suspect not. >> > > They could be, since errors and warnings are enabled by default. They are from UL. I see errors and warnings. Decorators seem to be off though, e.g. the timestamp, because they rely on initialization in os::init(). But nothing serious which breaks logging as long as one is fine with default settings. > > > >> Silent swallowing is not good though. >> >> Would there be a way to move UL initialization and parsing of -Xlog >>> Arguments to an earlier point to be able to use logging in os::init()? >>> >> >> I don't see how you could utilize tags and levels until after full >> initialization of the logging system, so that would preclude using it as >> early as os::init. >> > > It is a possible solution I guess. I don't know how dependent argument > parsing is on other initialization. There would always be some part of the > initialization where you only have warning and error logging unless we do > the parsing first thing during startup, which I assume will be impossible. > > Sure, the logging system must be fully initialized to use it. However, I argue that the logging system should be as independent as possible from the rest of the VM, so not rely on VM initialization. If that is the case - and I think it is now - then logging initialization and -Xlog parsing can be moved up in Thread::create_vm() to before os::init(). I would even argue that if this does not work, it is an error. For example, if we were to require Thread::current() to work for logging,e.g. for log decorators, this would mean logging breaks if Thread::current() is not available. So, if we make the logging system work for pre-initialization time, and add regression tests for this, this is a pretty good way to keep the logging system healthy and robust and avoid too much dependencies into the VM. I would think that the logging system as it is now is already robust - the fact that it works, with default settings, right after static initialization is a good sign. So, we could probably move initialization and -Xlog parsing to an earlier point with not much work. > >> Or, if that is not possible, would there be a way to delay printing of >>> early logging calls to after logging initialization and then print them >>> out >>> in one go? I think this would be not trivial though: one would have to >>> collect all logging output in memory somewhere - because we do not yet >>> know >>> which tags are switched on - and then, once -Xlog is parsed, filter it by >>> tag before printing it out. >>> >> >> Yeah that seems difficult/complex given the problem that the VM is in the >> early stages of initialization >> >> I really do not like this solution either, I only added this for completeness and to make my first proposal look better in comparison :) > What do you think, would that be a worthwhile change? I am a bit unhappy >>> about how logging calls are quietly swallowed, so for any code which runs >>> at VM initialization, one always has to keep in mind that UL may not yet >>> be >>> initialized. >>> >> >> Not a new problem (adding more code during VM initialization) but one >> that is getting more complicated :) >> > > I think it would perhaps be worthwhile if there's demand for a bunch of > info to trace level logging from startup code (before argument parsing). > > At least in the AIX port we have a lot of tracing going on very early. For platform porters, OS initialization is a very interesting time. We have now a very primitive trace there which I would love to switch to UL, but right now the trace output would just be swallowed by not-yet-initialized UL. Thank you, Thomas > Thanks, > Marcus > > > >> Cheers, >> David >> >> Kind Regards, Thomas >>> >>> > From david.holmes at oracle.com Fri Mar 11 12:41:59 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 11 Mar 2016 22:41:59 +1000 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> Message-ID: <56E2BD17.9060200@oracle.com> On 11/03/2016 7:45 PM, Volker Simonis wrote: > On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin > wrote: >> Volker, >> >> On 2016-03-11 10:31, Volker Simonis wrote: >>> >>> Hi Dan, >>> >>> thanks for the hint. I've linked the two issues together in JBS and I >>> can close the second one as duplicate once the fix is committed. >>> >>> How can I use two bug IDs in a changeset? Should I just put it in an >>> additional "Summary:" line? >> >> >> The changeset format actually allows multiple bug ids in a single commit, >> the format is: >> >> XXXXXXX: Bug title 1 >> YYYYYYY: Bug title 2 >> Summary: foo >> Reviewed-by: bar >> >> See >> http://openjdk.java.net/guide/producingChangeset.html >> > > Ah, I see. Thanks for the info. > Nevertheless I'd prefer to use one single bug only and close the other > as duplicate. > > I personally think multiple bug IDs are confusing (and they break our > internal integration scripts :) Agreed. If there are two bugs for the same issue then one should be closed as a duplicate and only a single bugid used. It would be extremely rare where one changeset needed to fix two completely independent bugs IMHO. David > Regards, > Volker > >> /Mikael >> >> >>> >>> As regards to content, I really think the annotations aren't needed >>> any more. I've tried with gcc4.1.2 which is the oldest we are using it >>> it works perfectly. >>> >>> Regards, >>> Volker >>> >>> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >>> wrote: >>>> >>>> Hi Volker, >>>> >>>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked via: >>>> >>>> JDK-8049103 investigate whether inlining still needs to be inhibited in >>>> objectMonitor.cpp and synchronizer.cpp >>>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>>> >>>> Feel free use both bug IDs in your changeset. >>>> >>>> Dan >>>> >>>> >>>> >>>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>>> >>>>> >>>>> Hi, >>>>> >>>>> can I please have a review and a sponsor for the following clean-up >>>>> change: >>>>> >>>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>>> >>>>> First I only wanted to implement the INLINE macro for xlC in >>>>> instanceKlass.inline.hpp. But then I realized that we also define >>>>> NOINLINE in various other files so I decided to do it "the right way" >>>>> and clean up the code a little bit. >>>>> >>>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>>> globalDefinitions_.hpp. In the case where there is no >>>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>>> defaults for the macros. >>>>> >>>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>>> clearly. >>>>> >>>>> Currently NOINLINE is really only defined on Linux. This is the same >>>>> behavior we had before the change. Following some more details: >>>>> >>>>> os_linux.cpp >>>>> >>>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>>> anymore >>>>> :) >>>>> >>>>> objectMonitor.cpp, synchronizer.cpp >>>>> >>>>> - completely removed the annotation with NOINLNE which is there since >>>>> pre-OpenJDK times already. The comment mentions that this was required >>>>> to prevent build-time failures with 'older' versions of GCC. But we >>>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>>> also tested that it still works on Linux/x86. >>>>> >>>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>>> >>>>> Regards, >>>>> Volker >>>> >>>> >>>> >> From david.holmes at oracle.com Fri Mar 11 12:53:39 2016 From: david.holmes at oracle.com (David Holmes) Date: Fri, 11 Mar 2016 22:53:39 +1000 Subject: UL: logging before initialization? In-Reply-To: References: <56E229A8.4020907@oracle.com> <56E27E4D.3060108@oracle.com> Message-ID: <56E2BFD3.7060306@oracle.com> On 11/03/2016 9:22 PM, Thomas St?fe wrote: > Hi David, Marcus, > > thanks for thinking about this! Please find my comments inline. > > On Fri, Mar 11, 2016 at 9:14 AM, Marcus Larsson > > wrote: > > Hi, > > On 2016-03-11 03:12, David Holmes wrote: > > Hi Thomas, > > Expanding to hotspot-dev as UL was not designed/built by the > runtime team. > > My comments below based on my limited understanding of UL. > > On 11/03/2016 2:25 AM, Thomas St?fe wrote: > > Hi all, > > I wanted to use UL to log some information from early OS > initialization but > found that we initialize logging quite late. It is > initialized way after > os::init() runs. > > > There are various dependencies in the unified logging framework > that prevent it (or at least parts of it) from being used early eg: > - argument parsing and log configuration > - existence of current thread (for logStreams) > > > Currently, the framework can be used as soon as static > initialization is done. This doesn't include the logStreams of > course since they require resource allocations. The problem is as > you say that there is no way to configure the logging before parsing > the -Xlog command. This means up until that point the default > configuration will apply, which means warnings and errors to stdout. > > > I also see that warnings and errors are printed > unconditionally even > before, only log calls for levels <= info are quietly swallowed. > > > Are those warnings/errors using UL? I suspect not. > > > They could be, since errors and warnings are enabled by default. > > > They are from UL. I see errors and warnings. Decorators seem to be off > though, e.g. the timestamp, because they rely on initialization in > os::init(). But nothing serious which breaks logging as long as one is > fine with default settings. > > > > > Silent swallowing is not good though. > > Would there be a way to move UL initialization and parsing > of -Xlog > Arguments to an earlier point to be able to use logging in > os::init()? > > > I don't see how you could utilize tags and levels until after > full initialization of the logging system, so that would > preclude using it as early as os::init. > > > It is a possible solution I guess. I don't know how dependent > argument parsing is on other initialization. There would always be > some part of the initialization where you only have warning and > error logging unless we do the parsing first thing during startup, > which I assume will be impossible. > > > Sure, the logging system must be fully initialized to use it. However, I > argue that the logging system should be as independent as possible from > the rest of the VM, so not rely on VM initialization. If that is the > case - and I think it is now - then logging initialization and -Xlog > parsing can be moved up in Thread::create_vm() to before os::init(). You would need to examine the complete transitive closure of logging code to see if such a move is feasible. > I would even argue that if this does not work, it is an error. For > example, if we were to require Thread::current() to work for > logging,e.g. for log decorators, this would mean logging breaks if > Thread::current() is not available. So, if we make the logging system > work for pre-initialization time, and add regression tests for this, > this is a pretty good way to keep the logging system healthy and robust > and avoid too much dependencies into the VM. > > I would think that the logging system as it is now is already robust - > the fact that it works, with default settings, right after static > initialization is a good sign. So, we could probably move initialization > and -Xlog parsing to an earlier point with not much work. While the logging system has taken a number of steps to make itself immune to some initialization issues (for example "locking" uses a semaphore and doesn't rely on Thread::current()), different parts of the system have different dependencies - which seems unavoidable to me. I don't know if it would be possible to enable a subset of the API earlier in the initialization sequence by refactoring some of the configuration logic and argument parsing. David ----- > > Or, if that is not possible, would there be a way to delay > printing of > early logging calls to after logging initialization and then > print them out > in one go? I think this would be not trivial though: one > would have to > collect all logging output in memory somewhere - because we > do not yet know > which tags are switched on - and then, once -Xlog is parsed, > filter it by > tag before printing it out. > > > Yeah that seems difficult/complex given the problem that the VM > is in the early stages of initialization > > > I really do not like this solution either, I only added this for > completeness and to make my first proposal look better in comparison :) > > What do you think, would that be a worthwhile change? I am a > bit unhappy > about how logging calls are quietly swallowed, so for any > code which runs > at VM initialization, one always has to keep in mind that UL > may not yet be > initialized. > > > Not a new problem (adding more code during VM initialization) > but one that is getting more complicated :) > > > I think it would perhaps be worthwhile if there's demand for a bunch > of info to trace level logging from startup code (before argument > parsing). > > > At least in the AIX port we have a lot of tracing going on very early. > For platform porters, OS initialization is a very interesting time. We > have now a very primitive trace there which I would love to switch to > UL, but right now the trace output would just be swallowed by > not-yet-initialized UL. > > Thank you, > > Thomas > > Thanks, > Marcus > > > > Cheers, > David > > Kind Regards, Thomas > > > From coleen.phillimore at oracle.com Fri Mar 11 13:08:59 2016 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Mar 2016 08:08:59 -0500 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: <56E2BD17.9060200@oracle.com> References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> <56E2BD17.9060200@oracle.com> Message-ID: <56E2C36B.30304@oracle.com> This is a nice cleanup. I'll sponsor it but I have a question. There's some directives to not inline in allocation.hpp that are needed by NMT: // noinline attribute #ifdef _WINDOWS #define _NOINLINE_ __declspec(noinline) #else #if __GNUC__ < 3 // gcc 2.x does not support noinline attribute #define _NOINLINE_ #else #define _NOINLINE_ __attribute__ ((noinline)) #endif #endif But in your changes: +// Inlining support +// MSVC has '__declspec(noinline)' but it only applies to member functions +#define NOINLINE +#define ALWAYSINLINE __forceinline Would there be an error if you used __declspec(noinline) on non-member functions, so that you can use this directive and extend the cleanup to allocation.hpp ? Thanks, Coleen On 3/11/16 7:41 AM, David Holmes wrote: > On 11/03/2016 7:45 PM, Volker Simonis wrote: >> On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin >> wrote: >>> Volker, >>> >>> On 2016-03-11 10:31, Volker Simonis wrote: >>>> >>>> Hi Dan, >>>> >>>> thanks for the hint. I've linked the two issues together in JBS and I >>>> can close the second one as duplicate once the fix is committed. >>>> >>>> How can I use two bug IDs in a changeset? Should I just put it in an >>>> additional "Summary:" line? >>> >>> >>> The changeset format actually allows multiple bug ids in a single >>> commit, >>> the format is: >>> >>> XXXXXXX: Bug title 1 >>> YYYYYYY: Bug title 2 >>> Summary: foo >>> Reviewed-by: bar >>> >>> See >>> http://openjdk.java.net/guide/producingChangeset.html >>> >> >> Ah, I see. Thanks for the info. >> Nevertheless I'd prefer to use one single bug only and close the other >> as duplicate. >> >> I personally think multiple bug IDs are confusing (and they break our >> internal integration scripts :) > > Agreed. If there are two bugs for the same issue then one should be > closed as a duplicate and only a single bugid used. > > It would be extremely rare where one changeset needed to fix two > completely independent bugs IMHO. > > David > >> Regards, >> Volker >> >>> /Mikael >>> >>> >>>> >>>> As regards to content, I really think the annotations aren't needed >>>> any more. I've tried with gcc4.1.2 which is the oldest we are using it >>>> it works perfectly. >>>> >>>> Regards, >>>> Volker >>>> >>>> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >>>> wrote: >>>>> >>>>> Hi Volker, >>>>> >>>>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is >>>>> tracked via: >>>>> >>>>> JDK-8049103 investigate whether inlining still needs to be >>>>> inhibited in >>>>> objectMonitor.cpp and synchronizer.cpp >>>>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>>>> >>>>> Feel free use both bug IDs in your changeset. >>>>> >>>>> Dan >>>>> >>>>> >>>>> >>>>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>>>> >>>>>> >>>>>> Hi, >>>>>> >>>>>> can I please have a review and a sponsor for the following clean-up >>>>>> change: >>>>>> >>>>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>>>> >>>>>> First I only wanted to implement the INLINE macro for xlC in >>>>>> instanceKlass.inline.hpp. But then I realized that we also define >>>>>> NOINLINE in various other files so I decided to do it "the right >>>>>> way" >>>>>> and clean up the code a little bit. >>>>>> >>>>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>>>> globalDefinitions_.hpp. In the case where there is no >>>>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>>>> defaults for the macros. >>>>>> >>>>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>>>> clearly. >>>>>> >>>>>> Currently NOINLINE is really only defined on Linux. This is the same >>>>>> behavior we had before the change. Following some more details: >>>>>> >>>>>> os_linux.cpp >>>>>> >>>>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>>>> anymore >>>>>> :) >>>>>> >>>>>> objectMonitor.cpp, synchronizer.cpp >>>>>> >>>>>> - completely removed the annotation with NOINLNE which is there >>>>>> since >>>>>> pre-OpenJDK times already. The comment mentions that this was >>>>>> required >>>>>> to prevent build-time failures with 'older' versions of GCC. But we >>>>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>>>> also tested that it still works on Linux/x86. >>>>>> >>>>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>>>> >>>>>> Regards, >>>>>> Volker >>>>> >>>>> >>>>> >>> From thomas.stuefe at gmail.com Fri Mar 11 13:30:14 2016 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Fri, 11 Mar 2016 14:30:14 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: <56E2C36B.30304@oracle.com> References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> <56E2BD17.9060200@oracle.com> <56E2C36B.30304@oracle.com> Message-ID: Volker, Coleen, I did a quick test on windows, __declspec(noinline) works for non-member functions too and prevents inlining. Kind regards, Thomas On Fri, Mar 11, 2016 at 2:08 PM, Coleen Phillimore < coleen.phillimore at oracle.com> wrote: > > This is a nice cleanup. I'll sponsor it but I have a question. > > There's some directives to not inline in allocation.hpp that are needed by > NMT: > > // noinline attribute > #ifdef _WINDOWS > #define _NOINLINE_ __declspec(noinline) > #else > #if __GNUC__ < 3 // gcc 2.x does not support noinline attribute > #define _NOINLINE_ > #else > #define _NOINLINE_ __attribute__ ((noinline)) > #endif > #endif > > > But in your changes: > > +// Inlining support > +// MSVC has '__declspec(noinline)' but it only applies to member functions > +#define NOINLINE > +#define ALWAYSINLINE __forceinline > > > Would there be an error if you used __declspec(noinline) on non-member > functions, so that you can use this directive and extend the cleanup to > allocation.hpp ? > > Thanks, > Coleen > > > > On 3/11/16 7:41 AM, David Holmes wrote: > >> On 11/03/2016 7:45 PM, Volker Simonis wrote: >> >>> On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin >>> wrote: >>> >>>> Volker, >>>> >>>> On 2016-03-11 10:31, Volker Simonis wrote: >>>> >>>>> >>>>> Hi Dan, >>>>> >>>>> thanks for the hint. I've linked the two issues together in JBS and I >>>>> can close the second one as duplicate once the fix is committed. >>>>> >>>>> How can I use two bug IDs in a changeset? Should I just put it in an >>>>> additional "Summary:" line? >>>>> >>>> >>>> >>>> The changeset format actually allows multiple bug ids in a single >>>> commit, >>>> the format is: >>>> >>>> XXXXXXX: Bug title 1 >>>> YYYYYYY: Bug title 2 >>>> Summary: foo >>>> Reviewed-by: bar >>>> >>>> See >>>> http://openjdk.java.net/guide/producingChangeset.html >>>> >>>> >>> Ah, I see. Thanks for the info. >>> Nevertheless I'd prefer to use one single bug only and close the other >>> as duplicate. >>> >>> I personally think multiple bug IDs are confusing (and they break our >>> internal integration scripts :) >>> >> >> Agreed. If there are two bugs for the same issue then one should be >> closed as a duplicate and only a single bugid used. >> >> It would be extremely rare where one changeset needed to fix two >> completely independent bugs IMHO. >> >> David >> >> Regards, >>> Volker >>> >>> /Mikael >>>> >>>> >>>> >>>>> As regards to content, I really think the annotations aren't needed >>>>> any more. I've tried with gcc4.1.2 which is the oldest we are using it >>>>> it works perfectly. >>>>> >>>>> Regards, >>>>> Volker >>>>> >>>>> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >>>>> wrote: >>>>> >>>>>> >>>>>> Hi Volker, >>>>>> >>>>>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked >>>>>> via: >>>>>> >>>>>> JDK-8049103 investigate whether inlining still needs to be inhibited >>>>>> in >>>>>> objectMonitor.cpp and synchronizer.cpp >>>>>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>>>>> >>>>>> Feel free use both bug IDs in your changeset. >>>>>> >>>>>> Dan >>>>>> >>>>>> >>>>>> >>>>>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> can I please have a review and a sponsor for the following clean-up >>>>>>> change: >>>>>>> >>>>>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>>>>> >>>>>>> First I only wanted to implement the INLINE macro for xlC in >>>>>>> instanceKlass.inline.hpp. But then I realized that we also define >>>>>>> NOINLINE in various other files so I decided to do it "the right way" >>>>>>> and clean up the code a little bit. >>>>>>> >>>>>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>>>>> globalDefinitions_.hpp. In the case where there is no >>>>>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>>>>> defaults for the macros. >>>>>>> >>>>>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>>>>> clearly. >>>>>>> >>>>>>> Currently NOINLINE is really only defined on Linux. This is the same >>>>>>> behavior we had before the change. Following some more details: >>>>>>> >>>>>>> os_linux.cpp >>>>>>> >>>>>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>>>>> anymore >>>>>>> :) >>>>>>> >>>>>>> objectMonitor.cpp, synchronizer.cpp >>>>>>> >>>>>>> - completely removed the annotation with NOINLNE which is there since >>>>>>> pre-OpenJDK times already. The comment mentions that this was >>>>>>> required >>>>>>> to prevent build-time failures with 'older' versions of GCC. But we >>>>>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>>>>> also tested that it still works on Linux/x86. >>>>>>> >>>>>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>>>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>>>>> >>>>>>> Regards, >>>>>>> Volker >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>> > From thomas.stuefe at gmail.com Fri Mar 11 14:34:09 2016 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Fri, 11 Mar 2016 15:34:09 +0100 Subject: UL: logging before initialization? In-Reply-To: <56E2BFD3.7060306@oracle.com> References: <56E229A8.4020907@oracle.com> <56E27E4D.3060108@oracle.com> <56E2BFD3.7060306@oracle.com> Message-ID: Hi David, On Fri, Mar 11, 2016 at 1:53 PM, David Holmes wrote: > On 11/03/2016 9:22 PM, Thomas St?fe wrote: > >> Hi David, Marcus, >> >> thanks for thinking about this! Please find my comments inline. >> >> On Fri, Mar 11, 2016 at 9:14 AM, Marcus Larsson >> > wrote: >> >> Hi, >> >> On 2016-03-11 03:12, David Holmes wrote: >> >> Hi Thomas, >> >> Expanding to hotspot-dev as UL was not designed/built by the >> runtime team. >> >> My comments below based on my limited understanding of UL. >> >> On 11/03/2016 2:25 AM, Thomas St?fe wrote: >> >> Hi all, >> >> I wanted to use UL to log some information from early OS >> initialization but >> found that we initialize logging quite late. It is >> initialized way after >> os::init() runs. >> >> >> There are various dependencies in the unified logging framework >> that prevent it (or at least parts of it) from being used early >> eg: >> - argument parsing and log configuration >> - existence of current thread (for logStreams) >> >> >> Currently, the framework can be used as soon as static >> initialization is done. This doesn't include the logStreams of >> course since they require resource allocations. The problem is as >> you say that there is no way to configure the logging before parsing >> the -Xlog command. This means up until that point the default >> configuration will apply, which means warnings and errors to stdout. >> >> >> I also see that warnings and errors are printed >> unconditionally even >> before, only log calls for levels <= info are quietly >> swallowed. >> >> >> Are those warnings/errors using UL? I suspect not. >> >> >> They could be, since errors and warnings are enabled by default. >> >> >> They are from UL. I see errors and warnings. Decorators seem to be off >> though, e.g. the timestamp, because they rely on initialization in >> os::init(). But nothing serious which breaks logging as long as one is >> fine with default settings. >> >> >> >> >> Silent swallowing is not good though. >> >> Would there be a way to move UL initialization and parsing >> of -Xlog >> Arguments to an earlier point to be able to use logging in >> os::init()? >> >> >> I don't see how you could utilize tags and levels until after >> full initialization of the logging system, so that would >> preclude using it as early as os::init. >> >> >> It is a possible solution I guess. I don't know how dependent >> argument parsing is on other initialization. There would always be >> some part of the initialization where you only have warning and >> error logging unless we do the parsing first thing during startup, >> which I assume will be impossible. >> >> >> Sure, the logging system must be fully initialized to use it. However, I >> argue that the logging system should be as independent as possible from >> the rest of the VM, so not rely on VM initialization. If that is the >> case - and I think it is now - then logging initialization and -Xlog >> parsing can be moved up in Thread::create_vm() to before os::init(). >> > > You would need to examine the complete transitive closure of logging code > to see if such a move is feasible. > > Not sure I understand. Making sure that the logging system itself does not contain deep VM dependencies should be feasible. If with "logging code" you mean logging calls by the various components, I would think that anyone introducing logging calls should not log anything which is not available at the time the logging call is executed. Or do I not understand? Thomas > I would even argue that if this does not work, it is an error. For >> example, if we were to require Thread::current() to work for >> logging,e.g. for log decorators, this would mean logging breaks if >> Thread::current() is not available. So, if we make the logging system >> work for pre-initialization time, and add regression tests for this, >> this is a pretty good way to keep the logging system healthy and robust >> and avoid too much dependencies into the VM. >> >> I would think that the logging system as it is now is already robust - >> the fact that it works, with default settings, right after static >> initialization is a good sign. So, we could probably move initialization >> and -Xlog parsing to an earlier point with not much work. >> > > While the logging system has taken a number of steps to make itself immune > to some initialization issues (for example "locking" uses a semaphore and > doesn't rely on Thread::current()), different parts of the system have > different dependencies - which seems unavoidable to me. I don't know if it > would be possible to enable a subset of the API earlier in the > initialization sequence by refactoring some of the configuration logic and > argument parsing. > > David > ----- > > > >> Or, if that is not possible, would there be a way to delay >> printing of >> early logging calls to after logging initialization and then >> print them out >> in one go? I think this would be not trivial though: one >> would have to >> collect all logging output in memory somewhere - because we >> do not yet know >> which tags are switched on - and then, once -Xlog is parsed, >> filter it by >> tag before printing it out. >> >> >> Yeah that seems difficult/complex given the problem that the VM >> is in the early stages of initialization >> >> >> I really do not like this solution either, I only added this for >> completeness and to make my first proposal look better in comparison :) >> >> What do you think, would that be a worthwhile change? I am a >> bit unhappy >> about how logging calls are quietly swallowed, so for any >> code which runs >> at VM initialization, one always has to keep in mind that UL >> may not yet be >> initialized. >> >> >> Not a new problem (adding more code during VM initialization) >> but one that is getting more complicated :) >> >> >> I think it would perhaps be worthwhile if there's demand for a bunch >> of info to trace level logging from startup code (before argument >> parsing). >> >> >> At least in the AIX port we have a lot of tracing going on very early. >> For platform porters, OS initialization is a very interesting time. We >> have now a very primitive trace there which I would love to switch to >> UL, but right now the trace output would just be swallowed by >> not-yet-initialized UL. >> >> Thank you, >> >> Thomas >> >> Thanks, >> Marcus >> >> >> >> Cheers, >> David >> >> Kind Regards, Thomas >> >> >> >> From lois.foltan at oracle.com Fri Mar 11 14:56:39 2016 From: lois.foltan at oracle.com (Lois Foltan) Date: Fri, 11 Mar 2016 09:56:39 -0500 Subject: Fwd: Project Jigsaw integration into JDK 9 In-Reply-To: <56E2DAEA.60609@oracle.com> References: <56E2DAEA.60609@oracle.com> Message-ID: <56E2DCA6.9090808@oracle.com> -------- Original Message -------- Subject: Project Jigsaw integration into JDK 9 Date: Fri, 11 Mar 2016 14:49:14 +0000 From: Alan Bateman To: jdk9-dev at openjdk.java.net Those on jigsaw-dev will be aware [1] that we have been planning to integrate a snapshot of the changes from the jigsaw/jake forest into JDK 9. More specifically, we are proposing to stabilize a snapshot of the module system that we have been working on in Project Jigsaw and integrate it into the JDK 9 main line. Once integrated then we will continue in Project Jigsaw on the remaining areas and issues. In terms of JEPs then this integration is JEP 200 [2], JEP 260 [3], JEP 261 [4] and JEP 282 [5]. In the case of JEP 260 then JDK internal APIs will be encapsulated with the work to get us to a jdk.unsupported module ongoing. In terms of the JCP then JSR 376 is the JSR that is defining the Java Platform Module System and is what JEP 261 is implementing. The JSR is expected to submit an Early Draft Review soon. For those that have not been following the work in Project Jigsaw then the main project main page [6] has links to a lot of resources. If you only have time to read one document then make sure to read The State of the Module System [7] as that gives an informal overview of the proposal and design. If you have time to read a second document then put JEP 261 on your reading list. The Risks and Assumptions section of the JEP has the complete list of compatibility issues that we are aware of. For the integration then we are proposing to integrate during the week of March 21 for jdk-9+111. We are keeping the week of March 27 for jdk-9+112 as backup in the event of issues. The proposal is to integrate directly into jdk9/jdk9 (master) and then immediately sync up jdk9/dev with the other forests to follow. The rational for going directly into master is that this is a large change and we would like it to be the only change in the weekly build. This is our third major milestone on this project, we integrated directly in master for the previous two milestones (JEP 201 and JEP 220) too. Code review [8] is ongoing and we expect to be iterating on the changes into next week so that we get the changes into a reasonable state to bring into JDK 9. Many people are involved to ensure that we have at least some coverage in all areas and repositories. I will send an update closer to the proposed integration date once it clearer whether we can make jdk-9+111. -Alan [1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-March/006484.html [2] http://openjdk.java.net/jeps/200 [3] http://openjdk.java.net/jeps/260 [4] http://openjdk.java.net/jeps/261 [5] http://openjdk.java.net/jeps/282 [6] http://openjdk.java.net/projects/jigsaw/ [7] http://openjdk.java.net/projects/jigsaw/spec/sotms/ [8] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-March/006525.html From volker.simonis at gmail.com Fri Mar 11 15:59:37 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 11 Mar 2016 16:59:37 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: <56E2C36B.30304@oracle.com> References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> <56E2BD17.9060200@oracle.com> <56E2C36B.30304@oracle.com> Message-ID: Hi Coleen, thanks for catching this. For some reason I missed the _NOINLINE_ macro in allocation.{cpp,hpp}. I've now defined NOINLINE to '__declspec(noinline)' in globalDefinitions_visCPP.hpp. Everything still compiles fine. The only difference to the previous code is that "Stack::push_segment()" from stack.inline.hpp is now not inlined on Windows any more. But as I wrote before, I don't think that makes a difference. Here's the new webrev: http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593.v2 Thanks for sponsoring, Volker On Fri, Mar 11, 2016 at 2:08 PM, Coleen Phillimore wrote: > > This is a nice cleanup. I'll sponsor it but I have a question. > > There's some directives to not inline in allocation.hpp that are needed by > NMT: > > // noinline attribute > #ifdef _WINDOWS > #define _NOINLINE_ __declspec(noinline) > #else > #if __GNUC__ < 3 // gcc 2.x does not support noinline attribute > #define _NOINLINE_ > #else > #define _NOINLINE_ __attribute__ ((noinline)) > #endif > #endif > > > But in your changes: > > +// Inlining support > +// MSVC has '__declspec(noinline)' but it only applies to member functions > +#define NOINLINE > +#define ALWAYSINLINE __forceinline > > > Would there be an error if you used __declspec(noinline) on non-member > functions, so that you can use this directive and extend the cleanup to > allocation.hpp ? > > Thanks, > Coleen > > > > On 3/11/16 7:41 AM, David Holmes wrote: >> >> On 11/03/2016 7:45 PM, Volker Simonis wrote: >>> >>> On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin >>> wrote: >>>> >>>> Volker, >>>> >>>> On 2016-03-11 10:31, Volker Simonis wrote: >>>>> >>>>> >>>>> Hi Dan, >>>>> >>>>> thanks for the hint. I've linked the two issues together in JBS and I >>>>> can close the second one as duplicate once the fix is committed. >>>>> >>>>> How can I use two bug IDs in a changeset? Should I just put it in an >>>>> additional "Summary:" line? >>>> >>>> >>>> >>>> The changeset format actually allows multiple bug ids in a single >>>> commit, >>>> the format is: >>>> >>>> XXXXXXX: Bug title 1 >>>> YYYYYYY: Bug title 2 >>>> Summary: foo >>>> Reviewed-by: bar >>>> >>>> See >>>> http://openjdk.java.net/guide/producingChangeset.html >>>> >>> >>> Ah, I see. Thanks for the info. >>> Nevertheless I'd prefer to use one single bug only and close the other >>> as duplicate. >>> >>> I personally think multiple bug IDs are confusing (and they break our >>> internal integration scripts :) >> >> >> Agreed. If there are two bugs for the same issue then one should be closed >> as a duplicate and only a single bugid used. >> >> It would be extremely rare where one changeset needed to fix two >> completely independent bugs IMHO. >> >> David >> >>> Regards, >>> Volker >>> >>>> /Mikael >>>> >>>> >>>>> >>>>> As regards to content, I really think the annotations aren't needed >>>>> any more. I've tried with gcc4.1.2 which is the oldest we are using it >>>>> it works perfectly. >>>>> >>>>> Regards, >>>>> Volker >>>>> >>>>> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >>>>> wrote: >>>>>> >>>>>> >>>>>> Hi Volker, >>>>>> >>>>>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked >>>>>> via: >>>>>> >>>>>> JDK-8049103 investigate whether inlining still needs to be inhibited >>>>>> in >>>>>> objectMonitor.cpp and synchronizer.cpp >>>>>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>>>>> >>>>>> Feel free use both bug IDs in your changeset. >>>>>> >>>>>> Dan >>>>>> >>>>>> >>>>>> >>>>>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> can I please have a review and a sponsor for the following clean-up >>>>>>> change: >>>>>>> >>>>>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>>>>> >>>>>>> First I only wanted to implement the INLINE macro for xlC in >>>>>>> instanceKlass.inline.hpp. But then I realized that we also define >>>>>>> NOINLINE in various other files so I decided to do it "the right way" >>>>>>> and clean up the code a little bit. >>>>>>> >>>>>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>>>>> globalDefinitions_.hpp. In the case where there is no >>>>>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>>>>> defaults for the macros. >>>>>>> >>>>>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>>>>> clearly. >>>>>>> >>>>>>> Currently NOINLINE is really only defined on Linux. This is the same >>>>>>> behavior we had before the change. Following some more details: >>>>>>> >>>>>>> os_linux.cpp >>>>>>> >>>>>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>>>>> anymore >>>>>>> :) >>>>>>> >>>>>>> objectMonitor.cpp, synchronizer.cpp >>>>>>> >>>>>>> - completely removed the annotation with NOINLNE which is there since >>>>>>> pre-OpenJDK times already. The comment mentions that this was >>>>>>> required >>>>>>> to prevent build-time failures with 'older' versions of GCC. But we >>>>>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>>>>> also tested that it still works on Linux/x86. >>>>>>> >>>>>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>>>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>>>>> >>>>>>> Regards, >>>>>>> Volker >>>>>> >>>>>> >>>>>> >>>>>> >>>> > From volker.simonis at gmail.com Fri Mar 11 16:00:06 2016 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 11 Mar 2016 17:00:06 +0100 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> <56E2BD17.9060200@oracle.com> <56E2C36B.30304@oracle.com> Message-ID: Thanks for checking Thomas! Volker On Fri, Mar 11, 2016 at 2:30 PM, Thomas St?fe wrote: > Volker, Coleen, > > I did a quick test on windows, __declspec(noinline) works for non-member > functions too and prevents inlining. > > Kind regards, Thomas > > On Fri, Mar 11, 2016 at 2:08 PM, Coleen Phillimore > wrote: >> >> >> This is a nice cleanup. I'll sponsor it but I have a question. >> >> There's some directives to not inline in allocation.hpp that are needed by >> NMT: >> >> // noinline attribute >> #ifdef _WINDOWS >> #define _NOINLINE_ __declspec(noinline) >> #else >> #if __GNUC__ < 3 // gcc 2.x does not support noinline attribute >> #define _NOINLINE_ >> #else >> #define _NOINLINE_ __attribute__ ((noinline)) >> #endif >> #endif >> >> >> But in your changes: >> >> +// Inlining support >> +// MSVC has '__declspec(noinline)' but it only applies to member >> functions >> +#define NOINLINE >> +#define ALWAYSINLINE __forceinline >> >> >> Would there be an error if you used __declspec(noinline) on non-member >> functions, so that you can use this directive and extend the cleanup to >> allocation.hpp ? >> >> Thanks, >> Coleen >> >> >> >> On 3/11/16 7:41 AM, David Holmes wrote: >>> >>> On 11/03/2016 7:45 PM, Volker Simonis wrote: >>>> >>>> On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin >>>> wrote: >>>>> >>>>> Volker, >>>>> >>>>> On 2016-03-11 10:31, Volker Simonis wrote: >>>>>> >>>>>> >>>>>> Hi Dan, >>>>>> >>>>>> thanks for the hint. I've linked the two issues together in JBS and I >>>>>> can close the second one as duplicate once the fix is committed. >>>>>> >>>>>> How can I use two bug IDs in a changeset? Should I just put it in an >>>>>> additional "Summary:" line? >>>>> >>>>> >>>>> >>>>> The changeset format actually allows multiple bug ids in a single >>>>> commit, >>>>> the format is: >>>>> >>>>> XXXXXXX: Bug title 1 >>>>> YYYYYYY: Bug title 2 >>>>> Summary: foo >>>>> Reviewed-by: bar >>>>> >>>>> See >>>>> http://openjdk.java.net/guide/producingChangeset.html >>>>> >>>> >>>> Ah, I see. Thanks for the info. >>>> Nevertheless I'd prefer to use one single bug only and close the other >>>> as duplicate. >>>> >>>> I personally think multiple bug IDs are confusing (and they break our >>>> internal integration scripts :) >>> >>> >>> Agreed. If there are two bugs for the same issue then one should be >>> closed as a duplicate and only a single bugid used. >>> >>> It would be extremely rare where one changeset needed to fix two >>> completely independent bugs IMHO. >>> >>> David >>> >>>> Regards, >>>> Volker >>>> >>>>> /Mikael >>>>> >>>>> >>>>>> >>>>>> As regards to content, I really think the annotations aren't needed >>>>>> any more. I've tried with gcc4.1.2 which is the oldest we are using it >>>>>> it works perfectly. >>>>>> >>>>>> Regards, >>>>>> Volker >>>>>> >>>>>> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >>>>>> wrote: >>>>>>> >>>>>>> >>>>>>> Hi Volker, >>>>>>> >>>>>>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked >>>>>>> via: >>>>>>> >>>>>>> JDK-8049103 investigate whether inlining still needs to be inhibited >>>>>>> in >>>>>>> objectMonitor.cpp and synchronizer.cpp >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>>>>>> >>>>>>> Feel free use both bug IDs in your changeset. >>>>>>> >>>>>>> Dan >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> can I please have a review and a sponsor for the following clean-up >>>>>>>> change: >>>>>>>> >>>>>>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>>>>>> >>>>>>>> First I only wanted to implement the INLINE macro for xlC in >>>>>>>> instanceKlass.inline.hpp. But then I realized that we also define >>>>>>>> NOINLINE in various other files so I decided to do it "the right >>>>>>>> way" >>>>>>>> and clean up the code a little bit. >>>>>>>> >>>>>>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>>>>>> globalDefinitions_.hpp. In the case where there is no >>>>>>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>>>>>> defaults for the macros. >>>>>>>> >>>>>>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>>>>>> clearly. >>>>>>>> >>>>>>>> Currently NOINLINE is really only defined on Linux. This is the same >>>>>>>> behavior we had before the change. Following some more details: >>>>>>>> >>>>>>>> os_linux.cpp >>>>>>>> >>>>>>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>>>>>> anymore >>>>>>>> :) >>>>>>>> >>>>>>>> objectMonitor.cpp, synchronizer.cpp >>>>>>>> >>>>>>>> - completely removed the annotation with NOINLNE which is there >>>>>>>> since >>>>>>>> pre-OpenJDK times already. The comment mentions that this was >>>>>>>> required >>>>>>>> to prevent build-time failures with 'older' versions of GCC. But we >>>>>>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>>>>>> also tested that it still works on Linux/x86. >>>>>>>> >>>>>>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>>>>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Volker >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>> >> > From erik.joelsson at oracle.com Fri Mar 11 16:31:03 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Fri, 11 Mar 2016 17:31:03 +0100 Subject: RFR: JDK-8151653: Hotspot build does not respect --enable-openjdk-only Message-ID: <56E2F2C7.9090301@oracle.com> Hello, When building hotspot with closed sources present and configuring with --enable-openjdk-only, various closed parts are included in the build anyway, at least on Windows. This needs to be fixed in preparation for the new hotspot build for build output comparisons to be meaningful between the old and new. The major culprit here, which applies to all platforms, is the trace source generation. The base trace.xml uses XInclude to explicitly and unconditionally include closed xml files if present. I'm fixing this by introducing a closed version of trace.xml which includes the open and closed parts, while the open trace.xml only includes the open parts. The rest of the changes are just for Windows, making sure the OPENJDK variable is propagated into the nmake build and making all conditionals on including closed source also check that variable. Bug: https://bugs.openjdk.java.net/browse/JDK-8151653 Webrev: http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.01/index.html /Erik From jon.masamitsu at oracle.com Fri Mar 11 17:02:34 2016 From: jon.masamitsu at oracle.com (Jon Masamitsu) Date: Fri, 11 Mar 2016 09:02:34 -0800 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E279ED.4070008@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1E9C3.40006@oracle.com> <56E1F21E.80106@oracle.com> <56E1F9A8.2000608@oracle.com> <56E279ED.4070008@oracle.com> Message-ID: <56E2FA2A.6080207@oracle.com> On 3/10/2016 11:55 PM, Vladimir Ivanov wrote: > >>> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/ >> >> Yes, like that. >> >> The change in the Metachunk constructor changes semantics in that >> the original code mangled the whole chunk, not just the payload. I'd >> prefer that the original code is left. The little bit of code >> duplication is >> OK. > I think they are equivalent: > > _top = initial_top(); > size_t data_word_size = pointer_delta(end(), _top, sizeof(MetaWord)); > Copy::fill_to_words((HeapWord*)_top, > data_word_size, > metadata_chunk_initialize); > vs > > HeapWord* start = (HeapWord*)initial_top(); > size_t size = word_size() - overhead(); > Copy::fill_to_words(start, size, word_value); > > > _top == initial_top() and data_word_size == size: > > end() == this + _word_size > pointer_delta == (end() - _top) / sizeof(MetaWord) You're right. I stand corrected. > >> http://cr.openjdk.java.net/~vlivanov/8151623/webrev.02/src/share/vm/memory/metachunk.hpp.frames.html >> >> >> Please use the style "word_value" instead of "wordValue". > Will fix. Thanks. Jon > >> If there is a mistake in the mangling of a Metablock, that would >> show up when the Metaspace shrinks. Can you check that the testing >> has some Metaspace shrinking. I think that -Xlog:gc*=trace would >> show the needed output. > Ok, I'll verify that. > > Best regards, > Vladimir Ivanov From erik.joelsson at oracle.com Fri Mar 11 17:16:42 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Fri, 11 Mar 2016 18:16:42 +0100 Subject: RFR: JDK-8151656: Minor tweaks to old Hotspot build to ease comparison with new Message-ID: <56E2FD7A.4070101@oracle.com> In preparation for the new Hotspot build, there are a few changes to the old build that needs to happen first. These changes should be harmless, but do impact the generated binaries some. These changes are: * Standardizing sort order for objects on link command line on Windows to a locale independent order. * Working around compare differences caused by the __FILE__ macro in certain generated files by overriding the value of __FILE__ in those files. By making these changes first and separate from introducing the new build we reduce the potential impact of when we do introduce the new build. Bug: https://bugs.openjdk.java.net/browse/JDK-8151656 Webrev: http://cr.openjdk.java.net/~erikj/8151656/index.html /Erik From coleen.phillimore at oracle.com Fri Mar 11 21:27:52 2016 From: coleen.phillimore at oracle.com (Coleen Phillimore) Date: Fri, 11 Mar 2016 16:27:52 -0500 Subject: RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support In-Reply-To: References: <56E1B552.6080400@oracle.com> <56E2919E.5080400@oracle.com> <56E2BD17.9060200@oracle.com> <56E2C36B.30304@oracle.com> Message-ID: <56E33858.5050202@oracle.com> Looks good, sponsoring it now. Coleen On 3/11/16 10:59 AM, Volker Simonis wrote: > Hi Coleen, > > thanks for catching this. For some reason I missed the _NOINLINE_ > macro in allocation.{cpp,hpp}. > > I've now defined NOINLINE to '__declspec(noinline)' in > globalDefinitions_visCPP.hpp. Everything still compiles fine. The only > difference to the previous code is that "Stack::push_segment()" > from stack.inline.hpp is now not inlined on Windows any more. But as I > wrote before, I don't think that makes a difference. > > Here's the new webrev: > > http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593.v2 > > Thanks for sponsoring, > Volker > > On Fri, Mar 11, 2016 at 2:08 PM, Coleen Phillimore > wrote: >> This is a nice cleanup. I'll sponsor it but I have a question. >> >> There's some directives to not inline in allocation.hpp that are needed by >> NMT: >> >> // noinline attribute >> #ifdef _WINDOWS >> #define _NOINLINE_ __declspec(noinline) >> #else >> #if __GNUC__ < 3 // gcc 2.x does not support noinline attribute >> #define _NOINLINE_ >> #else >> #define _NOINLINE_ __attribute__ ((noinline)) >> #endif >> #endif >> >> >> But in your changes: >> >> +// Inlining support >> +// MSVC has '__declspec(noinline)' but it only applies to member functions >> +#define NOINLINE >> +#define ALWAYSINLINE __forceinline >> >> >> Would there be an error if you used __declspec(noinline) on non-member >> functions, so that you can use this directive and extend the cleanup to >> allocation.hpp ? >> >> Thanks, >> Coleen >> >> >> >> On 3/11/16 7:41 AM, David Holmes wrote: >>> On 11/03/2016 7:45 PM, Volker Simonis wrote: >>>> On Fri, Mar 11, 2016 at 10:36 AM, Mikael Gerdin >>>> wrote: >>>>> Volker, >>>>> >>>>> On 2016-03-11 10:31, Volker Simonis wrote: >>>>>> >>>>>> Hi Dan, >>>>>> >>>>>> thanks for the hint. I've linked the two issues together in JBS and I >>>>>> can close the second one as duplicate once the fix is committed. >>>>>> >>>>>> How can I use two bug IDs in a changeset? Should I just put it in an >>>>>> additional "Summary:" line? >>>>> >>>>> >>>>> The changeset format actually allows multiple bug ids in a single >>>>> commit, >>>>> the format is: >>>>> >>>>> XXXXXXX: Bug title 1 >>>>> YYYYYYY: Bug title 2 >>>>> Summary: foo >>>>> Reviewed-by: bar >>>>> >>>>> See >>>>> http://openjdk.java.net/guide/producingChangeset.html >>>>> >>>> Ah, I see. Thanks for the info. >>>> Nevertheless I'd prefer to use one single bug only and close the other >>>> as duplicate. >>>> >>>> I personally think multiple bug IDs are confusing (and they break our >>>> internal integration scripts :) >>> >>> Agreed. If there are two bugs for the same issue then one should be closed >>> as a duplicate and only a single bugid used. >>> >>> It would be extremely rare where one changeset needed to fix two >>> completely independent bugs IMHO. >>> >>> David >>> >>>> Regards, >>>> Volker >>>> >>>>> /Mikael >>>>> >>>>> >>>>>> As regards to content, I really think the annotations aren't needed >>>>>> any more. I've tried with gcc4.1.2 which is the oldest we are using it >>>>>> it works perfectly. >>>>>> >>>>>> Regards, >>>>>> Volker >>>>>> >>>>>> On Thu, Mar 10, 2016 at 6:56 PM, Daniel D. Daugherty >>>>>> wrote: >>>>>>> >>>>>>> Hi Volker, >>>>>>> >>>>>>> The objectMonitor.cpp and synchronizer.cpp NOINLINE issue is tracked >>>>>>> via: >>>>>>> >>>>>>> JDK-8049103 investigate whether inlining still needs to be inhibited >>>>>>> in >>>>>>> objectMonitor.cpp and synchronizer.cpp >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8049103 >>>>>>> >>>>>>> Feel free use both bug IDs in your changeset. >>>>>>> >>>>>>> Dan >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 3/10/16 10:10 AM, Volker Simonis wrote: >>>>>>>> >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> can I please have a review and a sponsor for the following clean-up >>>>>>>> change: >>>>>>>> >>>>>>>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/ >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8151593 >>>>>>>> >>>>>>>> First I only wanted to implement the INLINE macro for xlC in >>>>>>>> instanceKlass.inline.hpp. But then I realized that we also define >>>>>>>> NOINLINE in various other files so I decided to do it "the right way" >>>>>>>> and clean up the code a little bit. >>>>>>>> >>>>>>>> I've now moved the definition of the INLINE/NOINLINE macros to >>>>>>>> globalDefinitions_.hpp. In the case where there is no >>>>>>>> compiler-specific definition, globalDefinitions.hpp defines empty >>>>>>>> defaults for the macros. >>>>>>>> >>>>>>>> I've also renamed INLINE to ALWAYSINLINE to match its intention more >>>>>>>> clearly. >>>>>>>> >>>>>>>> Currently NOINLINE is really only defined on Linux. This is the same >>>>>>>> behavior we had before the change. Following some more details: >>>>>>>> >>>>>>>> os_linux.cpp >>>>>>>> >>>>>>>> - removed the handling for gcc < 3 (even we at SAP don't use this >>>>>>>> anymore >>>>>>>> :) >>>>>>>> >>>>>>>> objectMonitor.cpp, synchronizer.cpp >>>>>>>> >>>>>>>> - completely removed the annotation with NOINLNE which is there since >>>>>>>> pre-OpenJDK times already. The comment mentions that this was >>>>>>>> required >>>>>>>> to prevent build-time failures with 'older' versions of GCC. But we >>>>>>>> already build without 'NOINLINE' on Linux/ppc64 since years and I've >>>>>>>> also tested that it still works on Linux/x86. >>>>>>>> >>>>>>>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64, >>>>>>>> Solaris/SPARC, MacOS X, AIX and Windows. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Volker >>>>>>> >>>>>>> >>>>>>> From tim.bell at oracle.com Sat Mar 12 21:11:38 2016 From: tim.bell at oracle.com (Tim Bell) Date: Sat, 12 Mar 2016 13:11:38 -0800 Subject: RFR: JDK-8151653: Hotspot build does not respect --enable-openjdk-only In-Reply-To: <56E2F2C7.9090301@oracle.com> References: <56E2F2C7.9090301@oracle.com> Message-ID: <56E4860A.2060109@oracle.com> Erik: > When building hotspot with closed sources present and configuring with > --enable-openjdk-only, various closed parts are included in the build > anyway, at least on Windows. This needs to be fixed in preparation for > the new hotspot build for build output comparisons to be meaningful > between the old and new. > > The major culprit here, which applies to all platforms, is the trace > source generation. The base trace.xml uses XInclude to explicitly and > unconditionally include closed xml files if present. I'm fixing this > by introducing a closed version of trace.xml which includes the open > and closed parts, while the open trace.xml only includes the open parts. > > The rest of the changes are just for Windows, making sure the OPENJDK > variable is propagated into the nmake build and making all > conditionals on including closed source also check that variable. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8151653 > Webrev: > http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.01/index.html This looks good to me. /Tim From kirk.pepperdine at gmail.com Sun Mar 13 22:00:31 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Sun, 13 Mar 2016 23:00:31 +0100 Subject: CodeHeap Message-ID: <6CFF9181-BEC6-46A5-BA39-3DC730373804@gmail.com> Hi, I?ve just been visiting the work done on the code cache and I?ve noticed that the pool names have been changed from CodeCache to CodeHeap. Is there any reason for the change to the naming convention? Regards, Kirk From kirk.pepperdine at gmail.com Sun Mar 13 22:08:15 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Sun, 13 Mar 2016 23:08:15 +0100 Subject: CodeHeap Message-ID: <305F7DC8-C960-4017-9304-3F5100DBF3BA@gmail.com> Hi, I?ve just been visiting the work done on the code cache and I?ve noticed that the pool names have been changed from CodeCache to CodeHeap. Is there any reason for the change to the naming convention? Also, the DiagnosticCommand seems to refer to the compilerCodeCache as well as MemoryManager.CodeCacheManager which would seem inconsistent with this change. Regards, Kirk From david.holmes at oracle.com Mon Mar 14 01:22:05 2016 From: david.holmes at oracle.com (David Holmes) Date: Mon, 14 Mar 2016 11:22:05 +1000 Subject: RFR: JDK-8151653: Hotspot build does not respect --enable-openjdk-only In-Reply-To: <56E2F2C7.9090301@oracle.com> References: <56E2F2C7.9090301@oracle.com> Message-ID: <56E6123D.9020209@oracle.com> Hi Erik, On 12/03/2016 2:31 AM, Erik Joelsson wrote: > Hello, > > When building hotspot with closed sources present and configuring with > --enable-openjdk-only, various closed parts are included in the build > anyway, at least on Windows. This needs to be fixed in preparation for > the new hotspot build for build output comparisons to be meaningful > between the old and new. > > The major culprit here, which applies to all platforms, is the trace > source generation. The base trace.xml uses XInclude to explicitly and > unconditionally include closed xml files if present. I'm fixing this by > introducing a closed version of trace.xml which includes the open and > closed parts, while the open trace.xml only includes the open parts. You've also done a significant amount of refactoring of that file and split it into three parts. It's hard to spot the actual functional differences in all that. Given we have distinct directories from which we locate files it is a pity to introduce something like this: XML_DEPS += $(TraceAltSrcDir)/traceeventsclosed.xml where traceevents.xml is now traceeventsclosed.xml. This "alt src" mechanism was supposed to abstract away the details of any particular alternative configuration so that we didn't hardcode "closed" all over the place. Other community members are supposed to be able to utilize these mechanisms for their own customized build environments. > The rest of the changes are just for Windows, making sure the OPENJDK > variable is propagated into the nmake build and making all conditionals > on including closed source also check that variable. make/windows/build.make The combination !openjdk && !exists "closed" should be an error. As a meta-comment I think we've lost the plot somewhat with these "alt" locations and how we manage them. The Oracle "closed" variants should only be used when not trying to build OpenJDK (even if the files exist in a forest), but other custom implementations may work in conjunction with an OpenJDK build. To that end the "do nothing if building OpenJDK" should be located within the "alt" files themselves, not at the point of inclusion/use in the open files. David ----- > Bug: https://bugs.openjdk.java.net/browse/JDK-8151653 > Webrev: > http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.01/index.html > > /Erik From david.holmes at oracle.com Mon Mar 14 01:29:15 2016 From: david.holmes at oracle.com (David Holmes) Date: Mon, 14 Mar 2016 11:29:15 +1000 Subject: UL: logging before initialization? In-Reply-To: References: <56E229A8.4020907@oracle.com> <56E27E4D.3060108@oracle.com> <56E2BFD3.7060306@oracle.com> Message-ID: <56E613EB.9080507@oracle.com> On 12/03/2016 12:34 AM, Thomas St?fe wrote: > Hi David, > > On Fri, Mar 11, 2016 at 1:53 PM, David Holmes > wrote: > > On 11/03/2016 9:22 PM, Thomas St?fe wrote: > > Hi David, Marcus, > > thanks for thinking about this! Please find my comments inline. > > On Fri, Mar 11, 2016 at 9:14 AM, Marcus Larsson > > >> wrote: > > Hi, > > On 2016-03-11 03:12, David Holmes wrote: > > Hi Thomas, > > Expanding to hotspot-dev as UL was not designed/built > by the > runtime team. > > My comments below based on my limited understanding of UL. > > On 11/03/2016 2:25 AM, Thomas St?fe wrote: > > Hi all, > > I wanted to use UL to log some information from > early OS > initialization but > found that we initialize logging quite late. It is > initialized way after > os::init() runs. > > > There are various dependencies in the unified logging > framework > that prevent it (or at least parts of it) from being > used early eg: > - argument parsing and log configuration > - existence of current thread (for logStreams) > > > Currently, the framework can be used as soon as static > initialization is done. This doesn't include the logStreams of > course since they require resource allocations. The problem > is as > you say that there is no way to configure the logging > before parsing > the -Xlog command. This means up until that point the default > configuration will apply, which means warnings and errors > to stdout. > > > I also see that warnings and errors are printed > unconditionally even > before, only log calls for levels <= info are > quietly swallowed. > > > Are those warnings/errors using UL? I suspect not. > > > They could be, since errors and warnings are enabled by > default. > > > They are from UL. I see errors and warnings. Decorators seem to > be off > though, e.g. the timestamp, because they rely on initialization in > os::init(). But nothing serious which breaks logging as long as > one is > fine with default settings. > > > > > Silent swallowing is not good though. > > Would there be a way to move UL initialization and > parsing > of -Xlog > Arguments to an earlier point to be able to use > logging in > os::init()? > > > I don't see how you could utilize tags and levels until > after > full initialization of the logging system, so that would > preclude using it as early as os::init. > > > It is a possible solution I guess. I don't know how dependent > argument parsing is on other initialization. There would > always be > some part of the initialization where you only have warning and > error logging unless we do the parsing first thing during > startup, > which I assume will be impossible. > > > Sure, the logging system must be fully initialized to use it. > However, I > argue that the logging system should be as independent as > possible from > the rest of the VM, so not rely on VM initialization. If that is the > case - and I think it is now - then logging initialization and -Xlog > parsing can be moved up in Thread::create_vm() to before os::init(). > > > You would need to examine the complete transitive closure of logging > code to see if such a move is feasible. > > > Not sure I understand. > > Making sure that the logging system itself does not contain deep VM > dependencies should be feasible. If with "logging code" you mean logging > calls by the various components, I would think that anyone introducing > logging calls should not log anything which is not available at the time > the logging call is executed. Or do I not understand? Just the logging system itself, but dependencies are often not obvious inside the VM - eg allocation -> NMT Thanks, David > > Thomas > > I would even argue that if this does not work, it is an error. For > example, if we were to require Thread::current() to work for > logging,e.g. for log decorators, this would mean logging breaks if > Thread::current() is not available. So, if we make the logging > system > work for pre-initialization time, and add regression tests for this, > this is a pretty good way to keep the logging system healthy and > robust > and avoid too much dependencies into the VM. > > I would think that the logging system as it is now is already > robust - > the fact that it works, with default settings, right after static > initialization is a good sign. So, we could probably move > initialization > and -Xlog parsing to an earlier point with not much work. > > > While the logging system has taken a number of steps to make itself > immune to some initialization issues (for example "locking" uses a > semaphore and doesn't rely on Thread::current()), different parts of > the system have different dependencies - which seems unavoidable to > me. I don't know if it would be possible to enable a subset of the > API earlier in the initialization sequence by refactoring some of > the configuration logic and argument parsing. > > David > ----- > > > > > Or, if that is not possible, would there be a way > to delay > printing of > early logging calls to after logging initialization > and then > print them out > in one go? I think this would be not trivial > though: one > would have to > collect all logging output in memory somewhere - > because we > do not yet know > which tags are switched on - and then, once -Xlog > is parsed, > filter it by > tag before printing it out. > > > Yeah that seems difficult/complex given the problem > that the VM > is in the early stages of initialization > > > I really do not like this solution either, I only added this for > completeness and to make my first proposal look better in > comparison :) > > What do you think, would that be a worthwhile > change? I am a > bit unhappy > about how logging calls are quietly swallowed, so > for any > code which runs > at VM initialization, one always has to keep in > mind that UL > may not yet be > initialized. > > > Not a new problem (adding more code during VM > initialization) > but one that is getting more complicated :) > > > I think it would perhaps be worthwhile if there's demand > for a bunch > of info to trace level logging from startup code (before > argument > parsing). > > > At least in the AIX port we have a lot of tracing going on very > early. > For platform porters, OS initialization is a very interesting > time. We > have now a very primitive trace there which I would love to > switch to > UL, but right now the trace output would just be swallowed by > not-yet-initialized UL. > > Thank you, > > Thomas > > Thanks, > Marcus > > > > Cheers, > David > > Kind Regards, Thomas > > > > From tobias.hartmann at oracle.com Mon Mar 14 08:28:52 2016 From: tobias.hartmann at oracle.com (Tobias Hartmann) Date: Mon, 14 Mar 2016 09:28:52 +0100 Subject: CodeHeap In-Reply-To: <305F7DC8-C960-4017-9304-3F5100DBF3BA@gmail.com> References: <305F7DC8-C960-4017-9304-3F5100DBF3BA@gmail.com> Message-ID: <56E67644.9080705@oracle.com> Hi Kirk, On 13.03.2016 23:08, kirk.pepperdine at gmail.com wrote: > Hi, > > I?ve just been visiting the work done on the code cache and I?ve noticed that the pool names have been changed from CodeCache to CodeHeap. Is there any reason for the change to the naming convention? > > Also, the DiagnosticCommand seems to refer to the compilerCodeCache as well as MemoryManager.CodeCacheManager which would seem inconsistent with this change. With the Segmented Code Cache JEP [1], the code cache consists of multiple smaller segments (CodeHeaps) instead of one large segment. If segmentation is enabled (controlled by -XX:SegmentedCodeCache) we now have multiple pools corresponding to these individual code heaps. Thanks, Tobias > > Regards, > Kirk > [1] https://bugs.openjdk.java.net/browse/JDK-8043304 From kirk.pepperdine at gmail.com Mon Mar 14 09:07:01 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Mon, 14 Mar 2016 10:07:01 +0100 Subject: CodeHeap In-Reply-To: <56E67644.9080705@oracle.com> References: <305F7DC8-C960-4017-9304-3F5100DBF3BA@gmail.com> <56E67644.9080705@oracle.com> Message-ID: <017CF871-8519-45F8-BB48-B64D09B3AA7D@gmail.com> Hi Tobias, Thanks for the response. I?ve been lurking about watching the change as much as I could. The work it?s self is well done. It is the deviation from the naming convention that I was curious about. Are these segmented regions heaps? Or are these really just different segments of the code cache? Regards, Kirk > On Mar 14, 2016, at 9:28 AM, Tobias Hartmann wrote: > > Hi Kirk, > > On 13.03.2016 23:08, kirk.pepperdine at gmail.com wrote: >> Hi, >> >> I?ve just been visiting the work done on the code cache and I?ve noticed that the pool names have been changed from CodeCache to CodeHeap. Is there any reason for the change to the naming convention? >> >> Also, the DiagnosticCommand seems to refer to the compilerCodeCache as well as MemoryManager.CodeCacheManager which would seem inconsistent with this change. > > With the Segmented Code Cache JEP [1], the code cache consists of multiple smaller segments (CodeHeaps) instead of one large segment. If segmentation is enabled (controlled by -XX:SegmentedCodeCache) we now have multiple pools corresponding to these individual code heaps. > > Thanks, > Tobias > >> >> Regards, >> Kirk >> > > [1] https://bugs.openjdk.java.net/browse/JDK-8043304 From adinn at redhat.com Mon Mar 14 09:50:26 2016 From: adinn at redhat.com (Andrew Dinn) Date: Mon, 14 Mar 2016 09:50:26 +0000 Subject: CodeHeap In-Reply-To: <017CF871-8519-45F8-BB48-B64D09B3AA7D@gmail.com> References: <305F7DC8-C960-4017-9304-3F5100DBF3BA@gmail.com> <56E67644.9080705@oracle.com> <017CF871-8519-45F8-BB48-B64D09B3AA7D@gmail.com> Message-ID: <56E68962.1070808@redhat.com> On 14/03/16 09:07, kirk.pepperdine at gmail.com wrote: > Thanks for the response. I?ve been lurking about watching the change > as much as I could. The work it?s self is well done. It is the > deviation from the naming convention that I was curious about. Are > these segmented regions heaps? Or are these really just different > segments of the code cache? If you /look at the code/ you can see that each CodeHeap is a separate memory region. That region contains a sequence of contiguous blocks into which code is written plus a sequence of contiguous segment descriptors which identify links backwards from any address in a given code block to the first block for the associated method. That's much the same setup as before except there are now N such CodeHeap memory regions instead of one. As a consequence class CodeCache now contains a growable array of pointers to CodeHeap (new field _heaps) rather than a pointer to a single CodeHeap (old field _heap). Also, note that all N code heaps are still carved out of one larger region. So, there is still a unique lower and upper bound which can be used to identify whether a PC is in codeheap space rather than in, say, native code space. Obviously you can also use the codeheap lower and upper bounds to identify whether a PC is an interpreter address, stub address, JITted method address etc. regards, Andrew Dinn ----------- Senior Principal Software Engineer Red Hat UK Ltd Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (US), Michael O'Neill (Ireland), Paul Argiry (US) From vladimir.x.ivanov at oracle.com Mon Mar 14 18:48:08 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Mon, 14 Mar 2016 21:48:08 +0300 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E1F9A8.2000608@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1E9C3.40006@oracle.com> <56E1F21E.80106@oracle.com> <56E1F9A8.2000608@oracle.com> Message-ID: <56E70768.6080708@oracle.com> Jon, Updated version: http://cr.openjdk.java.net/~vlivanov/8151623/webrev.03/ > If there is a mistake in the mangling of a Metablock, that would > show up when the Metaspace shrinks. Can you check that the testing > has some Metaspace shrinking. I think that -Xlog:gc*=trace would > show the needed output. Thanks for the hint! It found one problem with -Xlog:gc*=trace itself: BlockFreelist keeps the tree of free blocks inside Metachunks and dumps the content from the destructor. Mangling breaks it because it happens earlier and destroys the free list structure by the time BlockFreelist destructor is called. I fixed it by dumping the free list content before Metachunks are mangled. I ran a stress test on class loading and ensured there's no memory leak in Metaspace. Best regards, Vladimir Ivanov PS: maybe add a -Xlog:gc,metaspace,freelist=trace event for metachunk mangling? From gnu.andrew at redhat.com Mon Mar 14 19:17:54 2016 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Mon, 14 Mar 2016 15:17:54 -0400 (EDT) Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: <1769110059.9605579.1457982650302.JavaMail.zimbra@redhat.com> Message-ID: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> Bug: https://bugs.openjdk.java.net/browse/JDK-8151841 Webrev: http://cr.openjdk.java.net/~andrew/8151841/webrev.01/ A number of additional flags need to be passed to the C and C++ compiler for OpenJDK to compile with GCC 6: 1. The C++ standard needs to be explicitly lowered to the old default of gnu++98. With the new GCC default of C++14, the build fails, due to the way C++ is used in HotSpot and the JDK native code. Long term, it might be good to fix the code itself, in OpenJDK 9 or 10, but we need an interim solution to make OpenJDK buildable and one we can backport to existing supported version (6, 7 and 8). 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a working JVM. The webrev adds checks for these flags to configure and adds them if they are supported by GCC. It was necessary to split the macro FLAGS_COMPILER_CHECK_ARGUMENTS into FLAGS_C_COMPILER_CHECK_ARGUMENTS and FLAGS_CXX_COMPILER_CHECK_ARGUMENTS as the -std=g++98 argument is only applicable to the C++ compiler and will fail with the C compiler. With just the original macro, this would have meant that the argument never passed the test. I've built this locally on hs-rt/amd64 with GCC 5.3 successfully and I've also built a backport to 8u (nearly the same, but adjusted for macro placement and structural changes in 8u) on x86, amd64 and armv7hl with GCC 6 (Fedora rawhide) [0]. If this looks ok, let me know which tree to push it to; I'm not sure if it should go in as a general build change or a HotSpot change. [0] http://koji.fedoraproject.org/koji/taskinfo?taskID=13311585 Thanks. -- Andrew :) Senior Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: ed25519/35964222 (hkp://keys.gnupg.net) Fingerprint = 5132 579D D154 0ED2 3E04 C5A0 CFDA 0F9B 3596 4222 From mikael.vidstedt at oracle.com Mon Mar 14 22:47:19 2016 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Mon, 14 Mar 2016 15:47:19 -0700 Subject: RFR(S): 8151233: Unify CopySwap and CopyMemory tests Message-ID: <56E73F77.8000203@oracle.com> Please review the below change. When doing the clean up of Unsafe I cheated and made a copy of the CopySwap test (used to test U.copySwapMemory) for testing U.copyMemory. Much of the code is the same, or at least similar enough, that duplication is unfortunate. This change moves the common code to a helper file CopyCommon.java, and makes both test files use that. Bug: https://bugs.openjdk.java.net/browse/JDK-8151233 Webrev: http://cr.openjdk.java.net/~mikael/webrevs/8151233/webrev.00/webrev/ Cheers, Mikael From kim.barrett at oracle.com Mon Mar 14 22:55:07 2016 From: kim.barrett at oracle.com (Kim Barrett) Date: Mon, 14 Mar 2016 18:55:07 -0400 Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> References: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> Message-ID: > On Mar 14, 2016, at 3:17 PM, Andrew Hughes wrote: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8151841 > Webrev: http://cr.openjdk.java.net/~andrew/8151841/webrev.01/ > > A number of additional flags need to be passed to the C and C++ compiler > for OpenJDK to compile with GCC 6: This might not be the best time to be making interesting changes to the Hotspot build system in order to support a not yet released compiler, since there is a new Hotspot build system coming soon: https://bugs.openjdk.java.net/browse/JDK-8076052, http://openjdk.java.net/jeps/284. But I'll leave that up to the folks in charge of the build infrastructure. That said, here are some specific comments on the webrev. ------------------------------------------------------------------------------ common/autoconf/hotspot-spec.gmk.in Needs copyright update. ------------------------------------------------------------------------------ common/autoconf/flags.m4 631 # These flags are required for GCC 6 builds but may not be available on earlier versions 632 NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks" According to gcc documentation, this option goes back at least into the 3.x series. So this seems somewhat overkill. ------------------------------------------------------------------------------ common/autoconf/flags.m4 631 # These flags are required for GCC 6 builds but may not be available on earlier versions ... 636 NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" This one does seem to be relatively new; I think it's introduced in gcc4.9. However, there are other places where version conditionalization of options is performed, such as hotspot/make/linux/makefiles/gcc.make, where the addition of some options is dependent on the version. Here it's done based on behavior rather than simply acceptance by the compiler being used. So, for example, -Wuninitialized isn't turned on until gcc4.8, because earlier versions apparently report false positives. Of course, there's the annoying fact that there are multiple gcc.make files that might need to be modified for this. But I'm not sure the simple "the compiler accepts this option" is the right test here. ------------------------------------------------------------------------------ common/autoconf/flags.m4 588 elif test "x$TOOLCHAIN_TYPE" = xgcc; then 589 CXXSTD_CXXFLAG="-std=gnu++98" 590 FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG -Werror], 591 IF_FALSE: [CXXSTD_CXXFLAG=""]) Checking for acceptance of this option seems like overkill. ------------------------------------------------------------------------------ common/autoconf/flags.m4 If the new option checks weren't being made (as discussed above), the changes to the checker wouldn't be needed. ------------------------------------------------------------------------------ common/autoconf/hotspot-spec.gmk.in 113 EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) $(NO_NULL_POINTER_CHECK_FLAG) $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) It seems strange to only include $(NO_NULL_POINTER_CHECK_FLAG) and $(NO_LIFETIME_DSE_FLAG) in EXTRA_CFLAGS, but not EXTRA_CXXFLAGS. And it seems strange to include $(CXXSTD_CXXFLAG) in EXTRA_CFLAGS at all, rather than in EXTRA_CXXFLAGS. ------------------------------------------------------------------------------ > 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to > add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a > working JVM. That's very disturbing! -fdelete-null-pointer-checks is the default in much earlier versions than gcc6 (since 4.5?), and much longer than that at higher optimization levels (since somewhere in the 3.x series?). But maybe gcc6 is doing a better job of recognizing the relevant situations. Or maybe there's a bug in gcc6, which is not a released version yet. One specific gcc6 change that could be relevant is: Value range propagation now assumes that the this pointer of C++ member functions is non-null. This eliminates common null pointer checks but also breaks some non-conforming code-bases (such as Qt-5, Chromium, KDevelop). As a temporary work-around -fno-delete-null-pointer-checks can be used. Wrong code can be identified by using -fsanitize=undefined. There's also a new warning option in gcc6 that might help find places where -fdelete-null-pointer-checks is leading to problems: -Wnull-dereference. Do you have any information as to where things are being broken by this option? I think I would prefer an attempt to track down this class of problem rather than hiding it via -fno-delete-null-pointer-checks. I don't have any suggestions for why gcc6 might be having problems because of -flifetime-dse, or how to find them. Do you? This seems to be a relatively new option, having been introduced in gcc4.9(?), and seems to have always been on by default since being introduced. Again, this could be a matter of gcc6 doing a better job of recognizing relevant situations, or a bug in that not-yet-released version. From david.holmes at oracle.com Tue Mar 15 00:26:13 2016 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Mar 2016 10:26:13 +1000 Subject: RFR(S): 8151233: Unify CopySwap and CopyMemory tests In-Reply-To: <56E73F77.8000203@oracle.com> References: <56E73F77.8000203@oracle.com> Message-ID: <56E756A5.8090703@oracle.com> Hi Mikael, On 15/03/2016 8:47 AM, Mikael Vidstedt wrote: > > Please review the below change. > > When doing the clean up of Unsafe I cheated and made a copy of the > CopySwap test (used to test U.copySwapMemory) for testing U.copyMemory. > Much of the code is the same, or at least similar enough, that > duplication is unfortunate. This change moves the common code to a > helper file CopyCommon.java, and makes both test files use that. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8151233 > Webrev: > http://cr.openjdk.java.net/~mikael/webrevs/8151233/webrev.00/webrev/ Is it worth using CopyCommon as a base class and also sharing the UNSAFE mechanics? Otherwise the refactoring seems okay. Thanks, David > Cheers, > Mikael > From david.holmes at oracle.com Tue Mar 15 00:46:54 2016 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Mar 2016 10:46:54 +1000 Subject: RFR: JDK-8151653: Hotspot build does not respect --enable-openjdk-only In-Reply-To: <56E6123D.9020209@oracle.com> References: <56E2F2C7.9090301@oracle.com> <56E6123D.9020209@oracle.com> Message-ID: <56E75B7E.1020400@oracle.com> On 14/03/2016 11:22 AM, David Holmes wrote: > Hi Erik, > > On 12/03/2016 2:31 AM, Erik Joelsson wrote: >> Hello, >> >> When building hotspot with closed sources present and configuring with >> --enable-openjdk-only, various closed parts are included in the build >> anyway, at least on Windows. This needs to be fixed in preparation for >> the new hotspot build for build output comparisons to be meaningful >> between the old and new. >> >> The major culprit here, which applies to all platforms, is the trace >> source generation. The base trace.xml uses XInclude to explicitly and >> unconditionally include closed xml files if present. I'm fixing this by >> introducing a closed version of trace.xml which includes the open and >> closed parts, while the open trace.xml only includes the open parts. > > You've also done a significant amount of refactoring of that file and > split it into three parts. It's hard to spot the actual functional > differences in all that. Sorry that was a bit terse. It would have been clearer if you had explained about the refactoring. I can see why the refactoring was needed. Thanks, David ----- > Given we have distinct directories from which we locate files it is a > pity to introduce something like this: > > XML_DEPS += $(TraceAltSrcDir)/traceeventsclosed.xml > > where traceevents.xml is now traceeventsclosed.xml. This "alt src" > mechanism was supposed to abstract away the details of any particular > alternative configuration so that we didn't hardcode "closed" all over > the place. Other community members are supposed to be able to utilize > these mechanisms for their own customized build environments. > >> The rest of the changes are just for Windows, making sure the OPENJDK >> variable is propagated into the nmake build and making all conditionals >> on including closed source also check that variable. > > make/windows/build.make > > The combination !openjdk && !exists "closed" should be an error. > > As a meta-comment I think we've lost the plot somewhat with these "alt" > locations and how we manage them. The Oracle "closed" variants should > only be used when not trying to build OpenJDK (even if the files exist > in a forest), but other custom implementations may work in conjunction > with an OpenJDK build. To that end the "do nothing if building OpenJDK" > should be located within the "alt" files themselves, not at the point of > inclusion/use in the open files. > > David > ----- > >> Bug: https://bugs.openjdk.java.net/browse/JDK-8151653 >> Webrev: >> http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.01/index.html >> >> /Erik From christian.thalinger at oracle.com Tue Mar 15 02:46:28 2016 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Mon, 14 Mar 2016 16:46:28 -1000 Subject: CodeHeap In-Reply-To: <6CFF9181-BEC6-46A5-BA39-3DC730373804@gmail.com> References: <6CFF9181-BEC6-46A5-BA39-3DC730373804@gmail.com> Message-ID: <28EB4D87-5E32-4123-9E1F-0F7E7D8DC5B4@oracle.com> > On Mar 13, 2016, at 12:00 PM, kirk.pepperdine at gmail.com wrote: > > Hi, > > I?ve just been visiting the work done What work are you referring to? > on the code cache and I?ve noticed that the pool names have been changed from CodeCache to CodeHeap. Is there any reason for the change to the naming convention? > > Regards, > Kirk From gnu.andrew at redhat.com Tue Mar 15 04:18:47 2016 From: gnu.andrew at redhat.com (Andrew Hughes) Date: Tue, 15 Mar 2016 00:18:47 -0400 (EDT) Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: References: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> Message-ID: <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> ----- Original Message ----- > > On Mar 14, 2016, at 3:17 PM, Andrew Hughes wrote: > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8151841 > > Webrev: http://cr.openjdk.java.net/~andrew/8151841/webrev.01/ > > > > A number of additional flags need to be passed to the C and C++ compiler > > for OpenJDK to compile with GCC 6: > > This might not be the best time to be making interesting changes to > the Hotspot build system in order to support a not yet released > compiler, since there is a new Hotspot build system coming soon: > https://bugs.openjdk.java.net/browse/JDK-8076052, > http://openjdk.java.net/jeps/284. But I'll leave that up to the folks > in charge of the build infrastructure. I'm not sure I'd refer to this as 'interesting changes'. GCC 6 is in final regression testing at the moment and will be appearing in the upcoming releases of a number of GNU/Linux distributions. It's pretty necessary to get this fix in now, so that it can also be fixed in 8u and get out into released versions which are being packaged for these distributions. It may not be released right now, but, by the time it's worked its way through the system, people will already be experiencing build failures with GCC 6. I briefly saw a post about these HotSpot changes when I was about to post this, and I was wondering when this was going to be finally cleaned up when I was working on the patch. It's good to see it being done. I don't think it changes the need for this patch though, as these flags also need to be added to the JDK build. At best, it will simplify the HotSpot part of this patch, which at the moment, is pretty ugly. Hopefully, this will mean that HotSpot is then actually using the C++ flags rather than the C ones! If you'd like some further testing of this new build, I'd be happy to take a look. My primary target for this though is 8u, so I'd like to see this in sooner rather than later. If we wait for the HotSpot build system to change, we're going to have a lot of broken 8u reports. > > That said, here are some specific comments on the webrev. > > ------------------------------------------------------------------------------ > common/autoconf/hotspot-spec.gmk.in > Needs copyright update. It looks like it did years ago. My feelings on these are that they are best done in bulk in their own changeset. Including them with other changes makes it hard to then backport the patch cleanly. But I can add that if it's really necessary. > > ------------------------------------------------------------------------------ > common/autoconf/flags.m4 > 631 # These flags are required for GCC 6 builds but may not be available > on earlier versions > 632 NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks" > > According to gcc documentation, this option goes back at least into > the 3.x series. So this seems somewhat overkill. Possibly. I've tended to err on the side of caution; the option could equally be removed or renamed in some future release. > > ------------------------------------------------------------------------------ > common/autoconf/flags.m4 > 631 # These flags are required for GCC 6 builds but may not be available > on earlier versions > ... > 636 NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" > > This one does seem to be relatively new; I think it's introduced in > gcc4.9. However, there are other places where version > conditionalization of options is performed, such as > hotspot/make/linux/makefiles/gcc.make, where the addition of some > options is dependent on the version. Here it's done based on behavior > rather than simply acceptance by the compiler being used. So, for > example, -Wuninitialized isn't turned on until gcc4.8, because earlier > versions apparently report false positives. > > Of course, there's the annoying fact that there are multiple gcc.make > files that might need to be modified for this. But I'm not sure the > simple "the compiler accepts this option" is the right test here. Yes, there seems to be a lot of logic duplicated in various places. The reason we're doing this at the root level is these options are also being applied to the JDK build. It seems like this is also more likely to survive the HotSpot build refactoring this way. Do you have an idea as to what the right test might be? I tend to find that checking an option is accepted is better than assuming it's accepted because we're using version x; changes can occasionally be backported to older versions at a later date. I'm not sure if that's what you were getting at or not. As this is an optimisation being disabled, rather than a warning, the behaviour is not as easily testable. I did consider restricting the additions to GCC >= 6, but my understanding is that these optimisations are problematic because of some of the OpenJDK code itself, and it's more simple luck that they haven't caused crashes before. I'm willing to defer to someone else more familiar with the code on this one though, and we can restrict it if it's known to be safe on earlier versions. > > ------------------------------------------------------------------------------ > common/autoconf/flags.m4 > 588 elif test "x$TOOLCHAIN_TYPE" = xgcc; then > 589 CXXSTD_CXXFLAG="-std=gnu++98" > 590 FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG > -Werror], > 591 IF_FALSE: > [CXXSTD_CXXFLAG=""]) > > Checking for acceptance of this option seems like overkill. > Again, possibly. I know it fails with the C compiler. configure is not particularly performance critical and it's better to fail early there than halfway through the build. > ------------------------------------------------------------------------------ > common/autoconf/flags.m4 > > If the new option checks weren't being made (as discussed above), the > changes to the checker wouldn't be needed. Agreed, it could be much simpler. I think the changes are generally beneficial though. > > ------------------------------------------------------------------------------ > common/autoconf/hotspot-spec.gmk.in > > 113 EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) > $(NO_NULL_POINTER_CHECK_FLAG) $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) > > It seems strange to only include $(NO_NULL_POINTER_CHECK_FLAG) and > $(NO_LIFETIME_DSE_FLAG) in EXTRA_CFLAGS, but not EXTRA_CXXFLAGS. > > And it seems strange to include $(CXXSTD_CXXFLAG) in EXTRA_CFLAGS at > all, rather than in EXTRA_CXXFLAGS. It is strange, but it's because HotSpot currently completely ignores EXTRA_CXXFLAGS. I found this out the hard way :-) When we were testing this by passing --with-extra-cflags and --with-extra-cxxflags to the build, just putting the -std option in cxxflags didn't fix the HotSpot build. There's actually no way of doing it via the command-line options such that that the JDK C compiler doesn't get given the -std option and issue a warning as a result. hotspot/make/linux/makefiles/rules.make:CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) hotspot/make/linux/makefiles/rules.make:CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) EXTRA_CFLAGS are added to CFLAGS, but CXXFLAGS is only ever given -D and -I options. Essentially it's being used to mean the pre-processor, not the C++ compiler in the HotSpot build. The C compiler is hardly used at all in the HotSpot build. > > ------------------------------------------------------------------------------ > > > 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to > > add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a > > working JVM. > > That's very disturbing! > > -fdelete-null-pointer-checks is the default in much earlier versions > than gcc6 (since 4.5?), and much longer than that at higher > optimization levels (since somewhere in the 3.x series?). But maybe > gcc6 is doing a better job of recognizing the relevant situations. Or > maybe there's a bug in gcc6, which is not a released version yet. > > One specific gcc6 change that could be relevant is: > Value range propagation now assumes that the this pointer of C++ > member functions is non-null. This eliminates common null pointer > checks but also breaks some non-conforming code-bases (such as Qt-5, > Chromium, KDevelop). As a temporary work-around > -fno-delete-null-pointer-checks can be used. Wrong code can be > identified by using -fsanitize=undefined. > > There's also a new warning option in gcc6 that might help find > places where -fdelete-null-pointer-checks is leading to problems: > -Wnull-dereference. > > Do you have any information as to where things are being broken by > this option? I think I would prefer an attempt to track down this > class of problem rather than hiding it via > -fno-delete-null-pointer-checks. > > I don't have any suggestions for why gcc6 might be having problems > because of -flifetime-dse, or how to find them. Do you? This seems > to be a relatively new option, having been introduced in gcc4.9(?), > and seems to have always been on by default since being introduced. > Again, this could be a matter of gcc6 doing a better job of > recognizing relevant situations, or a bug in that not-yet-released > version. > > > Andrew Haley (CCed) has more details on the need for these options, as he diagnosed the reason for the crash, with the help of the GCC developers. From what I understand of it, it is a case of more aggressive optimisations in the new GCC running into problems with code that doesn't strictly conform to the specification and exhibit undefined behaviour. The need for -flifetime-dse is covered in comment #47 of the bug for this [0]; "an object field [is] being accessed before the object is constructed, in breach of C++98 [class.cdtor]". I concur with you that the real solution here is to fix this undefined behaviour, but that's quite an involved job (as is converting the code to work with C++14) and one which may not be able to be backported when done. What I'm proposing here is a workaround to keep OpenJDK building in the mean-time. Getting a stable OpenJDK build on GCC 6 with these optimisations is a more involved task. We could limit disabling these options to GCC 6 and above. With this initial version of the patch, I've generally taken the safest route; although builds with earlier versions may not exhibit crashes, they still perform optimisations where the basis for these optimisations is being broken by some of the code in OpenJDK. [0] https://bugzilla.redhat.com/show_bug.cgi?id=1306558#c47 Thanks for the extensive feedback, -- Andrew :) Senior Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: ed25519/35964222 (hkp://keys.gnupg.net) Fingerprint = 5132 579D D154 0ED2 3E04 C5A0 CFDA 0F9B 3596 4222 From david.holmes at oracle.com Tue Mar 15 05:10:24 2016 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Mar 2016 15:10:24 +1000 Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> References: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> Message-ID: <56E79940.8040400@oracle.com> Just a couple of FYIs: 1. hotspot groups require copyright updates on pushes to hotspot forests; other groups do not. Hence many non-hotspot sources have out of date copyrights - these will eventually be fixed en-masse. 2. The CXXFLAGS situation, as alluded, arose out of confusion with the old CPPFLAGS variable. CPP was intended to mean C pre-processor, but then it was mistakenly assumed to be C++ compiler versus CFLAGS for the C-compiler, and that was carried into the CXX name change. Quite a mess that the new build will hopefully rectify. Hotspot doesn't generally use a plain C compiler but always a C++ compiler (the ADLC tool may be an exception there). 3. Given the new build for hotspot will soon be in 9 I think there is adequate justification to fix this separately in 8u (first if desired). David ----- On 15/03/2016 2:18 PM, Andrew Hughes wrote: > ----- Original Message ----- >>> On Mar 14, 2016, at 3:17 PM, Andrew Hughes wrote: >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8151841 >>> Webrev: http://cr.openjdk.java.net/~andrew/8151841/webrev.01/ >>> >>> A number of additional flags need to be passed to the C and C++ compiler >>> for OpenJDK to compile with GCC 6: >> >> This might not be the best time to be making interesting changes to >> the Hotspot build system in order to support a not yet released >> compiler, since there is a new Hotspot build system coming soon: >> https://bugs.openjdk.java.net/browse/JDK-8076052, >> http://openjdk.java.net/jeps/284. But I'll leave that up to the folks >> in charge of the build infrastructure. > > I'm not sure I'd refer to this as 'interesting changes'. GCC 6 is in final > regression testing at the moment and will be appearing in the upcoming releases > of a number of GNU/Linux distributions. It's pretty necessary to get this fix > in now, so that it can also be fixed in 8u and get out into released versions > which are being packaged for these distributions. It may not be released right > now, but, by the time it's worked its way through the system, people will already > be experiencing build failures with GCC 6. > > I briefly saw a post about these HotSpot changes when I was about to post this, > and I was wondering when this was going to be finally cleaned up when I was working > on the patch. It's good to see it being done. I don't think it changes the need > for this patch though, as these flags also need to be added to the JDK build. > At best, it will simplify the HotSpot part of this patch, which at the moment, > is pretty ugly. Hopefully, this will mean that HotSpot is then actually using > the C++ flags rather than the C ones! If you'd like some further testing of > this new build, I'd be happy to take a look. > > My primary target for this though is 8u, so I'd like to see this in sooner rather > than later. If we wait for the HotSpot build system to change, we're going to have > a lot of broken 8u reports. > >> >> That said, here are some specific comments on the webrev. >> >> ------------------------------------------------------------------------------ >> common/autoconf/hotspot-spec.gmk.in >> Needs copyright update. > > It looks like it did years ago. My feelings on these are that they are best > done in bulk in their own changeset. Including them with other changes makes > it hard to then backport the patch cleanly. But I can add that if it's really > necessary. > >> >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> 631 # These flags are required for GCC 6 builds but may not be available >> on earlier versions >> 632 NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks" >> >> According to gcc documentation, this option goes back at least into >> the 3.x series. So this seems somewhat overkill. > > Possibly. I've tended to err on the side of caution; the option could equally be > removed or renamed in some future release. > >> >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> 631 # These flags are required for GCC 6 builds but may not be available >> on earlier versions >> ... >> 636 NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" >> >> This one does seem to be relatively new; I think it's introduced in >> gcc4.9. However, there are other places where version >> conditionalization of options is performed, such as >> hotspot/make/linux/makefiles/gcc.make, where the addition of some >> options is dependent on the version. Here it's done based on behavior >> rather than simply acceptance by the compiler being used. So, for >> example, -Wuninitialized isn't turned on until gcc4.8, because earlier >> versions apparently report false positives. >> >> Of course, there's the annoying fact that there are multiple gcc.make >> files that might need to be modified for this. But I'm not sure the >> simple "the compiler accepts this option" is the right test here. > > Yes, there seems to be a lot of logic duplicated in various places. The > reason we're doing this at the root level is these options are also > being applied to the JDK build. It seems like this is also more likely > to survive the HotSpot build refactoring this way. > > Do you have an idea as to what the right test might be? I tend to > find that checking an option is accepted is better than assuming > it's accepted because we're using version x; changes can occasionally > be backported to older versions at a later date. I'm not sure > if that's what you were getting at or not. As this is an optimisation > being disabled, rather than a warning, the behaviour is not as easily > testable. > > I did consider restricting the additions to GCC >= 6, but my understanding > is that these optimisations are problematic because of some of the OpenJDK > code itself, and it's more simple luck that they haven't caused crashes before. > I'm willing to defer to someone else more familiar with the code on this one > though, and we can restrict it if it's known to be safe on earlier versions. > >> >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> 588 elif test "x$TOOLCHAIN_TYPE" = xgcc; then >> 589 CXXSTD_CXXFLAG="-std=gnu++98" >> 590 FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG >> -Werror], >> 591 IF_FALSE: >> [CXXSTD_CXXFLAG=""]) >> >> Checking for acceptance of this option seems like overkill. >> > > Again, possibly. I know it fails with the C compiler. configure is not > particularly performance critical and it's better to fail early there than > halfway through the build. > >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> >> If the new option checks weren't being made (as discussed above), the >> changes to the checker wouldn't be needed. > > Agreed, it could be much simpler. I think the changes are generally beneficial > though. > >> >> ------------------------------------------------------------------------------ >> common/autoconf/hotspot-spec.gmk.in >> >> 113 EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) >> $(NO_NULL_POINTER_CHECK_FLAG) $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) >> >> It seems strange to only include $(NO_NULL_POINTER_CHECK_FLAG) and >> $(NO_LIFETIME_DSE_FLAG) in EXTRA_CFLAGS, but not EXTRA_CXXFLAGS. >> >> And it seems strange to include $(CXXSTD_CXXFLAG) in EXTRA_CFLAGS at >> all, rather than in EXTRA_CXXFLAGS. > > It is strange, but it's because HotSpot currently completely ignores EXTRA_CXXFLAGS. > I found this out the hard way :-) > > When we were testing this by passing --with-extra-cflags and --with-extra-cxxflags > to the build, just putting the -std option in cxxflags didn't fix the HotSpot build. > There's actually no way of doing it via the command-line options such that > that the JDK C compiler doesn't get given the -std option and issue a warning > as a result. > > hotspot/make/linux/makefiles/rules.make:CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) > hotspot/make/linux/makefiles/rules.make:CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) > > EXTRA_CFLAGS are added to CFLAGS, but CXXFLAGS is only ever given -D and -I options. > Essentially it's being used to mean the pre-processor, not the C++ compiler in the > HotSpot build. The C compiler is hardly used at all in the HotSpot build. > >> >> ------------------------------------------------------------------------------ >> >>> 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to >>> add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a >>> working JVM. >> >> That's very disturbing! >> >> -fdelete-null-pointer-checks is the default in much earlier versions >> than gcc6 (since 4.5?), and much longer than that at higher >> optimization levels (since somewhere in the 3.x series?). But maybe >> gcc6 is doing a better job of recognizing the relevant situations. Or >> maybe there's a bug in gcc6, which is not a released version yet. >> >> One specific gcc6 change that could be relevant is: >> Value range propagation now assumes that the this pointer of C++ >> member functions is non-null. This eliminates common null pointer >> checks but also breaks some non-conforming code-bases (such as Qt-5, >> Chromium, KDevelop). As a temporary work-around >> -fno-delete-null-pointer-checks can be used. Wrong code can be >> identified by using -fsanitize=undefined. >> >> There's also a new warning option in gcc6 that might help find >> places where -fdelete-null-pointer-checks is leading to problems: >> -Wnull-dereference. >> >> Do you have any information as to where things are being broken by >> this option? I think I would prefer an attempt to track down this >> class of problem rather than hiding it via >> -fno-delete-null-pointer-checks. >> >> I don't have any suggestions for why gcc6 might be having problems >> because of -flifetime-dse, or how to find them. Do you? This seems >> to be a relatively new option, having been introduced in gcc4.9(?), >> and seems to have always been on by default since being introduced. >> Again, this could be a matter of gcc6 doing a better job of >> recognizing relevant situations, or a bug in that not-yet-released >> version. >> >> >> > > Andrew Haley (CCed) has more details on the need for these options, > as he diagnosed the reason for the crash, with the help of the GCC > developers. From what I understand of it, it is a case of more > aggressive optimisations in the new GCC running into problems with > code that doesn't strictly conform to the specification and exhibit > undefined behaviour. The need for -flifetime-dse is covered in > comment #47 of the bug for this [0]; "an object field [is] being > accessed before the object is constructed, in breach of > C++98 [class.cdtor]". > > I concur with you that the real solution here is to fix this > undefined behaviour, but that's quite an involved job (as is > converting the code to work with C++14) and one which may not be > able to be backported when done. What I'm > proposing here is a workaround to keep OpenJDK building in > the mean-time. Getting a stable OpenJDK build on GCC 6 with > these optimisations is a more involved task. > > We could limit disabling these options to GCC 6 and above. > With this initial version of the patch, I've generally > taken the safest route; although builds with earlier versions > may not exhibit crashes, they still perform optimisations > where the basis for these optimisations is being broken > by some of the code in OpenJDK. > > [0] https://bugzilla.redhat.com/show_bug.cgi?id=1306558#c47 > > Thanks for the extensive feedback, > From kirk.pepperdine at gmail.com Tue Mar 15 07:14:07 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Tue, 15 Mar 2016 08:14:07 +0100 Subject: CodeHeap In-Reply-To: <28EB4D87-5E32-4123-9E1F-0F7E7D8DC5B4@oracle.com> References: <6CFF9181-BEC6-46A5-BA39-3DC730373804@gmail.com> <28EB4D87-5E32-4123-9E1F-0F7E7D8DC5B4@oracle.com> Message-ID: <08A023C2-057E-4401-B801-ABA66C51CA5A@gmail.com> Hi Christian, >> >> I?ve just been visiting the work done > > What work are you referring to? The work that split code cache but more specifically the ObjectName(s) given to the supporting MemoryPoolMXBean(s). The names that I have showing up are java.lang:name=CodeHeap 'non-nmethods',type=MemoryPool, java.lang:name=CodeHeap 'non-profiled nmethods',type=MemoryPool, and java.lang:name=CodeHeap 'profiled nmethods',type=MemoryPool. I was expecting to see java.lang:name=CodeCache 'non-nmethods',type=MemoryPool as that would have followed the establish naming convention. It?s not that this is a huge issue, it obviously isn't and I appreciate the very nice summaries of the work done that were made in reply to this question. I was just interested in if the naming was a conscience decision and if so what motivated it. Thank you to all who responded. Regards, Kirk From kirk.pepperdine at gmail.com Tue Mar 15 07:19:31 2016 From: kirk.pepperdine at gmail.com (kirk.pepperdine at gmail.com) Date: Tue, 15 Mar 2016 08:19:31 +0100 Subject: CodeHeap In-Reply-To: <28EB4D87-5E32-4123-9E1F-0F7E7D8DC5B4@oracle.com> References: <6CFF9181-BEC6-46A5-BA39-3DC730373804@gmail.com> <28EB4D87-5E32-4123-9E1F-0F7E7D8DC5B4@oracle.com> Message-ID: <4A88FB1A-514A-401C-9720-EE215E7C7CAE@gmail.com> Hi Christian, I should have added to my last email that there are some (very minor) adjustments that will need to be made to some (downstream) as a result of the change in names. But then, I don?t consider MBean names as part of the public API which means they are subject to change at any time. Regards, Kirk > On Mar 15, 2016, at 3:46 AM, Christian Thalinger wrote: > > >> On Mar 13, 2016, at 12:00 PM, kirk.pepperdine at gmail.com wrote: >> >> Hi, >> >> I?ve just been visiting the work done > > What work are you referring to? > >> on the code cache and I?ve noticed that the pool names have been changed from CodeCache to CodeHeap. Is there any reason for the change to the naming convention? >> >> Regards, >> Kirk > From stefan.karlsson at oracle.com Tue Mar 15 07:39:33 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 08:39:33 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E13743.4030802@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <56E13743.4030802@oracle.com> Message-ID: <56E7BC35.3070803@oracle.com> Hi reviewers, Are you OK with the latest patch? Thanks, StefanK On 10/03/16 09:58, Stefan Karlsson wrote: > Hi Kim, > > Updated webrevs: > http://cr.openjdk.java.net/~stefank/8151539/webrev.02.delta/ > http://cr.openjdk.java.net/~stefank/8151539/webrev.02/ > > I moved the AlwaysTrueClosure to iterator.hpp, and created a stack > local instance in jniHandles.cpp. > > I also found that there's an AlwaysFalseClosure, so I took the liberty > of moving this to iterator.hpp as well. > > Just a few comments inlined: > > On 2016-03-10 00:11, Kim Barrett wrote: >>> On Mar 9, 2016, at 3:01 PM, Stefan Karlsson >>> wrote: >>> >>> Hi Mikael, >>> >>> On 2016-03-09 20:39, Mikael Gerdin wrote: >>>> Hi Stefan, >>>> >>>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>>> Hi all, >>>>> >>>>> Please review this patch to remove a bunch of redundant >>>>> AlwaysTrueClosure classes. >>>>> >>>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>>> There is still >>>> 2128 // This should be moved to the shared markSweep code! >>>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>>> 2130 public: >>>> 2131 bool do_object_b(oop p) { return true; } >>>> 2132 }; >>>> 2133 static PSAlwaysTrueClosure always_true; >>>> in psParallelCompact.cpp >>>> >>>> Otherwise the change looks good, I don't need to see an updated >>>> webrev. >>> Great that you saw this! >>> >>> I've uploaded a new webrev, to make it easier for the second reviewer: >>> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ >> A couple of things below; otherwise looks good. I don't need a new >> webrev for these. >> >> ------------------------------------------------------------------------------ >> >> src/share/vm/runtime/jniHandles.cpp >> 136 static AlwaysTrueClosure always_true; >> >> Function-scoped static initialization is not thread-safe in C++03. > > Thanks for pointing that out. It's not a problem here though, but I'll > clean this out to prevent future bugs our questions. > >> >> I don't think there's any noticable benefit to a static here even with >> thread-safe initialization, as the construction is probably pretty >> simple. (It might be simple enough that there's no actual >> thread-safety issue, but why take that chance.) > > I agree. I've changed it to a stack instance. > >> >> ------------------------------------------------------------------------------ >> >> src/share/vm/gc/shared/referenceProcessor.cpp >> 269 class AlwaysAliveClosure: public BoolObjectClosure { >> >> This local class can go away too. > > Done. > > Thanks, > StefanK > >> >> ------------------------------------------------------------------------------ >> >> src/share/vm/gc/shared/genCollectedHeap.cpp >> [removed] >> 688 class AlwaysTrueClosure: public BoolObjectClosure { >> >> src/share/vm/gc/parallel/psMarkSweep.cpp >> [removed] >> 574 class PSAlwaysTrueClosure: public BoolObjectClosure { >> >> src/share/vm/gc/parallel/psParallelCompact.cpp >> [removed] >> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >> >> Nice! Fortunately, these aren't technically ODR violations, since the >> same-named definitions are identical. >> >> ------------------------------------------------------------------------------ >> >> > From bengt.rutisson at oracle.com Tue Mar 15 07:39:59 2016 From: bengt.rutisson at oracle.com (Bengt Rutisson) Date: Tue, 15 Mar 2016 08:39:59 +0100 Subject: RFR: 8151534: Refactor ArrayAllocator for easier reuse In-Reply-To: <56E04E63.9050405@oracle.com> References: <56E04E63.9050405@oracle.com> Message-ID: <56E7BC4F.8060605@oracle.com> Hi Stefan, On 2016-03-09 17:25, Stefan Karlsson wrote: > Hi all, > > Please review this patch to refactor the ArrayAllocator code. > > http://cr.openjdk.java.net/~stefank/8151534/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8151534 > > ArrayAllocator is used to either allocate an array with malloc or > mmap. This patch extracts the allocation code into two separate > classes: MmapArrayAllocator and MallocArrayAllocator. ArrayAllocator > will dispatch to one of these classes depending on the size of the > allocation. The main motivation for this patch is to allow the fix for > JDK-8077144 to reuse the code in MmapArrayAllocator. Looks good. Bengt > > Thanks, > StefanK From stefan.karlsson at oracle.com Tue Mar 15 07:47:56 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 08:47:56 +0100 Subject: RFR: 8151534: Refactor ArrayAllocator for easier reuse In-Reply-To: <1457610080.2780.6.camel@oracle.com> References: <56E04E63.9050405@oracle.com> <1457610080.2780.6.camel@oracle.com> Message-ID: <56E7BE2C.9030002@oracle.com> Thanks, Thomas. StefanK On 10/03/16 12:41, Thomas Schatzl wrote: > Hi, > > On Wed, 2016-03-09 at 17:25 +0100, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to refactor the ArrayAllocator code. >> >> http://cr.openjdk.java.net/~stefank/8151534/webrev.00 >> https://bugs.openjdk.java.net/browse/JDK-8151534 >> >> ArrayAllocator is used to either allocate an array with malloc or >> mmap. >> This patch extracts the allocation code into two separate classes: >> MmapArrayAllocator and MallocArrayAllocator. ArrayAllocator will >> dispatch to one of these classes depending on the size of the >> allocation. The main motivation for this patch is to allow the fix >> for >> JDK-8077144 to reuse the code in MmapArrayAllocator. > looks good. I will put MmapArrayAllocator to good use :) > > Thanks, > Thomas > From stefan.karlsson at oracle.com Tue Mar 15 07:48:14 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 08:48:14 +0100 Subject: RFR: 8151534: Refactor ArrayAllocator for easier reuse In-Reply-To: <56E7BC4F.8060605@oracle.com> References: <56E04E63.9050405@oracle.com> <56E7BC4F.8060605@oracle.com> Message-ID: <56E7BE3E.1010900@oracle.com> Thanks, Bengt. StefanK On 15/03/16 08:39, Bengt Rutisson wrote: > > Hi Stefan, > > On 2016-03-09 17:25, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to refactor the ArrayAllocator code. >> >> http://cr.openjdk.java.net/~stefank/8151534/webrev.00 >> https://bugs.openjdk.java.net/browse/JDK-8151534 >> >> ArrayAllocator is used to either allocate an array with malloc or >> mmap. This patch extracts the allocation code into two separate >> classes: MmapArrayAllocator and MallocArrayAllocator. ArrayAllocator >> will dispatch to one of these classes depending on the size of the >> allocation. The main motivation for this patch is to allow the fix >> for JDK-8077144 to reuse the code in MmapArrayAllocator. > > Looks good. > > Bengt > >> >> Thanks, >> StefanK > From thomas.schatzl at oracle.com Tue Mar 15 08:28:45 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Tue, 15 Mar 2016 09:28:45 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E7BC35.3070803@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <56E13743.4030802@oracle.com> <56E7BC35.3070803@oracle.com> Message-ID: <1458030525.2323.4.camel@oracle.com> Hi Stefan, On Tue, 2016-03-15 at 08:39 +0100, Stefan Karlsson wrote: > Hi reviewers, > > Are you OK with the latest patch? > still looks good. Thomas From stefan.karlsson at oracle.com Tue Mar 15 08:51:42 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 09:51:42 +0100 Subject: [9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries In-Reply-To: <56E70768.6080708@oracle.com> References: <56E1C31B.8070008@oracle.com> <56E1E9C3.40006@oracle.com> <56E1F21E.80106@oracle.com> <56E1F9A8.2000608@oracle.com> <56E70768.6080708@oracle.com> Message-ID: <56E7CD1E.6060508@oracle.com> Hi Vladimir, On 14/03/16 19:48, Vladimir Ivanov wrote: > Jon, > > Updated version: > http://cr.openjdk.java.net/~vlivanov/8151623/webrev.03/ There's a type mismatch here: 149 static const size_t metadata_chunk_initialize = 0xf7f7f7f7; 150 151 void mangle(juint word_value = metadata_chunk_initialize); Otherwise, this looks good. Thanks, StefanK > >> If there is a mistake in the mangling of a Metablock, that would >> show up when the Metaspace shrinks. Can you check that the testing >> has some Metaspace shrinking. I think that -Xlog:gc*=trace would >> show the needed output. > Thanks for the hint! It found one problem with -Xlog:gc*=trace itself: > BlockFreelist keeps the tree of free blocks inside Metachunks and > dumps the content from the destructor. > > Mangling breaks it because it happens earlier and destroys the free > list structure by the time BlockFreelist destructor is called. > > I fixed it by dumping the free list content before Metachunks are > mangled. > > I ran a stress test on class loading and ensured there's no memory > leak in Metaspace. > > Best regards, > Vladimir Ivanov > > PS: maybe add a -Xlog:gc,metaspace,freelist=trace event for metachunk > mangling? From stefan.karlsson at oracle.com Tue Mar 15 09:04:29 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 10:04:29 +0100 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks Message-ID: <56E7D01D.7080401@oracle.com> Hi all, Please review this patch to remove the unused SpaceManager::mangle_freed_chunks. http://cr.openjdk.java.net/~stefank/8026720/webrev.00 https://bugs.openjdk.java.net/browse/JDK-8026720 The original bug proposed that we should add Metachunk mangling. That part is already being fixed with: http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103.html Thanks, StefanK From stefan.karlsson at oracle.com Tue Mar 15 09:06:23 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 10:06:23 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <1458030525.2323.4.camel@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <56E13743.4030802@oracle.com> <56E7BC35.3070803@oracle.com> <1458030525.2323.4.camel@oracle.com> Message-ID: <56E7D08F.6010808@oracle.com> Thanks, Thomas. StefanK On 15/03/16 09:28, Thomas Schatzl wrote: > Hi Stefan, > > On Tue, 2016-03-15 at 08:39 +0100, Stefan Karlsson wrote: >> Hi reviewers, >> >> Are you OK with the latest patch? >> > still looks good. > > Thomas From mikael.gerdin at oracle.com Tue Mar 15 09:07:56 2016 From: mikael.gerdin at oracle.com (Mikael Gerdin) Date: Tue, 15 Mar 2016 10:07:56 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E7BC35.3070803@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <56E13743.4030802@oracle.com> <56E7BC35.3070803@oracle.com> Message-ID: <56E7D0EC.7010803@oracle.com> Stefan, On 2016-03-15 08:39, Stefan Karlsson wrote: > Hi reviewers, > > Are you OK with the latest patch? Looks good to me. /Mikael > > Thanks, > StefanK > > On 10/03/16 09:58, Stefan Karlsson wrote: >> Hi Kim, >> >> Updated webrevs: >> http://cr.openjdk.java.net/~stefank/8151539/webrev.02.delta/ >> http://cr.openjdk.java.net/~stefank/8151539/webrev.02/ >> >> I moved the AlwaysTrueClosure to iterator.hpp, and created a stack >> local instance in jniHandles.cpp. >> >> I also found that there's an AlwaysFalseClosure, so I took the liberty >> of moving this to iterator.hpp as well. >> >> Just a few comments inlined: >> >> On 2016-03-10 00:11, Kim Barrett wrote: >>>> On Mar 9, 2016, at 3:01 PM, Stefan Karlsson >>>> wrote: >>>> >>>> Hi Mikael, >>>> >>>> On 2016-03-09 20:39, Mikael Gerdin wrote: >>>>> Hi Stefan, >>>>> >>>>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>>>> Hi all, >>>>>> >>>>>> Please review this patch to remove a bunch of redundant >>>>>> AlwaysTrueClosure classes. >>>>>> >>>>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>>>> There is still >>>>> 2128 // This should be moved to the shared markSweep code! >>>>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>>>> 2130 public: >>>>> 2131 bool do_object_b(oop p) { return true; } >>>>> 2132 }; >>>>> 2133 static PSAlwaysTrueClosure always_true; >>>>> in psParallelCompact.cpp >>>>> >>>>> Otherwise the change looks good, I don't need to see an updated >>>>> webrev. >>>> Great that you saw this! >>>> >>>> I've uploaded a new webrev, to make it easier for the second reviewer: >>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ >>> A couple of things below; otherwise looks good. I don't need a new >>> webrev for these. >>> >>> ------------------------------------------------------------------------------ >>> >>> src/share/vm/runtime/jniHandles.cpp >>> 136 static AlwaysTrueClosure always_true; >>> >>> Function-scoped static initialization is not thread-safe in C++03. >> >> Thanks for pointing that out. It's not a problem here though, but I'll >> clean this out to prevent future bugs our questions. >> >>> >>> I don't think there's any noticable benefit to a static here even with >>> thread-safe initialization, as the construction is probably pretty >>> simple. (It might be simple enough that there's no actual >>> thread-safety issue, but why take that chance.) >> >> I agree. I've changed it to a stack instance. >> >>> >>> ------------------------------------------------------------------------------ >>> >>> src/share/vm/gc/shared/referenceProcessor.cpp >>> 269 class AlwaysAliveClosure: public BoolObjectClosure { >>> >>> This local class can go away too. >> >> Done. >> >> Thanks, >> StefanK >> >>> >>> ------------------------------------------------------------------------------ >>> >>> src/share/vm/gc/shared/genCollectedHeap.cpp >>> [removed] >>> 688 class AlwaysTrueClosure: public BoolObjectClosure { >>> >>> src/share/vm/gc/parallel/psMarkSweep.cpp >>> [removed] >>> 574 class PSAlwaysTrueClosure: public BoolObjectClosure { >>> >>> src/share/vm/gc/parallel/psParallelCompact.cpp >>> [removed] >>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>> >>> Nice! Fortunately, these aren't technically ODR violations, since the >>> same-named definitions are identical. >>> >>> ------------------------------------------------------------------------------ >>> >>> >> > From stefan.karlsson at oracle.com Tue Mar 15 09:09:43 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 10:09:43 +0100 Subject: RFR: 8151539: Remove duplicate AlwaysTrueClosures In-Reply-To: <56E7D0EC.7010803@oracle.com> References: <56E052E3.2040209@oracle.com> <56E07C0C.5000804@oracle.com> <56E08117.1090706@oracle.com> <56E13743.4030802@oracle.com> <56E7BC35.3070803@oracle.com> <56E7D0EC.7010803@oracle.com> Message-ID: <56E7D157.9010804@oracle.com> Thanks, Mikael. StefanK On 15/03/16 10:07, Mikael Gerdin wrote: > Stefan, > > On 2016-03-15 08:39, Stefan Karlsson wrote: >> Hi reviewers, >> >> Are you OK with the latest patch? > > Looks good to me. > > /Mikael > >> >> Thanks, >> StefanK >> >> On 10/03/16 09:58, Stefan Karlsson wrote: >>> Hi Kim, >>> >>> Updated webrevs: >>> http://cr.openjdk.java.net/~stefank/8151539/webrev.02.delta/ >>> http://cr.openjdk.java.net/~stefank/8151539/webrev.02/ >>> >>> I moved the AlwaysTrueClosure to iterator.hpp, and created a stack >>> local instance in jniHandles.cpp. >>> >>> I also found that there's an AlwaysFalseClosure, so I took the liberty >>> of moving this to iterator.hpp as well. >>> >>> Just a few comments inlined: >>> >>> On 2016-03-10 00:11, Kim Barrett wrote: >>>>> On Mar 9, 2016, at 3:01 PM, Stefan Karlsson >>>>> wrote: >>>>> >>>>> Hi Mikael, >>>>> >>>>> On 2016-03-09 20:39, Mikael Gerdin wrote: >>>>>> Hi Stefan, >>>>>> >>>>>> On 2016-03-09 17:44, Stefan Karlsson wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> Please review this patch to remove a bunch of redundant >>>>>>> AlwaysTrueClosure classes. >>>>>>> >>>>>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.00/ >>>>>> There is still >>>>>> 2128 // This should be moved to the shared markSweep code! >>>>>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>>>>> 2130 public: >>>>>> 2131 bool do_object_b(oop p) { return true; } >>>>>> 2132 }; >>>>>> 2133 static PSAlwaysTrueClosure always_true; >>>>>> in psParallelCompact.cpp >>>>>> >>>>>> Otherwise the change looks good, I don't need to see an updated >>>>>> webrev. >>>>> Great that you saw this! >>>>> >>>>> I've uploaded a new webrev, to make it easier for the second >>>>> reviewer: >>>>> http://cr.openjdk.java.net/~stefank/8151539/webrev.01/ >>>> A couple of things below; otherwise looks good. I don't need a new >>>> webrev for these. >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> >>>> src/share/vm/runtime/jniHandles.cpp >>>> 136 static AlwaysTrueClosure always_true; >>>> >>>> Function-scoped static initialization is not thread-safe in C++03. >>> >>> Thanks for pointing that out. It's not a problem here though, but I'll >>> clean this out to prevent future bugs our questions. >>> >>>> >>>> I don't think there's any noticable benefit to a static here even with >>>> thread-safe initialization, as the construction is probably pretty >>>> simple. (It might be simple enough that there's no actual >>>> thread-safety issue, but why take that chance.) >>> >>> I agree. I've changed it to a stack instance. >>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> >>>> src/share/vm/gc/shared/referenceProcessor.cpp >>>> 269 class AlwaysAliveClosure: public BoolObjectClosure { >>>> >>>> This local class can go away too. >>> >>> Done. >>> >>> Thanks, >>> StefanK >>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> >>>> src/share/vm/gc/shared/genCollectedHeap.cpp >>>> [removed] >>>> 688 class AlwaysTrueClosure: public BoolObjectClosure { >>>> >>>> src/share/vm/gc/parallel/psMarkSweep.cpp >>>> [removed] >>>> 574 class PSAlwaysTrueClosure: public BoolObjectClosure { >>>> >>>> src/share/vm/gc/parallel/psParallelCompact.cpp >>>> [removed] >>>> 2129 class PSAlwaysTrueClosure: public BoolObjectClosure { >>>> >>>> Nice! Fortunately, these aren't technically ODR violations, since the >>>> same-named definitions are identical. >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> >>>> >>> >> From erik.joelsson at oracle.com Tue Mar 15 09:18:59 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Tue, 15 Mar 2016 10:18:59 +0100 Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> References: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> Message-ID: <56E7D383.9060609@oracle.com> Hello, As representative for the build-infra group creating the new Hotspot build, I appreciate that the changes are made in configure. That will at least automatically force me to merge them correctly when they hit the build-infra forest and will make the merge easier. The idea is to start getting the new Hotspot build in soon after Jigsaw M3 is integrated. If the GCC 6 changes get in soon enough in jdk9/dev I will be able to merge and convert in time. I like the refactoring of the FLAGS_COMPILER_CHECK_ARGUMENTS. Disabling optimizations that have obviously worked fine for a long time doesn't seem like a good idea though. I would prefer putting a conditional on the GCC version in those cases, but still keep the proposed flag check as well. There should be a toolchain version variable to compare against. I would also prefer if you could break the rather long line in hotspot-spec.gmk.in. If you would like to try out the new build in its current state, feel free to clone build-infra/jdk9. /Erik On 2016-03-15 05:18, Andrew Hughes wrote: > ----- Original Message ----- >>> On Mar 14, 2016, at 3:17 PM, Andrew Hughes wrote: >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8151841 >>> Webrev: http://cr.openjdk.java.net/~andrew/8151841/webrev.01/ >>> >>> A number of additional flags need to be passed to the C and C++ compiler >>> for OpenJDK to compile with GCC 6: >> This might not be the best time to be making interesting changes to >> the Hotspot build system in order to support a not yet released >> compiler, since there is a new Hotspot build system coming soon: >> https://bugs.openjdk.java.net/browse/JDK-8076052, >> http://openjdk.java.net/jeps/284. But I'll leave that up to the folks >> in charge of the build infrastructure. > I'm not sure I'd refer to this as 'interesting changes'. GCC 6 is in final > regression testing at the moment and will be appearing in the upcoming releases > of a number of GNU/Linux distributions. It's pretty necessary to get this fix > in now, so that it can also be fixed in 8u and get out into released versions > which are being packaged for these distributions. It may not be released right > now, but, by the time it's worked its way through the system, people will already > be experiencing build failures with GCC 6. > > I briefly saw a post about these HotSpot changes when I was about to post this, > and I was wondering when this was going to be finally cleaned up when I was working > on the patch. It's good to see it being done. I don't think it changes the need > for this patch though, as these flags also need to be added to the JDK build. > At best, it will simplify the HotSpot part of this patch, which at the moment, > is pretty ugly. Hopefully, this will mean that HotSpot is then actually using > the C++ flags rather than the C ones! If you'd like some further testing of > this new build, I'd be happy to take a look. > > My primary target for this though is 8u, so I'd like to see this in sooner rather > than later. If we wait for the HotSpot build system to change, we're going to have > a lot of broken 8u reports. > >> That said, here are some specific comments on the webrev. >> >> ------------------------------------------------------------------------------ >> common/autoconf/hotspot-spec.gmk.in >> Needs copyright update. > It looks like it did years ago. My feelings on these are that they are best > done in bulk in their own changeset. Including them with other changes makes > it hard to then backport the patch cleanly. But I can add that if it's really > necessary. > >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> 631 # These flags are required for GCC 6 builds but may not be available >> on earlier versions >> 632 NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks" >> >> According to gcc documentation, this option goes back at least into >> the 3.x series. So this seems somewhat overkill. > Possibly. I've tended to err on the side of caution; the option could equally be > removed or renamed in some future release. > >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> 631 # These flags are required for GCC 6 builds but may not be available >> on earlier versions >> ... >> 636 NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" >> >> This one does seem to be relatively new; I think it's introduced in >> gcc4.9. However, there are other places where version >> conditionalization of options is performed, such as >> hotspot/make/linux/makefiles/gcc.make, where the addition of some >> options is dependent on the version. Here it's done based on behavior >> rather than simply acceptance by the compiler being used. So, for >> example, -Wuninitialized isn't turned on until gcc4.8, because earlier >> versions apparently report false positives. >> >> Of course, there's the annoying fact that there are multiple gcc.make >> files that might need to be modified for this. But I'm not sure the >> simple "the compiler accepts this option" is the right test here. > Yes, there seems to be a lot of logic duplicated in various places. The > reason we're doing this at the root level is these options are also > being applied to the JDK build. It seems like this is also more likely > to survive the HotSpot build refactoring this way. > > Do you have an idea as to what the right test might be? I tend to > find that checking an option is accepted is better than assuming > it's accepted because we're using version x; changes can occasionally > be backported to older versions at a later date. I'm not sure > if that's what you were getting at or not. As this is an optimisation > being disabled, rather than a warning, the behaviour is not as easily > testable. > > I did consider restricting the additions to GCC >= 6, but my understanding > is that these optimisations are problematic because of some of the OpenJDK > code itself, and it's more simple luck that they haven't caused crashes before. > I'm willing to defer to someone else more familiar with the code on this one > though, and we can restrict it if it's known to be safe on earlier versions. > >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> 588 elif test "x$TOOLCHAIN_TYPE" = xgcc; then >> 589 CXXSTD_CXXFLAG="-std=gnu++98" >> 590 FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG >> -Werror], >> 591 IF_FALSE: >> [CXXSTD_CXXFLAG=""]) >> >> Checking for acceptance of this option seems like overkill. >> > Again, possibly. I know it fails with the C compiler. configure is not > particularly performance critical and it's better to fail early there than > halfway through the build. > >> ------------------------------------------------------------------------------ >> common/autoconf/flags.m4 >> >> If the new option checks weren't being made (as discussed above), the >> changes to the checker wouldn't be needed. > Agreed, it could be much simpler. I think the changes are generally beneficial > though. > >> ------------------------------------------------------------------------------ >> common/autoconf/hotspot-spec.gmk.in >> >> 113 EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) >> $(NO_NULL_POINTER_CHECK_FLAG) $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) >> >> It seems strange to only include $(NO_NULL_POINTER_CHECK_FLAG) and >> $(NO_LIFETIME_DSE_FLAG) in EXTRA_CFLAGS, but not EXTRA_CXXFLAGS. >> >> And it seems strange to include $(CXXSTD_CXXFLAG) in EXTRA_CFLAGS at >> all, rather than in EXTRA_CXXFLAGS. > It is strange, but it's because HotSpot currently completely ignores EXTRA_CXXFLAGS. > I found this out the hard way :-) > > When we were testing this by passing --with-extra-cflags and --with-extra-cxxflags > to the build, just putting the -std option in cxxflags didn't fix the HotSpot build. > There's actually no way of doing it via the command-line options such that > that the JDK C compiler doesn't get given the -std option and issue a warning > as a result. > > hotspot/make/linux/makefiles/rules.make:CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) > hotspot/make/linux/makefiles/rules.make:CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) > > EXTRA_CFLAGS are added to CFLAGS, but CXXFLAGS is only ever given -D and -I options. > Essentially it's being used to mean the pre-processor, not the C++ compiler in the > HotSpot build. The C compiler is hardly used at all in the HotSpot build. > >> ------------------------------------------------------------------------------ >> >>> 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to >>> add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a >>> working JVM. >> That's very disturbing! >> >> -fdelete-null-pointer-checks is the default in much earlier versions >> than gcc6 (since 4.5?), and much longer than that at higher >> optimization levels (since somewhere in the 3.x series?). But maybe >> gcc6 is doing a better job of recognizing the relevant situations. Or >> maybe there's a bug in gcc6, which is not a released version yet. >> >> One specific gcc6 change that could be relevant is: >> Value range propagation now assumes that the this pointer of C++ >> member functions is non-null. This eliminates common null pointer >> checks but also breaks some non-conforming code-bases (such as Qt-5, >> Chromium, KDevelop). As a temporary work-around >> -fno-delete-null-pointer-checks can be used. Wrong code can be >> identified by using -fsanitize=undefined. >> >> There's also a new warning option in gcc6 that might help find >> places where -fdelete-null-pointer-checks is leading to problems: >> -Wnull-dereference. >> >> Do you have any information as to where things are being broken by >> this option? I think I would prefer an attempt to track down this >> class of problem rather than hiding it via >> -fno-delete-null-pointer-checks. >> >> I don't have any suggestions for why gcc6 might be having problems >> because of -flifetime-dse, or how to find them. Do you? This seems >> to be a relatively new option, having been introduced in gcc4.9(?), >> and seems to have always been on by default since being introduced. >> Again, this could be a matter of gcc6 doing a better job of >> recognizing relevant situations, or a bug in that not-yet-released >> version. >> >> >> > Andrew Haley (CCed) has more details on the need for these options, > as he diagnosed the reason for the crash, with the help of the GCC > developers. From what I understand of it, it is a case of more > aggressive optimisations in the new GCC running into problems with > code that doesn't strictly conform to the specification and exhibit > undefined behaviour. The need for -flifetime-dse is covered in > comment #47 of the bug for this [0]; "an object field [is] being > accessed before the object is constructed, in breach of > C++98 [class.cdtor]". > > I concur with you that the real solution here is to fix this > undefined behaviour, but that's quite an involved job (as is > converting the code to work with C++14) and one which may not be > able to be backported when done. What I'm > proposing here is a workaround to keep OpenJDK building in > the mean-time. Getting a stable OpenJDK build on GCC 6 with > these optimisations is a more involved task. > > We could limit disabling these options to GCC 6 and above. > With this initial version of the patch, I've generally > taken the safest route; although builds with earlier versions > may not exhibit crashes, they still perform optimisations > where the basis for these optimisations is being broken > by some of the code in OpenJDK. > > [0] https://bugzilla.redhat.com/show_bug.cgi?id=1306558#c47 > > Thanks for the extensive feedback, From mikael.gerdin at oracle.com Tue Mar 15 10:01:04 2016 From: mikael.gerdin at oracle.com (Mikael Gerdin) Date: Tue, 15 Mar 2016 11:01:04 +0100 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks In-Reply-To: <56E7D01D.7080401@oracle.com> References: <56E7D01D.7080401@oracle.com> Message-ID: <56E7DD60.6090609@oracle.com> Hi Stefan, On 2016-03-15 10:04, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove the unused > SpaceManager::mangle_freed_chunks. > > http://cr.openjdk.java.net/~stefank/8026720/webrev.00 Looks good. /Mikael > https://bugs.openjdk.java.net/browse/JDK-8026720 > > The original bug proposed that we should add Metachunk mangling. That > part is already being fixed with: > http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103.html > > Thanks, > StefanK From stefan.karlsson at oracle.com Tue Mar 15 10:05:42 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 11:05:42 +0100 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks In-Reply-To: <56E7DD60.6090609@oracle.com> References: <56E7D01D.7080401@oracle.com> <56E7DD60.6090609@oracle.com> Message-ID: <56E7DE76.2060409@oracle.com> Thanks, Mikael. StefanK On 15/03/16 11:01, Mikael Gerdin wrote: > Hi Stefan, > > On 2016-03-15 10:04, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove the unused >> SpaceManager::mangle_freed_chunks. >> >> http://cr.openjdk.java.net/~stefank/8026720/webrev.00 > > Looks good. > > /Mikael > >> https://bugs.openjdk.java.net/browse/JDK-8026720 >> >> The original bug proposed that we should add Metachunk mangling. That >> part is already being fixed with: >> http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103.html >> >> >> Thanks, >> StefanK From erik.joelsson at oracle.com Tue Mar 15 10:06:27 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Tue, 15 Mar 2016 11:06:27 +0100 Subject: RFR: JDK-8151656: Minor tweaks to old Hotspot build to ease comparison with new In-Reply-To: <56E2FD7A.4070101@oracle.com> References: <56E2FD7A.4070101@oracle.com> Message-ID: <56E7DEA3.5060301@oracle.com> Any chance I could get a second review on this? Preferably from the hotspot team. /Erik On 2016-03-11 18:16, Erik Joelsson wrote: > In preparation for the new Hotspot build, there are a few changes to > the old build that needs to happen first. These changes should be > harmless, but do impact the generated binaries some. These changes are: > > * Standardizing sort order for objects on link command line on Windows > to a locale independent order. > * Working around compare differences caused by the __FILE__ macro in > certain generated files by overriding the value of __FILE__ in those > files. > > By making these changes first and separate from introducing the new > build we reduce the potential impact of when we do introduce the new > build. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8151656 > Webrev: http://cr.openjdk.java.net/~erikj/8151656/index.html > > /Erik From thomas.schatzl at oracle.com Tue Mar 15 10:18:44 2016 From: thomas.schatzl at oracle.com (Thomas Schatzl) Date: Tue, 15 Mar 2016 11:18:44 +0100 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks In-Reply-To: <56E7D01D.7080401@oracle.com> References: <56E7D01D.7080401@oracle.com> Message-ID: <1458037124.2323.12.camel@oracle.com> Hi, On Tue, 2016-03-15 at 10:04 +0100, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove the unused > SpaceManager::mangle_freed_chunks. > > http://cr.openjdk.java.net/~stefank/8026720/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8026720 > > The original bug proposed that we should add Metachunk mangling. That > part is already being fixed with: > http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103. > html looks good. Thomas From erik.joelsson at oracle.com Tue Mar 15 10:36:50 2016 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Tue, 15 Mar 2016 11:36:50 +0100 Subject: RFR: JDK-8151653: Hotspot build does not respect --enable-openjdk-only In-Reply-To: <56E75B7E.1020400@oracle.com> References: <56E2F2C7.9090301@oracle.com> <56E6123D.9020209@oracle.com> <56E75B7E.1020400@oracle.com> Message-ID: <56E7E5C2.3080108@oracle.com> Hello, New webrev where "closed" is replaced with "custom". http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.02/ Also, to clarify the refactoring of trace.xml here on the list too. I needed to create 2 separate entry points, one open and one closed trace.xml. The way xinclude works, I can't just include the open trace.xml from the closed one, I have to refactor them to instead include the same content. That's why I moved the contents of the current open trace.xml to two new files, one for each XML-tag at that level in the XML. /Erik On 2016-03-15 01:46, David Holmes wrote: > On 14/03/2016 11:22 AM, David Holmes wrote: >> Hi Erik, >> >> On 12/03/2016 2:31 AM, Erik Joelsson wrote: >>> Hello, >>> >>> When building hotspot with closed sources present and configuring with >>> --enable-openjdk-only, various closed parts are included in the build >>> anyway, at least on Windows. This needs to be fixed in preparation for >>> the new hotspot build for build output comparisons to be meaningful >>> between the old and new. >>> >>> The major culprit here, which applies to all platforms, is the trace >>> source generation. The base trace.xml uses XInclude to explicitly and >>> unconditionally include closed xml files if present. I'm fixing this by >>> introducing a closed version of trace.xml which includes the open and >>> closed parts, while the open trace.xml only includes the open parts. >> >> You've also done a significant amount of refactoring of that file and >> split it into three parts. It's hard to spot the actual functional >> differences in all that. > > Sorry that was a bit terse. It would have been clearer if you had > explained about the refactoring. I can see why the refactoring was > needed. > > Thanks, > David > ----- > >> Given we have distinct directories from which we locate files it is a >> pity to introduce something like this: >> >> XML_DEPS += $(TraceAltSrcDir)/traceeventsclosed.xml >> >> where traceevents.xml is now traceeventsclosed.xml. This "alt src" >> mechanism was supposed to abstract away the details of any particular >> alternative configuration so that we didn't hardcode "closed" all over >> the place. Other community members are supposed to be able to utilize >> these mechanisms for their own customized build environments. >> >>> The rest of the changes are just for Windows, making sure the OPENJDK >>> variable is propagated into the nmake build and making all conditionals >>> on including closed source also check that variable. >> >> make/windows/build.make >> >> The combination !openjdk && !exists "closed" should be an error. >> >> As a meta-comment I think we've lost the plot somewhat with these "alt" >> locations and how we manage them. The Oracle "closed" variants should >> only be used when not trying to build OpenJDK (even if the files exist >> in a forest), but other custom implementations may work in conjunction >> with an OpenJDK build. To that end the "do nothing if building OpenJDK" >> should be located within the "alt" files themselves, not at the point of >> inclusion/use in the open files. >> >> David >> ----- >> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8151653 >>> Webrev: >>> http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.01/index.html >>> >>> /Erik From stefan.karlsson at oracle.com Tue Mar 15 10:49:12 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 11:49:12 +0100 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks In-Reply-To: <1458037124.2323.12.camel@oracle.com> References: <56E7D01D.7080401@oracle.com> <1458037124.2323.12.camel@oracle.com> Message-ID: <56E7E8A8.7000600@oracle.com> Thanks, Thomas. StefanK On 15/03/16 11:18, Thomas Schatzl wrote: > Hi, > > On Tue, 2016-03-15 at 10:04 +0100, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove the unused >> SpaceManager::mangle_freed_chunks. >> >> http://cr.openjdk.java.net/~stefank/8026720/webrev.00 >> https://bugs.openjdk.java.net/browse/JDK-8026720 >> >> The original bug proposed that we should add Metachunk mangling. That >> part is already being fixed with: >> http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103. >> html > looks good. > > Thomas From vladimir.x.ivanov at oracle.com Tue Mar 15 10:51:36 2016 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Tue, 15 Mar 2016 13:51:36 +0300 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks In-Reply-To: <56E7D01D.7080401@oracle.com> References: <56E7D01D.7080401@oracle.com> Message-ID: <56E7E938.5070902@oracle.com> Looks good. Best regards, Vladimir Ivanov On 3/15/16 12:04 PM, Stefan Karlsson wrote: > Hi all, > > Please review this patch to remove the unused > SpaceManager::mangle_freed_chunks. > > http://cr.openjdk.java.net/~stefank/8026720/webrev.00 > https://bugs.openjdk.java.net/browse/JDK-8026720 > > The original bug proposed that we should add Metachunk mangling. That > part is already being fixed with: > http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103.html > > Thanks, > StefanK From stefan.karlsson at oracle.com Tue Mar 15 11:50:34 2016 From: stefan.karlsson at oracle.com (Stefan Karlsson) Date: Tue, 15 Mar 2016 12:50:34 +0100 Subject: RFR: 8026720: Remove the unused SpaceManager::mangle_freed_chunks In-Reply-To: <56E7E938.5070902@oracle.com> References: <56E7D01D.7080401@oracle.com> <56E7E938.5070902@oracle.com> Message-ID: <56E7F70A.1050301@oracle.com> Thanks, Vladimir. StefanK On 15/03/16 11:51, Vladimir Ivanov wrote: > Looks good. > > Best regards, > Vladimir Ivanov > > On 3/15/16 12:04 PM, Stefan Karlsson wrote: >> Hi all, >> >> Please review this patch to remove the unused >> SpaceManager::mangle_freed_chunks. >> >> http://cr.openjdk.java.net/~stefank/8026720/webrev.00 >> https://bugs.openjdk.java.net/browse/JDK-8026720 >> >> The original bug proposed that we should add Metachunk mangling. That >> part is already being fixed with: >> http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-March/022103.html >> >> >> Thanks, >> StefanK From david.holmes at oracle.com Tue Mar 15 12:33:49 2016 From: david.holmes at oracle.com (David Holmes) Date: Tue, 15 Mar 2016 22:33:49 +1000 Subject: RFR: JDK-8151653: Hotspot build does not respect --enable-openjdk-only In-Reply-To: <56E7E5C2.3080108@oracle.com> References: <56E2F2C7.9090301@oracle.com> <56E6123D.9020209@oracle.com> <56E75B7E.1020400@oracle.com> <56E7E5C2.3080108@oracle.com> Message-ID: <56E8012D.3030202@oracle.com> Thanks Erik! Looks okay to me. David On 15/03/2016 8:36 PM, Erik Joelsson wrote: > Hello, > > New webrev where "closed" is replaced with "custom". > http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.02/ > > Also, to clarify the refactoring of trace.xml here on the list too. I > needed to create 2 separate entry points, one open and one closed > trace.xml. The way xinclude works, I can't just include the open > trace.xml from the closed one, I have to refactor them to instead > include the same content. That's why I moved the contents of the current > open trace.xml to two new files, one for each XML-tag at that level in > the XML. > > /Erik > > On 2016-03-15 01:46, David Holmes wrote: >> On 14/03/2016 11:22 AM, David Holmes wrote: >>> Hi Erik, >>> >>> On 12/03/2016 2:31 AM, Erik Joelsson wrote: >>>> Hello, >>>> >>>> When building hotspot with closed sources present and configuring with >>>> --enable-openjdk-only, various closed parts are included in the build >>>> anyway, at least on Windows. This needs to be fixed in preparation for >>>> the new hotspot build for build output comparisons to be meaningful >>>> between the old and new. >>>> >>>> The major culprit here, which applies to all platforms, is the trace >>>> source generation. The base trace.xml uses XInclude to explicitly and >>>> unconditionally include closed xml files if present. I'm fixing this by >>>> introducing a closed version of trace.xml which includes the open and >>>> closed parts, while the open trace.xml only includes the open parts. >>> >>> You've also done a significant amount of refactoring of that file and >>> split it into three parts. It's hard to spot the actual functional >>> differences in all that. >> >> Sorry that was a bit terse. It would have been clearer if you had >> explained about the refactoring. I can see why the refactoring was >> needed. >> >> Thanks, >> David >> ----- >> >>> Given we have distinct directories from which we locate files it is a >>> pity to introduce something like this: >>> >>> XML_DEPS += $(TraceAltSrcDir)/traceeventsclosed.xml >>> >>> where traceevents.xml is now traceeventsclosed.xml. This "alt src" >>> mechanism was supposed to abstract away the details of any particular >>> alternative configuration so that we didn't hardcode "closed" all over >>> the place. Other community members are supposed to be able to utilize >>> these mechanisms for their own customized build environments. >>> >>>> The rest of the changes are just for Windows, making sure the OPENJDK >>>> variable is propagated into the nmake build and making all conditionals >>>> on including closed source also check that variable. >>> >>> make/windows/build.make >>> >>> The combination !openjdk && !exists "closed" should be an error. >>> >>> As a meta-comment I think we've lost the plot somewhat with these "alt" >>> locations and how we manage them. The Oracle "closed" variants should >>> only be used when not trying to build OpenJDK (even if the files exist >>> in a forest), but other custom implementations may work in conjunction >>> with an OpenJDK build. To that end the "do nothing if building OpenJDK" >>> should be located within the "alt" files themselves, not at the point of >>> inclusion/use in the open files. >>> >>> David >>> ----- >>> >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8151653 >>>> Webrev: >>>> http://cr.openjdk.java.net/~erikj/8151653/webrev.hotspot.01/index.html >>>> >>>> /Erik > From sgehwolf at redhat.com Tue Mar 15 15:07:25 2016 From: sgehwolf at redhat.com (Severin Gehwolf) Date: Tue, 15 Mar 2016 16:07:25 +0100 Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: References: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> Message-ID: <1458054445.3565.37.camel@redhat.com> On Mon, 2016-03-14 at 18:55 -0400, Kim Barrett wrote: [...] > > > > 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to > > add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a > > working JVM. > I don't have any suggestions for why gcc6 might be having problems > because of -flifetime-dse, or how to find them.??Do you???This seems > to be a relatively new option, having been introduced in gcc4.9(?), > and seems to have always been on by default since being introduced. > Again, this could be a matter of gcc6 doing a better job of > recognizing relevant situations, or a bug in that not-yet-released > version. FWIW: GCC 6 probably does a better job at dead store elimination. Here is the ?Fedora bug and the comment from Andrew Haley where we discovered this: https://bugzilla.redhat.com/show_bug.cgi?id=1306558#c47 Example (for a debug build): http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/file/4216fd7e4301/src/share/vm/opto/node.hpp#l217 n->_in is being assigned before it's constructed. In JDK 8 there is n- >_out being assigned to outside the ifdef ASSERT. Cheers, Severin From vladimir.kozlov at oracle.com Tue Mar 15 15:53:54 2016 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Tue, 15 Mar 2016 08:53:54 -0700 Subject: [9] RFR(S): 8144693: Intrinsify StringCoding.hasNegatives() on SPARC In-Reply-To: <56DDBACC.2020405@oracle.com> References: <56D77856.1020707@oracle.com> <56D7BFA6.1000401@oracle.com> <56DDBACC.2020405@oracle.com> Message-ID: <56E83012.40802@oracle.com> Somehow I missed this mail. Changes looks good now. Thanks, Vladimir On 3/7/16 9:30 AM, Guy Delamarter wrote: > Hi, > > On 03/02/2016 08:37 PM, Vladimir Kozlov wrote: >> Why you are avoiding the same register for src and dst in >> instructions? For example: >> >> + add(t3, 0x80, t2); >> >> I think you can use less registers if you reuse registers. The less >> registers you use - less registers will be spilled on stack in the >> code which use your code. > > Spilling doesn't appear to be a problem in actual hasNegatives use. In > the cases I've looked at, on entry the second parameter, size, is copied > from one register (e.g. %i3) to %g3 and both are preserved all the way > through the hasNegatives code, without prior spill. The former register > is then the one used after exit. If register pressure and resulting > spilling becomes an issue, hopefully there is some way to eliminate the > duplication. > >> >> >> 'size' register is defined as 32-bit values in .ad file. It may have >> garbage in apper bits - I would suggest to sign extend it before using: >> > Good to know. > >> signx(size); >> > > >> If size is small (t5 != 0 for unaligned header) may be we should just >> jump to tail code to do right shift (to mov(0, result); instruction). >> But I am not insisting on this. > > If I understand correctly that replaces two instructions with three, one > of which is a branch, without providing additional function. > > I made the other changes, and after I noticed the minor problem, fixed > it so unaligned array segments of size 0 won't perform any reads. > > New Webrevs: > > http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.01/ > http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.01/ > > > Thanks, > Guy Delamarter > >> >> >> Thanks, >> Vladimir >> >> On 3/2/16 3:33 PM, Guy Delamarter wrote: >>> Hi, >>> >>> Please review the following patch adding a SPARC intrinsic for >>> StringCoding.hasNegatives to hotspot and supporting changes. >>> >>> Tobias Hartmann (tobias.hartmann at oracle.com) has offered to >>> sponsor these changes. >>> >>> >>> Summary: >>> >>> hasNegatives is a utility method for encoding/decoding under the new >>> Compact Strings framework, returning whether the given byte array >>> (segment) contains any negative entries. hasNegatives is an intrinsic >>> candidate, emitted by hotspot as a node in the latest Java 9 builds, >>> but the SPARC node match and (inline assembly) implementation have >>> been missing up to now. This implementation checks aligned 8-byte >>> windows onto the array segment for negative bytes, carefully ignoring >>> bytes in the window that happen to be outside the segment. >>> >>> It was discovered that the private access of the hasNegatives method >>> prevented direct testing of the intrinsic from outside StringCoding, >>> so that was changed to public. Subsequent to this change a compiler >>> test class (TestHasNegatives) was added providing useful validation >>> coverage. >>> >>> >>> Webrevs: >>> http://cr.openjdk.java.net/~thartmann/8144693/hotspot/webrev.00/ >>> http://cr.openjdk.java.net/~thartmann/8144693/jdk/webrev.00/ >>> >>> Issue: >>> https://bugs.openjdk.java.net/browse/JDK-8144693 >>> >>> >>> Thanks, >>> Guy Delamarter >>> > From mikael.vidstedt at oracle.com Tue Mar 15 18:33:04 2016 From: mikael.vidstedt at oracle.com (Mikael Vidstedt) Date: Tue, 15 Mar 2016 11:33:04 -0700 Subject: RFR(S): 8151233: Unify CopySwap and CopyMemory tests In-Reply-To: <56E756A5.8090703@oracle.com> References: <56E73F77.8000203@oracle.com> <56E756A5.8090703@oracle.com> Message-ID: <56E85560.10205@oracle.com> Makes sense, updated webrev: http://cr.openjdk.java.net/~mikael/webrevs/8151233/webrev.01/webrev/ Incremental: http://cr.openjdk.java.net/~mikael/webrevs/8151233/webrev.01.incr/webrev/ Cheers, Mikael On 3/14/2016 5:26 PM, David Holmes wrote: > Hi Mikael, > > On 15/03/2016 8:47 AM, Mikael Vidstedt wrote: >> >> Please review the below change. >> >> When doing the clean up of Unsafe I cheated and made a copy of the >> CopySwap test (used to test U.copySwapMemory) for testing U.copyMemory. >> Much of the code is the same, or at least similar enough, that >> duplication is unfortunate. This change moves the common code to a >> helper file CopyCommon.java, and makes both test files use that. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8151233 >> Webrev: >> http://cr.openjdk.java.net/~mikael/webrevs/8151233/webrev.00/webrev/ > > Is it worth using CopyCommon as a base class and also sharing the > UNSAFE mechanics? > > Otherwise the refactoring seems okay. > > Thanks, > David > >> Cheers, >> Mikael >> From kim.barrett at oracle.com Tue Mar 15 19:15:32 2016 From: kim.barrett at oracle.com (Kim Barrett) Date: Tue, 15 Mar 2016 15:15:32 -0400 Subject: RFR: 8151841: Build needs additional flags to compile with GCC 6 In-Reply-To: <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> References: <2045809951.9606587.1457983074565.JavaMail.zimbra@redhat.com> <1898572971.9682656.1458015527380.JavaMail.zimbra@redhat.com> Message-ID: <8B38A175-C832-4A28-BFB0-78B3FFB3B5E4@oracle.com> > On Mar 15, 2016, at 12:18 AM, Andrew Hughes wrote: I?ll probably have more to say later; just responding to one point here. >>> 2. A number of optimisations in GCC 6 lead to a broken JVM. We need to >>> add -fno-delete-null-pointer-checks and -fno-lifetime-dse to get a >>> working JVM. >> >> That's very disturbing! > > Andrew Haley (CCed) has more details on the need for these options, > as he diagnosed the reason for the crash, with the help of the GCC > developers. From what I understand of it, it is a case of more > aggressive optimisations in the new GCC running into problems with > code that doesn't strictly conform to the specification and exhibit > undefined behaviour. That is my suspicion too, though without more detail of the failures it?s hard to completely discount the possibility of compiler bugs. > The need for -flifetime-dse is covered in > comment #47 of the bug for this [0]; "an object field [is] being > accessed before the object is constructed, in breach of > C++98 [class.cdtor]?. Thanks for the pointer to the redhat bug for tracking this work: https://bugzilla.redhat.com/show_bug.cgi?id=1306558 [Though a lot of comments there aren't visible to me.] This comment is quite worrisome. https://bugzilla.redhat.com/show_bug.cgi?id=1306558#c6 I very strongly suspect that -fno-strict-aliasing is broken in this version of GCC. Is that still thought to be a concern? Or are the problems encountered covered by the two suggested -fno-