Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Use Release/Acquire instead of SeqCst for is_bank_drop_callback_enabled#24134

Merged
brooksprumo merged 1 commit intosolana-labs:masterfrom
brooksprumo:bank-drop-callback-ordering
Apr 12, 2022
Merged

Use Release/Acquire instead of SeqCst for is_bank_drop_callback_enabled#24134
brooksprumo merged 1 commit intosolana-labs:masterfrom
brooksprumo:bank-drop-callback-ordering

Conversation

@brooksprumo
Copy link
Copy Markdown
Contributor

Problem

Storing and loading AccountsDb::is_bank_drop_callback_enabled uses Ordering::SeqCst, but there are no interactions with other atomics that require sequential ordering (that I could find). Since AccountsDb::is_bank_drop_callback_enabled is loaded every time AccountsDb::purge_slot() is called, this introduces unnecessary memory barriers/fences.

Summary of Changes

Store AccountsDb::is_bank_drop_callback_enabled with Ordering::Release and load with Ordering::Acquire.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2022

Codecov Report

Merging #24134 (03b27ba) into master (2da4e3e) will decrease coverage by 0.1%.
The diff coverage is 80.5%.

@@            Coverage Diff            @@
##           master   #24134     +/-   ##
=========================================
- Coverage    81.8%    81.6%   -0.2%     
=========================================
  Files         581      590      +9     
  Lines      158312   161012   +2700     
=========================================
+ Hits       129518   131518   +2000     
- Misses      28794    29494    +700     

@brooksprumo brooksprumo marked this pull request as ready for review April 6, 2022 11:43
@brooksprumo brooksprumo requested review from carllin and sakridge April 6, 2022 11:43
@brooksprumo
Copy link
Copy Markdown
Contributor Author

If PR #24142 gets merged, this PR will be obviated and closed.

@brooksprumo
Copy link
Copy Markdown
Contributor Author

@carllin Since #24142 was closed, can you take a look at this one?

@brooksprumo brooksprumo merged commit 4fd184c into solana-labs:master Apr 12, 2022
@brooksprumo brooksprumo deleted the bank-drop-callback-ordering branch April 12, 2022 00:19
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants