mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
Merge pull request #18203 from majianpeng/bluestore-wake-kvfinathread
os/bluestore/BlueStore: ASAP wake up _kv_finalize_thread. Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn> Reviewed-by: Varada Kari <varada.kari@sandisk.com>
This commit is contained in:
commit
f9e8ba7f4d
@ -8564,6 +8564,29 @@ void BlueStore::_kv_sync_thread()
|
||||
int r = cct->_conf->bluestore_debug_omit_kv_commit ? 0 : db->submit_transaction_sync(synct);
|
||||
assert(r == 0);
|
||||
|
||||
{
|
||||
std::unique_lock<std::mutex> m(kv_finalize_lock);
|
||||
if (kv_committing_to_finalize.empty()) {
|
||||
kv_committing_to_finalize.swap(kv_committing);
|
||||
} else {
|
||||
kv_committing_to_finalize.insert(
|
||||
kv_committing_to_finalize.end(),
|
||||
kv_committing.begin(),
|
||||
kv_committing.end());
|
||||
kv_committing.clear();
|
||||
}
|
||||
if (deferred_stable_to_finalize.empty()) {
|
||||
deferred_stable_to_finalize.swap(deferred_stable);
|
||||
} else {
|
||||
deferred_stable_to_finalize.insert(
|
||||
deferred_stable_to_finalize.end(),
|
||||
deferred_stable.begin(),
|
||||
deferred_stable.end());
|
||||
deferred_stable.clear();
|
||||
}
|
||||
kv_finalize_cond.notify_one();
|
||||
}
|
||||
|
||||
if (new_nid_max) {
|
||||
nid_max = new_nid_max;
|
||||
dout(10) << __func__ << " nid_max now " << nid_max << dendl;
|
||||
@ -8598,29 +8621,6 @@ void BlueStore::_kv_sync_thread()
|
||||
bluefs_extents_reclaiming.clear();
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_lock<std::mutex> m(kv_finalize_lock);
|
||||
if (kv_committing_to_finalize.empty()) {
|
||||
kv_committing_to_finalize.swap(kv_committing);
|
||||
} else {
|
||||
kv_committing_to_finalize.insert(
|
||||
kv_committing_to_finalize.end(),
|
||||
kv_committing.begin(),
|
||||
kv_committing.end());
|
||||
kv_committing.clear();
|
||||
}
|
||||
if (deferred_stable_to_finalize.empty()) {
|
||||
deferred_stable_to_finalize.swap(deferred_stable);
|
||||
} else {
|
||||
deferred_stable_to_finalize.insert(
|
||||
deferred_stable_to_finalize.end(),
|
||||
deferred_stable.begin(),
|
||||
deferred_stable.end());
|
||||
deferred_stable.clear();
|
||||
}
|
||||
kv_finalize_cond.notify_one();
|
||||
}
|
||||
|
||||
l.lock();
|
||||
// previously deferred "done" are now "stable" by virtue of this
|
||||
// commit cycle.
|
||||
|
Loading…
Reference in New Issue
Block a user