]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/memtable/write_buffer_manager.cc
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / rocksdb / memtable / write_buffer_manager.cc
index 21b18c8f76e90d19346ea1995e5da00b0d4cabcc..7f2e664ab5e0149216e39db7ec6cd1266c33ef80 100644 (file)
@@ -79,7 +79,7 @@ WriteBufferManager::~WriteBufferManager() {
 void WriteBufferManager::ReserveMemWithCache(size_t mem) {
 #ifndef ROCKSDB_LITE
   assert(cache_rep_ != nullptr);
-  // Use a mutex to protect various data structures. Can be optimzied to a
+  // Use a mutex to protect various data structures. Can be optimized to a
   // lock-free solution if it ends up with a performance bottleneck.
   std::lock_guard<std::mutex> lock(cache_rep_->cache_mutex_);
 
@@ -102,14 +102,14 @@ void WriteBufferManager::ReserveMemWithCache(size_t mem) {
 void WriteBufferManager::FreeMemWithCache(size_t mem) {
 #ifndef ROCKSDB_LITE
   assert(cache_rep_ != nullptr);
-  // Use a mutex to protect various data structures. Can be optimzied to a
+  // Use a mutex to protect various data structures. Can be optimized to a
   // lock-free solution if it ends up with a performance bottleneck.
   std::lock_guard<std::mutex> lock(cache_rep_->cache_mutex_);
   size_t new_mem_used = memory_used_.load(std::memory_order_relaxed) - mem;
   memory_used_.store(new_mem_used, std::memory_order_relaxed);
   // Gradually shrink memory costed in the block cache if the actual
   // usage is less than 3/4 of what we reserve from the block cache.
-  // We do this becausse:
+  // We do this because:
   // 1. we don't pay the cost of the block cache immediately a memtable is
   //    freed, as block cache insert is expensive;
   // 2. eventually, if we walk away from a temporary memtable size increase,