[RFR]: 8186578: Zero fails to build on linux-sparc due to sparc-specific code

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Mon Aug 28 10:09:17 UTC 2017

On 08/28/2017 11:54 AM, Andrew Haley wrote:
> It certainly looks like this is wrong.  The execution of memset with concurrent
> readers while the memory is being zeroed is UB, so we need some kind of special
> handling in the general case.

Oh, I'm not saying it's wrong at all. I was just wondering whether it's actually
required for performance reasons or whether there are other, more fundamental
problems underlying.

After talking to Oracle's toolchain guy for Linux SPARC, I now know that we cannot
glibc's memset in this case, especially not on newer SPARC CPUs.

I'm pretty sure this would work:
> inline void memset_with_concurrent_readers(void* to, int value, size_t size) {
>   volatile char *dest = to;
>   for (int i = 0; i < count; i++)
>     *dest++ = value;
> }
> but its performance would be awful.

My suggestion would be to move memset_with_concurrent_readers_sparc.cpp into
a generic place in the source tree where it can be used for both the server
and the zero builds on Linux SPARC.


 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

More information about the hotspot-dev mailing list