public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Ming Lei <ming.lei@redhat.com>, Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] nvme: fix handling single range discard request
Date: Wed, 8 Mar 2023 05:42:30 +0000	[thread overview]
Message-ID: <136e275b-6cb5-5202-cd29-8c5d40fdfc0f@nvidia.com> (raw)
In-Reply-To: <ZAdJIXT4AxuYB3Do@ovpn-8-16.pek2.redhat.com>


>>>> Was referring to this:
>>>> --
>>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>>> index 3345f866178e..dbc402587431 100644
>>>> --- a/drivers/nvme/host/core.c
>>>> +++ b/drivers/nvme/host/core.c
>>>> @@ -781,6 +781,7 @@ static blk_status_t nvme_setup_discard(struct nvme_ns
>>>> *ns, struct request *req,
>>>>                   range = page_address(ns->ctrl->discard_page);
>>>>           }
>>>>
>>>> +       segments = min(segments, queue_max_discard_segments(req->q));
>>>
>>> That can't work.
>>>
>>> In case of queue_max_discard_segments(req->q) == 1, the request still
>>> can have more than one bios since the normal merge is taken for discard
>>> IOs.
>>
>> Ah, I see, the bios are contiguous though right?
> 
> Yes, the merge is just like normal RW.
> 
>> We could add a contiguity check in the loop and conditionally
>> increment n, but maybe that would probably be more complicated...
> 
> That is more complicated than this patch, and the same pattern
> has been applied on virtio-blk.
>

I'd very much keep the pattern in virio-blk in nvme that is easier
to read and simple than conditional increment of the n, unless there
is a strong reason for not doing that, which I failed to
understand ...

-ck



  reply	other threads:[~2023-03-08  5:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 23:13 [PATCH] nvme: fix handling single range discard request Ming Lei
2023-03-04  8:00 ` Hannes Reinecke
2023-03-04 10:22   ` Ming Lei
2023-03-04 11:14     ` Hannes Reinecke
2023-03-04 12:02       ` Ming Lei
2023-03-06 14:21 ` Sagi Grimberg
2023-03-06 21:49   ` Ming Lei
2023-03-07 11:39     ` Sagi Grimberg
2023-03-07 12:14       ` Ming Lei
2023-03-07 12:31         ` Sagi Grimberg
2023-03-07 14:24           ` Ming Lei
2023-03-08  5:42             ` Chaitanya Kulkarni [this message]
2023-03-08  5:36           ` Chaitanya Kulkarni
2023-03-08  5:38 ` Chaitanya Kulkarni
2023-03-09  9:41 ` Christoph Hellwig

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=136e275b-6cb5-5202-cd29-8c5d40fdfc0f@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=ming.lei@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox