All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Subject: [PATCH 2/2] blk-mq: remove RQF_ELVPRIV
Date: Tue, 19 Oct 2021 15:39:44 +0200	[thread overview]
Message-ID: <20211019133944.2500822-3-hch@lst.de> (raw)
In-Reply-To: <20211019133944.2500822-1-hch@lst.de>

RQF_ELVPRIV is set for all non-flush requests that have an I/O scheduler
with a prepare_request method, and it is checked in a single place where
we already know that the request was initialized and has an I/O
scheduler.  Given that there is no I/O scheduler that has a
requeue_request method but not prepare_request method there is no need
for this extra flag.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq-debugfs.c | 1 -
 block/blk-mq-sched.h   | 5 ++---
 block/blk-mq.c         | 1 -
 include/linux/blk-mq.h | 2 --
 4 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index a317f05de466a..efd48992bda09 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -300,7 +300,6 @@ static const char *const rqf_name[] = {
 	RQF_NAME(DONTPREP),
 	RQF_NAME(FAILED),
 	RQF_NAME(QUIET),
-	RQF_NAME(ELVPRIV),
 	RQF_NAME(IO_STAT),
 	RQF_NAME(PM),
 	RQF_NAME(HASHED),
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
index 98836106b25fc..6de63222c16d1 100644
--- a/block/blk-mq-sched.h
+++ b/block/blk-mq-sched.h
@@ -78,10 +78,9 @@ static inline void blk_mq_sched_completed_request(struct request *rq, u64 now)
 static inline void blk_mq_sched_requeue_request(struct request *rq)
 {
 	if (rq->rq_flags & RQF_ELV) {
-		struct request_queue *q = rq->q;
-		struct elevator_queue *e = q->elevator;
+		struct elevator_queue *e = rq->q->elevator;
 
-		if ((rq->rq_flags & RQF_ELVPRIV) && e->type->ops.requeue_request)
+		if (!op_is_flush(rq->cmd_flags) && e->type->ops.requeue_request)
 			e->type->ops.requeue_request(rq);
 	}
 }
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 34392c439d2a8..d2dad19d5b85c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -369,7 +369,6 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
 				blk_mq_sched_assign_ioc(rq);
 
 			e->type->ops.prepare_request(rq);
-			rq->rq_flags |= RQF_ELVPRIV;
 		}
 	}
 
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 649be3f21d740..ad810e1be8f29 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -37,8 +37,6 @@ typedef __u32 __bitwise req_flags_t;
 /* don't warn about errors */
 #define RQF_QUIET		((__force req_flags_t)(1 << 11))
 /* elevator private data attached */
-#define RQF_ELVPRIV		((__force req_flags_t)(1 << 12))
-/* account into disk and partition IO statistics */
 #define RQF_IO_STAT		((__force req_flags_t)(1 << 13))
 /* runtime pm request */
 #define RQF_PM			((__force req_flags_t)(1 << 15))
-- 
2.30.2


      parent reply	other threads:[~2021-10-19 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 13:39 remove RQF_ELVPRIV Christoph Hellwig
2021-10-19 13:39 ` [PATCH 1/2] blk-mq: remove the RQF_ELVPRIV check in blk_mq_free_request Christoph Hellwig
2021-10-19 13:43   ` Jens Axboe
2021-10-19 13:44     ` Christoph Hellwig
2021-10-19 13:46       ` Jens Axboe
2021-10-19 13:39 ` Christoph Hellwig [this message]

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=20211019133944.2500822-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.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.