-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atomics fixes #992
Closed
Closed
Atomics fixes #992
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is true, since the PPO rules order the acquire with all younger instructions and order the release with all older instructions.
In any case, this is why I'd like to constrain the textual changes to the mapping section in the appendix, rather than modifying the normative text in the A chapter that defines the instructions. @daniellustig can you spare some time to work with Hans to organize this PR in a way we'd all find agreeable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have misunderstood your request. I did enclose this in a commentary block, which presumably is non-normative?
Regarding the technical issue: If I have
s; lr.aq; sc.rl; l
where the lr and sc refer to the same location, but the s and l refer to different locations, I don't believe there is anything to prevent s and the l from being reordered in between the lr and sc, and then past each other. In that sense, the lr;sc does not act as a fence. You get the same phenomenon with programming-language-level locks and relaxed atomic operations (in spite of some amount of code the incorrectly assumes that critical sections are fences)
If you know of a better way to state this, I would be happy to do so. I think this is worth stating in commentary because many people find it surprising, and I think the Linux kernel has tried to strengthen some atomics primitives to avoid it, something I would argue against.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, @hboehm, I misread the TeX: you did, indeed, enclose this note within the commentary, thus making it non-normative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As to the technical matter, I agree on further reflection that I can't find a PPO rule that suggests
s
andl
are ordered.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the proposed change. It did clarify more important things.
As a further improvement, I suggest we state the following fact explicitly: