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

Fine-tune the Ordering for changed_blocks_count #309

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

wang384670111
Copy link
Contributor

let changed_blocks_count = changed_blocks_count.load(AtomicOrdering::SeqCst);

changed_blocks_count.fetch_add(1, AtomicOrdering::SeqCst);

Here changed_blocks_count is employed solely for counting purposes, rather than for synchronizing access to other shared variables. While SeqCst guarantees program correctness, it can also impact performance. Therefore, using Relaxed is sufficient to maintain the program's correctness without adversely affecting its efficiency.

Copy link
Contributor

@cbgbt cbgbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I agree that Relaxed ordering is still correct here since we don't synchronize access to other data based on the counter.


As separate feedback, do you mind making modifying the commit message? Something more specific like this would be great:

Use relaxed ordering for atomic block change counter

@wang384670111
Copy link
Contributor Author

Thanks for your contribution! I agree that Relaxed ordering is still correct here since we don't synchronize access to other data based on the counter.

As separate feedback, do you mind making modifying the commit message? Something more specific like this would be great:

Use relaxed ordering for atomic block change counter

I've made the necessary changes to the commit information. May I inquire about the possibility of merging this pull request at your earliest convenience?

Copy link
Contributor

@jpculp jpculp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uploaded a file, waited for the snapshot, downloaded the snapshot, confirmed sha512sum of the data was the same.

@rpkelly rpkelly merged commit b61c570 into awslabs:develop Feb 26, 2024
2 checks passed
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.

4 participants