Loading fs_mgr/libsnapshot/libsnapshot_cow/writer_v3.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ bool CowWriterV3::ParseOptions() { batch_size_ = std::max<size_t>(options_.cluster_ops, 1); data_vec_.reserve(batch_size_); cached_data_.reserve(batch_size_); cached_ops_.reserve(batch_size_); cached_ops_.reserve(batch_size_ * kNonDataOpBufferSize); } if (batch_size_ > 1) { Loading Loading @@ -342,7 +342,8 @@ bool CowWriterV3::NeedsFlush() const { // Allow bigger batch sizes for ops without data. A single CowOperationV3 // struct uses 14 bytes of memory, even if we cache 200 * 16 ops in memory, // it's only ~44K. return cached_data_.size() >= batch_size_ || cached_ops_.size() >= batch_size_ * 16; return cached_data_.size() >= batch_size_ || cached_ops_.size() >= batch_size_ * kNonDataOpBufferSize; } bool CowWriterV3::ConstructCowOpCompressedBuffers(uint64_t new_block_start, const void* data, Loading fs_mgr/libsnapshot/libsnapshot_cow/writer_v3.h +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ namespace android { namespace snapshot { using namespace android::storage_literals; // This is a multiple on top of the number of data ops that can be stored in our cache at once. This // is added so that we can cache more non-data ops as it takes up less space. static constexpr uint32_t kNonDataOpBufferSize = 16; class CowWriterV3 : public CowWriterBase { public: Loading Loading
fs_mgr/libsnapshot/libsnapshot_cow/writer_v3.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ bool CowWriterV3::ParseOptions() { batch_size_ = std::max<size_t>(options_.cluster_ops, 1); data_vec_.reserve(batch_size_); cached_data_.reserve(batch_size_); cached_ops_.reserve(batch_size_); cached_ops_.reserve(batch_size_ * kNonDataOpBufferSize); } if (batch_size_ > 1) { Loading Loading @@ -342,7 +342,8 @@ bool CowWriterV3::NeedsFlush() const { // Allow bigger batch sizes for ops without data. A single CowOperationV3 // struct uses 14 bytes of memory, even if we cache 200 * 16 ops in memory, // it's only ~44K. return cached_data_.size() >= batch_size_ || cached_ops_.size() >= batch_size_ * 16; return cached_data_.size() >= batch_size_ || cached_ops_.size() >= batch_size_ * kNonDataOpBufferSize; } bool CowWriterV3::ConstructCowOpCompressedBuffers(uint64_t new_block_start, const void* data, Loading
fs_mgr/libsnapshot/libsnapshot_cow/writer_v3.h +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ namespace android { namespace snapshot { using namespace android::storage_literals; // This is a multiple on top of the number of data ops that can be stored in our cache at once. This // is added so that we can cache more non-data ops as it takes up less space. static constexpr uint32_t kNonDataOpBufferSize = 16; class CowWriterV3 : public CowWriterBase { public: Loading