DiskBackedFS: Flush write cache if it reaches 32 entries before sync.

This is just to avoid chewing through all of the kernel memory. There is a
lot of room for improvement here, and 32 is just a number from the place
where numbers come from.
This commit is contained in:
Andreas Kling 2019-04-27 17:30:32 +02:00
parent dde8d90747
commit 52139a2392
Notes: sideshowbarker 2024-07-19 14:34:23 +09:00

View file

@ -69,6 +69,10 @@ bool DiskBackedFS::write_block(unsigned index, const ByteBuffer& data)
LOCKER(m_lock);
m_write_cache.set(index, data.isolated_copy());
if (m_write_cache.size() >= 32)
flush_writes();
return true;
}