From e14f02ca0df98d07059eec1cb58d282d2423887a Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Sat, 29 Feb 2020 01:12:57 +0800 Subject: [PATCH] NVMEDevice: Remove the unnecessary aio_wait in sync read Using the aio_wait are unncessary, since all the async read submission and completion happen in the same thread. Signed-off-by: Ziye Yang --- src/os/bluestore/NVMEDevice.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index 2c3987f474f..b2611197d76 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -697,7 +697,7 @@ void io_complete(void *t, const struct spdk_nvme_cpl *completion) } else { task->return_code = 0; } - ctx->try_aio_wake(); + --ctx->num_running; } } else { ceph_assert(task->command == IOCommand::FLUSH_COMMAND); @@ -937,7 +937,6 @@ int NVMEDevice::read(uint64_t off, uint64_t len, bufferlist *pbl, make_read_tasks(this, off, ioc, buf, len, &t, off, len); dout(5) << __func__ << " " << off << "~" << len << dendl; aio_submit(ioc); - ioc->aio_wait(); pbl->push_back(std::move(p)); return t.return_code; @@ -975,7 +974,6 @@ int NVMEDevice::read_random(uint64_t off, uint64_t len, char *buf, bool buffered make_read_tasks(this, aligned_off, &ioc, buf, aligned_len, &t, off, len); aio_submit(&ioc); - ioc.aio_wait(); return t.return_code; } -- 2.39.5