From: Christoph Hellwig <hch@lst.de>
To: Guixin Liu <kanie@linux.alibaba.com>
Cc: hch@lst.de, sagi@grimberg.me, kch@nvidia.com,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvmet: avoid unnecessary fsync and flush bio
Date: Fri, 22 Jul 2022 17:06:35 +0200 [thread overview]
Message-ID: <20220722150635.GA7327@lst.de> (raw)
In-Reply-To: <1658491944-34701-1-git-send-email-kanie@linux.alibaba.com>
On Fri, Jul 22, 2022 at 08:12:24PM +0800, Guixin Liu wrote:
> @@ -333,10 +333,16 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
> static void nvmet_bdev_execute_flush(struct nvmet_req *req)
> {
> struct bio *bio = &req->b.inline_bio;
> + struct request_queue *q = req->ns->bdev->bd_queue;
>
> if (!nvmet_check_transfer_len(req, 0))
> return;
>
> + if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags)) {
This should be using a bdev_write_cache.
But more importantly: if the backend does not have a volatile write
cache, and we should not even receive flushes from the remote side.
> + if (req->ns->buffered_io)
> + return errno_to_nvme_status(req, vfs_fsync(req->ns->file, 1));
> + else
> + return errno_to_nvme_status(req, 0);
No need for the else, and the simple success case can just use the
constant status and does not need a translation.
next prev parent reply other threads:[~2022-07-22 15:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 12:12 [PATCH] nvmet: avoid unnecessary fsync and flush bio Guixin Liu
2022-07-22 15:06 ` Christoph Hellwig [this message]
2022-07-25 2:18 ` Guixin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220722150635.GA7327@lst.de \
--to=hch@lst.de \
--cc=kanie@linux.alibaba.com \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.