nvme: Do not test the read-ahead flag in cmd_flags
RFC PATCH 1/1 nvme: Do not test the read-ahead flag in cmd_flags
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.
--- drivers/nvme/host/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/nvme/host/core.c +1 -4
@@ -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;
Signature · 1 line
2.10.0
Christoph Hellwig
maintainerRFC PATCH 1/1 nvme: Do not test the read-ahead flag in cmd_flags
Quoted 3 lines · Bart Van Assche
REQ_RAHEADis a bio-only flag (bio.bi_opf) and hence is never set in request.cmd_flags. Hence remove thecmd_flags&REQ_RAHEADtests. 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.
RFC PATCH 1/1 nvme: Do not test the read-ahead flag in cmd_flags
Quoted 8 lines · Christoph Hellwig
Quoted 3 lines · Bart Van Assche
REQ_RAHEADis a bio-only flag (bio.bi_opf) and hence is never set in request.cmd_flags. Hence remove thecmd_flags&REQ_RAHEADtests. Compile-tested only.It's indeed a bug, but the questions is if why we shouldn't pass
REQ_RAHEADdown 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.
Signature · 1 line
Jens Axboe
Christoph Hellwig
maintainerRFC PATCH 1/1 nvme: Do not test the read-ahead flag in cmd_flags
Quoted 5 lines · Jens Axboe
Quoted 3 lines
It's indeed a bug, but the questions is if why we shouldn't pass
REQ_RAHEADdown 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.
RFC PATCH 1/1 nvme: Do not test the read-ahead flag in cmd_flags
Quoted 8 lines · Christoph Hellwig
Quoted 5 lines · Jens Axboe
Quoted 3 lines
It's indeed a bug, but the questions is if why we shouldn't pass
REQ_RAHEADdown 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.
Quoted 5 lines
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_NOMERGEactually is used in both currently and not actually expecting propagation.
It would be nice to harden that.
Signature · 1 line
Jens Axboe