-
Notifications
You must be signed in to change notification settings - Fork 900
master: Add volatile to the pointers in the list_item structures. #3468
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
Conversation
@bosilca This test is failing at Travis because it is generating MB worth of compile logs containing these warnings:
(Travis ultimately fails because the compile exceeds the max log size!) Are we sure that the commit on this PR is correct? |
Looks like I exaggerated, sorry -- there's not MB of logs with these kinds of warning messages. But there are at least a few dozen of these "argument discards |
This change has the side effect of improving the performance of all atomic data structures (in addition to making the code crrect under a certain interpretation of the volatile usage). This commit fixes open-mpi#3450. Signed-off-by: George Bosilca <[email protected]>
@jsquyres my compiler was more tolerant when casting a "volatile T*" into a "T*". I have fixed the warning (and travis seems clean again). |
forgive my ignorance: could you please educate me as to why the need for double volatile declarations? I'm not objecting - just truly asking to be educated. |
My understanding is that there are 3 combinations possible:
What we had before was just telling the compiler "this is a pointer to a volatile struct". We made no statements about the pointer itself, and as a result a very conservative compiler assumed that the pointer itself doesn't change. What we really need is the last form, because the pointer itself can also be changed (by another thread so the value should never be locally cached). Thus, the second |
Thanks for the explanation. I guess I'll have to read up more on that 3rd option as I'd never heard of a "volatile struct" before and I'm not sure what that means. I'll also go back to some places where I've used the volatile flag and ensure there aren't more of these to correct. |
This change has the side effect of improving the performance of all atomic data structures (in addition to making the code crrect under a certain interpretation of the volatile usage). This commit fixes open-mpi#3450. Signed-off-by: George Bosilca <[email protected]>(cherry picked from commit d7ebcca) Signed-off-by: Jeff Squyres <[email protected]>
This change has the side effect of improving the performance of all atomic data structures (in addition to making the code crrect under a certain interpretation of the volatile usage). This commit fixes open-mpi#3450. Signed-off-by: George Bosilca <[email protected]>(cherry picked from commit d7ebcca) Signed-off-by: Jeff Squyres <[email protected]>
This change has the side effect of improving the performance of all atomic data structures (in addition to making the code crrect under a certain interpretation of the volatile usage). This commit fixes open-mpi#3450. Signed-off-by: George Bosilca <[email protected]>(cherry picked from commit d7ebcca) Signed-off-by: Jeff Squyres <[email protected]>
In addition to making the code correct, it also makes it faster.
This commit fixes #3450.
Signed-off-by: George Bosilca [email protected]