[SPDK] Why does the flush operation in bdev_nvme do nothing?
fandahao17 at mail.ustc.edu.cn
| Newsgroups | dev.linux.lists.spdk |
|---|---|
| Message-ID | <[email protected]> |
Hi, there! I ran into the following code in module/bdev/nvme/bdev_nvme.c when I wanted to force a flush into my SSD to make sure all my previous writes are durable.
static int
bdev_nvme_flush(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair,
struct nvme_bdev_io *bio, uint64_t offset, uint64_t nbytes)
{
spdk_bdev_io_complete(spdk_bdev_io_from_ctx(bio), SPDK_BDEV_IO_STATUS_SUCCESS);
return 0;
}
Seems that it just completes without issuing any nvme FLUSH commands. This interests me because I thought it would call something like spdk_nvme_ns_cmd_flush(). I am curious how can I make sure the data is written into the non-volatile media of the SSD? Can I still guarantee the write-read order without using a FLUSH operation in between? Thanks!