logoalt Hacker News

mkeeteryesterday at 5:58 PM2 repliesview on HN

Another fun failure mode in the same vein: if you are emulating an NVMe device and declare that a write operation is successful once bytes are in memory, you will quickly find yourself buffering arbitrarily large amounts of data as "persist to disk" (SSD speed) falls behind "acknowledge writes" (RAM speed). If you do not add backpressure to your system intentionally, it will be added for you – and you may not like where it's placed!

(This also happens at the SSD level: burst writes can be very fast as data is buffered in the SSD's own RAM, then performance steady-states at the true write speed once that's saturated)


Replies

martheentoday at 2:31 AM

UFS WriteBooster not only have a buffer that eventually need to be flushed, since it uses flash cells with pseudo-SLC behavior, the write amplification is even higher, to the point that they give it a special flag because using it all the time will just kill the media faster.

throwaway_95283yesterday at 8:33 PM

if you use the linux kernel that amount of ram is tunable, and write will cause backpressure on its own when this is exceeded.