All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags
@ 2016-09-14 10:02 Bart Van Assche
  2016-09-14 14:23 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2016-09-14 10:02 UTC (permalink / raw)


REQ_RAHEAD is a bio-only flag (bio.bi_opf) and hence is never set in
request.cmd_flags. Hence remove the cmd_flags & REQ_RAHEAD tests.
Compile-tested only.

Signed-off-by: Bart Van Assche <bart.vanassche at sandisk.com>
Cc: Jens Axboe <axboe at fb.com>
Cc: Christoph Hellwig <hch at lst.de>
Cc: Ming Lin <ming.l at ssi.samsung.com>
---
 drivers/nvme/host/core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 2feacc7..c920b5f 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -285,12 +285,9 @@ static inline void nvme_setup_rw(struct nvme_ns *ns, struct request *req,
 
 	if (req->cmd_flags & REQ_FUA)
 		control |= NVME_RW_FUA;
-	if (req->cmd_flags & (REQ_FAILFAST_DEV | REQ_RAHEAD))
+	if (req->cmd_flags & REQ_FAILFAST_DEV)
 		control |= NVME_RW_LR;
 
-	if (req->cmd_flags & REQ_RAHEAD)
-		dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH;
-
 	memset(cmnd, 0, sizeof(*cmnd));
 	cmnd->rw.opcode = (rq_data_dir(req) ? nvme_cmd_write : nvme_cmd_read);
 	cmnd->rw.command_id = req->tag;
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags
  2016-09-14 10:02 [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags Bart Van Assche
@ 2016-09-14 14:23 ` Christoph Hellwig
  2016-09-14 14:43   ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2016-09-14 14:23 UTC (permalink / raw)


On Wed, Sep 14, 2016@12:02:22PM +0200, Bart Van Assche wrote:
> REQ_RAHEAD is a bio-only flag (bio.bi_opf) and hence is never set in
> request.cmd_flags. Hence remove the cmd_flags & REQ_RAHEAD tests.
> Compile-tested only.

It's indeed a bug, but the questions is if why we shouldn't pass
REQ_RAHEAD down to the request layer.  It's a useful attribute,
and NVMe devices could make use of it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags
  2016-09-14 14:23 ` Christoph Hellwig
@ 2016-09-14 14:43   ` Jens Axboe
  2016-09-14 14:47     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2016-09-14 14:43 UTC (permalink / raw)


On 09/14/2016 08:23 AM, Christoph Hellwig wrote:
> On Wed, Sep 14, 2016@12:02:22PM +0200, Bart Van Assche wrote:
>> REQ_RAHEAD is a bio-only flag (bio.bi_opf) and hence is never set in
>> request.cmd_flags. Hence remove the cmd_flags & REQ_RAHEAD tests.
>> Compile-tested only.
>
> It's indeed a bug, but the questions is if why we shouldn't pass
> REQ_RAHEAD down to the request layer.  It's a useful attribute,
> and NVMe devices could make use of it.

Indeed, seems a shame to lose this hint.


-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags
  2016-09-14 14:43   ` Jens Axboe
@ 2016-09-14 14:47     ` Christoph Hellwig
  2016-09-14 14:54       ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2016-09-14 14:47 UTC (permalink / raw)


On Wed, Sep 14, 2016@08:43:48AM -0600, Jens Axboe wrote:
>> It's indeed a bug, but the questions is if why we shouldn't pass
>> REQ_RAHEAD down to the request layer.  It's a useful attribute,
>> and NVMe devices could make use of it.
>
> Indeed, seems a shame to lose this hint.

It currently doesn't work.  But it would be useful to actually pass
it through.  That being said we currently have a complete mess with
the common vs request only flags, both about their placement in the
enum and inclusion in the common mask.  Making it worse it seems
like REQ_NOMERGE actually is used in both currently and not actually
expecting propagation.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags
  2016-09-14 14:47     ` Christoph Hellwig
@ 2016-09-14 14:54       ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2016-09-14 14:54 UTC (permalink / raw)


On 09/14/2016 08:47 AM, Christoph Hellwig wrote:
> On Wed, Sep 14, 2016@08:43:48AM -0600, Jens Axboe wrote:
>>> It's indeed a bug, but the questions is if why we shouldn't pass
>>> REQ_RAHEAD down to the request layer.  It's a useful attribute,
>>> and NVMe devices could make use of it.
>>
>> Indeed, seems a shame to lose this hint.
>
> It currently doesn't work.  But it would be useful to actually pass

Right, hence we lose it when mapping from a bio to a request.

> it through.  That being said we currently have a complete mess with
> the common vs request only flags, both about their placement in the
> enum and inclusion in the common mask.  Making it worse it seems
> like REQ_NOMERGE actually is used in both currently and not actually
> expecting propagation.

It would be nice to harden that.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-14 14:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 10:02 [PATCH, RFC] nvme: Do not test the read-ahead flag in cmd_flags Bart Van Assche
2016-09-14 14:23 ` Christoph Hellwig
2016-09-14 14:43   ` Jens Axboe
2016-09-14 14:47     ` Christoph Hellwig
2016-09-14 14:54       ` Jens Axboe

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.