Release store in C2 putfield
martin.doerr at sap.com
Thu Sep 4 09:29:48 UTC 2014
got it. You want to use releasing stores on AArch64 like we do it on IA64.
We exploit that the releasing stores perform better than separate memory barrier instructions on IA64.
That's why we implemented the MemBarRelease and MemBarStoreStore as empty nodes and rely on the release flag of the store nodes.
The release flag for volatile store replaces the MemBarRelease and the release_if_reference case replaces the MemBarStoreStore
which is needed to make the object initialization visible for other threads like GC. In other words, we skip the separate memory barriers
and release all oop stores.
I'm not familiar with AArch64. Don't you want to implement the 2 nodes with empty encoding?
The ARM memory model is similar to PPC where we definitely need release barriers.
I've read parts of the email thread in which you were citing "A Tutorial Introduction to the ARM and POWER Relaxed Memory Models",
but I've only seen explanations about the ordering on the reader's side. I agree with that the reader of the oop doesn't need barriers.
But how do you ensure that the writer "publishes" the initializing stores before the oop store?
From: Andrew Haley [mailto:aph at redhat.com]
Sent: Donnerstag, 4. September 2014 10:22
To: Volker Simonis; Vladimir Kozlov
Cc: hotspot-dev Source Developers; Lindenmaier, Goetz; Doerr, Martin
Subject: Re: Release store in C2 putfield
On 04/09/14 09:14, Volker Simonis wrote:
> I've just checked that we only use this flag (i.e.
> as_Store()->is_unordered()/as_Store()->is_release()) on our Itanium
> port. Other platforms use the MemBarRelease/MemBarStoreStore nodes
> which are there anyway. On Itanium, we don't use these nodes that's
> why we need the flag.
> But I don't see how this bothers anybody. If you don't use this flag
> in your .ad file in your Store nodes it will have no side effect. Or
> am I missing something?
I think you must be. We generate a release store if the node asks for
one. AArch64 doesn't usually need separate barriers.
But that's not the point, really: the point is that not every reference
store needs to be a release, which is how it is right now.
More information about the hotspot-dev