Skip to content
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

atomically read page_bitmaps #810

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

AreaZR
Copy link
Contributor

@AreaZR AreaZR commented Dec 25, 2023

page_bitmaps does not need to be volatile since it is going to be treated as atomic. In fact, as long as each variable is treated as atomic, we do not need volatile at all, as that means it is modified by outside means, aka hardware, etc.

The atomic macros already ensure optimizations that could cause incorrect values to be used do not happen.

@AreaZR AreaZR force-pushed the atomically branch 2 times, most recently from 823ac37 to 941d613 Compare December 25, 2023 18:03
page_bitmaps does not need to be volatile since it is going to be treated as atomic. In fact, as long as each variable is treated as atomic, we do not need volatile at all, as that means it is modified by outside means, aka hardware, etc.

The atomic macros already ensure optimizations that could cause incorrect values to be used do not happen.

Finally, the first loop is redundant as they are iterated over again in the loop below.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant