← Back to context

Comment by undecisive

4 years ago

Could you explain the question?

As far as I understand (which is little more than this twitter thread) the flush command should only return a success response once any data has been written to non-volatile storage.

If the storage still requires power after that point to maintain the data, that storage area is volatile, no?

So if the device has returned success (and I'm not going to claim that they've ensured that it was the device returning success and not the adapter, or that they even verified what the response was - those seem like valid questions) presumably the power wind-down should not be an issue?

That said, I presumed by "disconnect the cable" the test involved some extension cable from the motherboard straight to drive to make it easier to disconnect - would that therefore make it a valid test of the NVMe?

You understand incorrectly. Flush means data is in volatile DRAM in the device. That's how SSDs work.

Extension cable from motherboard would certainly make it invalid. These devices are not hot swap and may expect power hold up and sequencing from the supply.

  • You're wrong. Please read the NVMe spec, section 7.1:

    > the Flush command shall commit data and metadata associated with the specified namespace(s) to non-volatile media

    It has nothing to do with DRAM. The spec is explicit about what Flush does. The drive is not allowed to ack the flush until the data and drive metadata are on durable storage.

    For a discussion on what happens when the drive has power loss protection, see 5.24.2.1 - in that case the write cache (aka DRAM) is considered non-volatile and Flush can be a no-op. None of the drives I tested fell into that category however.

    • I agree with all that. Thanks for your knowledge. I am not a storage or driver engineer so I apologize for imprecise comments. Let's take a peak at section 5.2x.x (depends on spec version)

      "Note: If the controller is able to guarantee that data present in a write cache is written to non-volatile media on loss of power, then that write cache is considered non-volatile and this feature does not apply to that write cache"

      You would likely be more in a position to raise the issue with OEMs but I believe they will claim they have power loss protection with heavy asterisks attached and that is why they ack your fcntl FLUSH while not actually flushing out of the [actually volatile] DRAM.

      I don't know why a guarantee is not actually a guarantee and why there may actually be gradations of PLP. Sounds fishy but that is one possible explanation for what you are seeing. Do you know? Anyway if you want the real PLP guarantee you have to get a drive where the documentation specifies backup capacitors and preferably oscilloscope traces. Ultrastar drives have such info, for example.