[SPDK] Question on How to Ensure Read-Write Ordering

fandahao17 at mail.ustc.edu.cn Tue, 09 Feb 2021 10:09:39 +0000
Newsgroups dev.linux.lists.spdk
Message-ID <[email protected]>
Hi, there!

I have a question regarding how read-write ordering is ensured in SPDK's Blobstore. As I understand, the Blobstore interface offers a filesystem-like interface, which I think would guarantee all writes are seen by subsequent reads, even though these reads are submitted before the write completes.

However, when I go through the code I found Blobstore seems to directly send the requests to the bdev layer, which asks the NVMe driver to issue the request to the SSD. AFAIK, the NVMe controller doesn't guarantee command ordering (NVMe spec says, "if a Read is submitted for LBA x and there is a Write also submitted for LBA x, there is no guarantee of the order of completion for those commands, the Read may finish first or the Write may finish first").

I wonder how Blobstore ensures all writes are seen by subsequent reads? If Blobstore doesn't provide such guarantee, what is the usual way to ensure the ordering?

Thanks!

Regards,
JInhao Fan
University of Science and Technology of China