Closed
Bug 873799
Opened 13 years ago
Closed 13 years ago
I think we need an additional barrier before __sync_lock_test_and_set in Atomics.h
Categories
(Core :: MFBT, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: justin.lebar+bug, Unassigned)
References
Details
Attachments
(1 file)
|
913 bytes,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
__sync_lock_test_and_set is only an acquire barrier. I think we need another barrier. But you tell me if this is wrong.
Jeff, let me know if you're not ok with Nathan reviewing these patches.
| Reporter | ||
Comment 1•13 years ago
|
||
Attachment #751403 -
Flags: review?(nfroyd)
Comment 2•13 years ago
|
||
This was brought up on bug 732043 comment 55, and responded to in bug 732043 comment 60. I'm not sure I grok this quite fully enough to say anything one way or the other here, fully confidently, but it's totally fine with me playing it safe. :-)
Comment 3•13 years ago
|
||
...which is to say, the fix sort of makes sense if I squint, but I might not actually be squinting fully correctly here, so I take that with a bit of a grain of salt.
| Reporter | ||
Comment 4•13 years ago
|
||
I don't grok this well enough to say with confidence, either. I'm happy to defer to froydnj. But at the very least, a comment would be nice.
| Reporter | ||
Comment 5•13 years ago
|
||
(I also feel like sacrificing perf for strict correctness here is probably the right trade-off, but again, I'm not so comfortable with all this.)
Comment 6•13 years ago
|
||
Comment on attachment 751403 [details] [diff] [review]
Patch, v1
Review of attachment 751403 [details] [diff] [review]:
-----------------------------------------------------------------
It doesn't matter one way or the other to me; I can see arguments both directions. If we start replacing PR_ATOMIC_SET and people start yelling about performance, I guess we can revisit this.
::: mfbt/Atomics.h
@@ +375,5 @@
> +
> + // __sync_lock_test_and_set is an "acquire" barrier, so loads and stores
> + // can't be moved above it (into the space between the beforeStore() and
> + // the __sync_lock_test_and_set).
> +
It makes more sense to me to move this comment prior to the call to beforeStore, something like:
// Since __sync_lock_test_and_set is only an acquire barrier, we need this
// barrier to ensure that loads and stores don't get moved after the call to it.
Comment 7•13 years ago
|
||
Comment on attachment 751403 [details] [diff] [review]
Patch, v1
Review of attachment 751403 [details] [diff] [review]:
-----------------------------------------------------------------
Here, let's actually r+ that.
Attachment #751403 -
Flags: review?(nfroyd) → review+
| Reporter | ||
Comment 8•13 years ago
|
||
Comment 9•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•