RFR (L): 8003868: fix shark for latest HotSpot and LLVM [Was: Re: RFR: Fix shark for latest Hotspot and LLVM]

Roman Kennke rkennke at redhat.com
Mon Nov 26 06:20:22 PST 2012

Am Montag, den 26.11.2012, 17:08 +0400 schrieb Aleksey Shipilev:
> On 11/26/2012 04:58 PM, Roman Kennke wrote:
> > Am Montag, den 26.11.2012, 09:50 +0000 schrieb Andrew Haley:
> >> On 11/23/2012 05:14 PM, Roman Kennke wrote:
> >>
> >>>
> >>> Alright, I found another fairly grave bug that I would like to include a
> >>> fix for: apparently, a 'fence' is not enough of a memory barrier for
> >>> volatile putfield/getfield (duh). Which basically broke all of j.u.c.
> >>> LLVM offers atomic loads and stores, which seem to be exactly what is
> >>> needed for volatile field access. However, it does not provide helper
> >>> functions for those in llvm::IRBuilder so I wrote my own. This should be
> >>> the final patch for now (unless you find something else).
> >>>
> >>> http://cr.openjdk.java.net/~rkennke/shark/webrev.03/
> >>
> >> I note that you've used llvm::SequentiallyConsistent for all the atomic
> >> accesses.  This looks right to me, but if there's any doubt you could
> >> ask Doug Lea.
> > 
> > Yeah. Except for monitorenter and monitorexit, where I used Acquire and
> > Release (which I believe is right too, at least it seems *very*
> > sensible :-) ). The other access flags (unordered and monotonic) don't
> > seem to have a mapping in Java, except maybe in some of the many Unsafe
> > intrinsics, but they are not implemented in Shark (yet).
> My 2c: making atomics SC is ok. I wonder if Shark can pass the
> concurrency torture tests [1]? (if you run these, make sure you do that
> against the latest hotspot-comp)

Wow, that is a great test. As far as I can tell (in a short
default-options run), Shark does everything correctly (i.e. all
FORBIDDEN have 0 occurances, all REQUIRED do happen, etc).

Speaking of hotspot-comp, I tried to run JVMSpec with Shark and it
seemed to get stuck in one of the tests (don't remember which one). Then
I tried it with latest hotspot-comp and it got stuck in the same place.
(No idea what it was though, need to look closer when I find some time).


More information about the hotspot-dev mailing list