Skip to content

sync/atomic: make load and store fully sequentially consistent on s390x #32428

Closed
@mundaym

Description

@mundaym

As discussed in https://groups.google.com/forum/#!topic/golang-dev/KKfRLcTeb0E loads and stores are not fully sequentially consistent on s390x since loads may be moved before stores if they access independent memory locations. This is similar to the memory model used by amd64.

We can force full sequential consistency of memory accesses by using fast serialization instructions (SYNC in Go asm). From discussion in #5045 it seems it is probably worth adding serialization between loads and stores in the sync/atomic package at least.

As far as I can tell the runtime doesn't currently require full sequential consistency, so I'm inclined to leave the atomic implementations as they are until a requirement to change them arises. (Does this sound reasonable @aclements?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions