Content-Type: multipart/mixed; boundary="===============8872206759705865455==" MIME-Version: 1.0 From: Harris, James R Subject: [SPDK] Re: Question on How to Ensure Read-Write Ordering Date: Tue, 09 Feb 2021 14:41:37 +0000 Message-ID: <48E0C8C2-2B65-4212-82BE-CD3D45688F91@intel.com> In-Reply-To: 20210209100939.2958.11991@ml01.vlan13.01.org List-ID: To: spdk@lists.01.org --===============8872206759705865455== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Jinhao, POSIX filesystems do not provide guarantees on reads submitted before an ov= erlapping write has completed. If you want to guarantee the new data is ret= urned, you must submit the read operation after the write has completed. The SPDK blobstore behaves similarly. If you submit a write for block X, an= d then submit a read for block X before that write has completed, your read= may return the old data or the new data. If your application has ordering = requirements, it must wait until the write is completed before submitting t= he read operation. Regards, -Jim = =EF=BB=BFOn 2/9/21, 3:10 AM, "fandahao17(a)mail.ustc.edu.cn" wrote: 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-l= ike interface, which I think would guarantee all writes are seen by subsequ= ent 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 t= he 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 comp= letion for those commands, the Read may finish first or the Write may finis= h 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 ensu= re the ordering? Thanks! Regards, JInhao Fan University of Science and Technology of China _______________________________________________ SPDK mailing list -- spdk(a)lists.01.org To unsubscribe send an email to spdk-leave(a)lists.01.org --===============8872206759705865455==--