Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/bitcoin/database/impl/memory/mmap_body.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,13 @@ void CLASS::body_run_() NOEXCEPT

// Scarcity is read directly: clean cache is reclaimable, so the
// kernel pressure level does not raise while free memory exhausts.
// Once current, reads are not write-ordered, so linux reclaims
// (darwin exhausts its free target without the sweep).
#if defined(HAVE_LINUX)
if (!current_.load() && (system_free() < scarce))
#else
if (system_free() < scarce)
#endif
evict_next_(sweep, evicted);

auto bytes = backlog();
Expand Down
28 changes: 28 additions & 0 deletions include/bitcoin/database/impl/store/store.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -377,38 +377,66 @@ void CLASS::set_current(bool current) NOEXCEPT
return;

header_head_.current(current);
header_body_.current(current);
input_head_.current(current);
input_body_.current(current);
output_head_.current(current);
output_body_.current(current);
ins_head_.current(current);
ins_body_.current(current);
outs_head_.current(current);
outs_body_->current(current);
tx_head_.current(current);
tx_body_.current(current);
txs_head_.current(current);
txs_body_.current(current);
candidate_head_.current(current);
confirmed_head_.current(current);
strong_head_.current(current);
scan_head_.current(current);
scan_body_.current(current);
scan_prefix_head_.current(current);
scan_prefix_body_.current(current);
ecdsa0_head_.current(current);
ecdsa0_body_.current(current);
ecdsa1_head_.current(current);
ecdsa1_body_.current(current);
schnorr0_head_.current(current);
schnorr0_body_.current(current);
schnorr1_head_.current(current);
schnorr1_body_.current(current);
silent0_head_.current(current);
silent0_body_.current(current);
silent1_head_.current(current);
silent1_body_.current(current);
silent0_prefix_head_.current(current);
silent0_prefix_body_.current(current);
silent1_prefix_head_.current(current);
silent1_prefix_body_.current(current);
envelope_head_.current(current);
duplicate_head_.current(current);
duplicate_body_.current(current);
prevalid0_head_.current(current);
prevalid0_body_.current(current);
prevalid1_head_.current(current);
prevalid1_body_.current(current);
presilent0_head_.current(current);
presilent0_body_.current(current);
presilent1_head_.current(current);
presilent1_body_.current(current);
prevout_head_.current(current);
prevout_body_.current(current);
state_head_.current(current);
pool_head_.current(current);
pool_body_.current(current);
spends_head_.current(current);
spends_body_.current(current);
wtxid_head_.current(current);
wtxid_body_.current(current);
filter_bk_head_.current(current);
filter_bk_body_.current(current);
filter_tx_head_.current(current);
filter_tx_body_.current(current);
}

TEMPLATE
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/memory/mmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class mmap
// Set when a quiescent head settles to its file mapping (retires tracking).
std::atomic_bool shared_{};

// Set while the store reports currency (permits settle).
// Set while the store is current (permits settle, stops linux eviction).
std::atomic_bool current_{};

// Set across a settle transition (head writers back off, uncounted).
Expand Down
Loading