All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <keith.busch@intel.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH 4/4] nvme: support ranged discard requests
Date: Tue, 7 Feb 2017 20:34:39 +0100	[thread overview]
Message-ID: <20170207193439.GA26834@lst.de> (raw)
In-Reply-To: <20170207183453.GC10133@localhost.localdomain>

On Tue, Feb 07, 2017 at 01:34:54PM -0500, Keith Busch wrote:
> On Tue, Feb 07, 2017 at 05:46:58PM +0100, Christoph Hellwig wrote:
> > @@ -1233,6 +1243,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
> >  	if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
> >  		vwc = true;
> >  	blk_queue_write_cache(q, vwc, vwc);
> > +	blk_queue_max_discard_segments(q,
> > +			PAGE_SIZE / sizeof(struct nvme_dsm_range));
> 
> We need to use ctrl->page_size rather than PAGE_SIZE.

We need the PAGE_SIZE upper bound because the "special" bvec only
allows a single page payload.  I can't find any indication that
the DSM command is limited to a single PRP, so not sure where a
ctrl->page_size would come from.  But now that I looked again there
is a hard limit of 256 entries due to NR being a 8-bit field, so
I need to cap on that at least.

WARNING: multiple messages have this Message-ID (diff)
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 4/4] nvme: support ranged discard requests
Date: Tue, 7 Feb 2017 20:34:39 +0100	[thread overview]
Message-ID: <20170207193439.GA26834@lst.de> (raw)
In-Reply-To: <20170207183453.GC10133@localhost.localdomain>

On Tue, Feb 07, 2017@01:34:54PM -0500, Keith Busch wrote:
> On Tue, Feb 07, 2017@05:46:58PM +0100, Christoph Hellwig wrote:
> > @@ -1233,6 +1243,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
> >  	if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
> >  		vwc = true;
> >  	blk_queue_write_cache(q, vwc, vwc);
> > +	blk_queue_max_discard_segments(q,
> > +			PAGE_SIZE / sizeof(struct nvme_dsm_range));
> 
> We need to use ctrl->page_size rather than PAGE_SIZE.

We need the PAGE_SIZE upper bound because the "special" bvec only
allows a single page payload.  I can't find any indication that
the DSM command is limited to a single PRP, so not sure where a
ctrl->page_size would come from.  But now that I looked again there
is a hard limit of 256 entries due to NR being a 8-bit field, so
I need to cap on that at least.

  reply	other threads:[~2017-02-07 19:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 16:46 support for multi-range discard requests Christoph Hellwig
2017-02-07 16:46 ` Christoph Hellwig
2017-02-07 16:46 ` [PATCH 1/4] block: move req_set_nomerge to blk.h Christoph Hellwig
2017-02-07 16:46   ` Christoph Hellwig
2017-02-15 10:29   ` Sagi Grimberg
2017-02-15 10:29     ` Sagi Grimberg
2017-02-07 16:46 ` [PATCH 2/4] block: enumify ELEVATOR_*_MERGE Christoph Hellwig
2017-02-07 16:46   ` Christoph Hellwig
2017-02-15 10:31   ` Sagi Grimberg
2017-02-15 10:31     ` Sagi Grimberg
2017-02-07 16:46 ` [PATCH 3/4] block: optionally merge discontiguous discard bios into a single request Christoph Hellwig
2017-02-07 16:46   ` Christoph Hellwig
2017-02-08 10:54   ` Ming Lei
2017-02-08 10:54     ` Ming Lei
2017-02-08 11:57     ` Christoph Hellwig
2017-02-08 11:57       ` Christoph Hellwig
2017-02-15 10:36   ` Sagi Grimberg
2017-02-15 10:36     ` Sagi Grimberg
2017-02-07 16:46 ` [PATCH 4/4] nvme: support ranged discard requests Christoph Hellwig
2017-02-07 16:46   ` Christoph Hellwig
2017-02-07 18:34   ` Keith Busch
2017-02-07 18:34     ` Keith Busch
2017-02-07 19:34     ` Christoph Hellwig [this message]
2017-02-07 19:34       ` Christoph Hellwig
2017-02-15 10:42       ` Sagi Grimberg
2017-02-15 10:42         ` Sagi Grimberg
2017-02-08 13:13 support for multi-range discard requests V2 Christoph Hellwig
2017-02-08 13:13 ` [PATCH 4/4] nvme: support ranged discard requests Christoph Hellwig
2017-02-08 13:13   ` Christoph Hellwig
2017-02-08 13:32   ` Andrey Kuzmin
2017-02-08 13:36     ` Christoph Hellwig
2017-02-08 13:36       ` Christoph Hellwig
2017-02-08 13:46 support for multi-range discard requests V3 Christoph Hellwig
2017-02-08 13:46 ` [PATCH 4/4] nvme: support ranged discard requests Christoph Hellwig
2017-02-08 13:46   ` Christoph Hellwig
2017-02-15 10:45   ` Sagi Grimberg
2017-02-15 10:45     ` Sagi Grimberg

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=20170207193439.GA26834@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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.