nvmet: Use direct IO for writes
authorSagi Grimberg <sagi@grimberg.me>
Wed, 21 Sep 2016 18:06:32 +0000 (11:06 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Fri, 23 Sep 2016 22:37:38 +0000 (15:37 -0700)
We're designed to work with high-end devices where
direct IO makes perfect sense. We noticed that we
context switch by scheduling kblockd instead of going
directly to the device without REQ_SYNC for writes.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/io-cmd.c

index 2cd069b691ae541380f7867136044fa989a7c065..4132b6b9818233290940c62cb6b4e0d7e499e48a 100644 (file)
@@ -58,6 +58,7 @@ static void nvmet_execute_rw(struct nvmet_req *req)
 
        if (req->cmd->rw.opcode == nvme_cmd_write) {
                op = REQ_OP_WRITE;
+               op_flags = WRITE_ODIRECT;
                if (req->cmd->rw.control & cpu_to_le16(NVME_RW_FUA))
                        op_flags |= REQ_FUA;
        } else {