All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@wdc.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <bart.vanassche@wdc.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jianchao Wang <jianchao.w.wang@oracle.com>,
	Ming Lei <ming.lei@redhat.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH v4 03/10] block, ide: Remove flag BLK_MQ_REQ_PREEMPT
Date: Fri,  3 Aug 2018 17:03:18 -0700	[thread overview]
Message-ID: <20180804000325.3610-4-bart.vanassche@wdc.com> (raw)
In-Reply-To: <20180804000325.3610-1-bart.vanassche@wdc.com>

Since it is no longer necessary that blk_get_request() knowns whether
or not RQF_PREEMPT will be set, remove flag BLK_MQ_REQ_PREEMPT. This
patch does not change any functionality. See also 039c635f4e66 ("ide,
scsi: Tell the block layer at request allocation time about preempt
requests").

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jianchao Wang <jianchao.w.wang@oracle.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-core.c       | 9 +++------
 block/blk-mq.c         | 2 --
 drivers/ide/ide-pm.c   | 3 ++-
 include/linux/blk-mq.h | 4 +---
 4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 3378fe478e67..3a5aa56eab9d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -908,7 +908,7 @@ EXPORT_SYMBOL(blk_alloc_queue);
 /**
  * blk_queue_enter() - try to increase q->q_usage_counter
  * @q: request queue pointer
- * @flags: BLK_MQ_REQ_NOWAIT, BLK_MQ_REQ_PREEMPT and/or BLK_MQ_REQ_PM
+ * @flags: BLK_MQ_REQ_NOWAIT and/or BLK_MQ_REQ_PM
  */
 int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
 {
@@ -1431,8 +1431,6 @@ static struct request *__get_request(struct request_list *rl, unsigned int op,
 	blk_rq_set_rl(rq, rl);
 	rq->cmd_flags = op;
 	rq->rq_flags = rq_flags;
-	if (flags & BLK_MQ_REQ_PREEMPT)
-		rq->rq_flags |= RQF_PREEMPT;
 
 	/* init elvpriv */
 	if (rq_flags & RQF_ELVPRIV) {
@@ -1570,7 +1568,7 @@ static struct request *get_request(struct request_queue *q, unsigned int op,
 	goto retry;
 }
 
-/* flags: BLK_MQ_REQ_PREEMPT, BLK_MQ_REQ_PM and/or BLK_MQ_REQ_NOWAIT. */
+/* flags: BLK_MQ_REQ_PM and/or BLK_MQ_REQ_NOWAIT. */
 static struct request *blk_old_get_request(struct request_queue *q,
 				unsigned int op, blk_mq_req_flags_t flags)
 {
@@ -1613,8 +1611,7 @@ struct request *blk_get_request(struct request_queue *q, unsigned int op,
 	struct request *req;
 
 	WARN_ON_ONCE(op & REQ_NOWAIT);
-	WARN_ON_ONCE(flags & ~(BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_PREEMPT |
-			       BLK_MQ_REQ_PM));
+	WARN_ON_ONCE(flags & ~(BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_PM));
 
 	if (q->mq_ops) {
 		req = blk_mq_alloc_request(q, op, flags);
diff --git a/block/blk-mq.c b/block/blk-mq.c
index c92ce06fd565..8b23ae34d949 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -300,8 +300,6 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
 	rq->rq_flags = rq_flags;
 	rq->cpu = -1;
 	rq->cmd_flags = op;
-	if (data->flags & BLK_MQ_REQ_PREEMPT)
-		rq->rq_flags |= RQF_PREEMPT;
 	if (blk_queue_io_stat(data->q))
 		rq->rq_flags |= RQF_IO_STAT;
 	INIT_LIST_HEAD(&rq->queuelist);
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index 59217aa1d1fb..10d10e01c0f4 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -90,8 +90,9 @@ int generic_ide_resume(struct device *dev)
 	}
 
 	memset(&rqpm, 0, sizeof(rqpm));
-	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PREEMPT);
+	rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
 	ide_req(rq)->type = ATA_PRIV_PM_RESUME;
+	rq->rq_flags |= RQF_PREEMPT;
 	rq->special = &rqpm;
 	rqpm.pm_step = IDE_PM_START_RESUME;
 	rqpm.pm_state = PM_EVENT_ON;
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index f15c1de51f5e..59f99b0019bb 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -221,10 +221,8 @@ enum {
 	BLK_MQ_REQ_RESERVED	= (__force blk_mq_req_flags_t)(1 << 1),
 	/* allocate internal/sched tag */
 	BLK_MQ_REQ_INTERNAL	= (__force blk_mq_req_flags_t)(1 << 2),
-	/* set RQF_PREEMPT */
-	BLK_MQ_REQ_PREEMPT	= (__force blk_mq_req_flags_t)(1 << 3),
 	/* for power management requests */
-	BLK_MQ_REQ_PM		= (__force blk_mq_req_flags_t)(1 << 4),
+	BLK_MQ_REQ_PM		= (__force blk_mq_req_flags_t)(1 << 3),
 };
 
 struct request *blk_mq_alloc_request(struct request_queue *q, unsigned int op,
-- 
2.18.0

  parent reply	other threads:[~2018-08-04  0:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04  0:03 [PATCH v4 00/10] blk-mq: Enable runtime power management Bart Van Assche
2018-08-04  0:03 ` [PATCH v4 01/10] block: Change the preempt-only flag into a counter Bart Van Assche
2018-08-06  6:25   ` Hannes Reinecke
2018-09-14 12:53   ` Christoph Hellwig
2018-08-04  0:03 ` [PATCH v4 02/10] block, scsi: Give RQF_PREEMPT back its original meaning Bart Van Assche
2018-08-04  1:16   ` Ming Lei
2018-08-06 14:15     ` Bart Van Assche
2018-08-06  6:27   ` Hannes Reinecke
2018-08-06 13:54     ` Bart Van Assche
2018-09-14 12:58       ` hch
2018-08-04  0:03 ` Bart Van Assche [this message]
2018-08-04  0:03 ` [PATCH v4 04/10] block: Move power management code into a new source file Bart Van Assche
2018-09-14 13:01   ` Christoph Hellwig
2018-09-14 14:10     ` Alan Stern
2018-08-04  0:03 ` [PATCH v4 05/10] block: Serialize queue freezing and blk_pre_runtime_suspend() Bart Van Assche
2018-08-04 10:23   ` Ming Lei
2018-08-06 14:19     ` Bart Van Assche
2018-08-04  0:03 ` [PATCH v4 06/10] percpu-refcount: Introduce percpu_ref_read() Bart Van Assche
2018-08-04  0:03 ` [PATCH v4 07/10] block, scsi: Rework runtime power management Bart Van Assche
2018-08-04 10:01   ` Ming Lei
2018-08-06 15:20     ` Bart Van Assche
2018-08-06 22:30       ` Ming Lei
2018-08-06  2:46   ` jianchao.wang
2018-08-06 15:07     ` Bart Van Assche
2018-08-04  0:03 ` [PATCH v4 08/10] block: Remove blk_pm_requeue_request() Bart Van Assche
2018-08-04  0:03 ` [PATCH v4 09/10] blk-mq: Insert blk_pm_{add,put}_request() calls Bart Van Assche
2018-08-04  0:03 ` [PATCH v4 10/10] blk-mq: Enable support for runtime power management Bart Van Assche

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=20180804000325.3610-4-bart.vanassche@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=hch@lst.de \
    --cc=jianchao.w.wang@oracle.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=stern@rowland.harvard.edu \
    /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.