linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] blk-mq: cleaup code and update comment
@ 2019-03-24  9:57 Yufen Yu
  2019-03-24  9:57 ` [PATCH 1/2] blk-mq: use blk_mq_put_driver_tag() to put tag Yufen Yu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yufen Yu @ 2019-03-24  9:57 UTC (permalink / raw)
  To: axboe, linux-block

Hi,

This patchset replace blk_mq_put_driver_tag_hctx() by blk_mq_put_driver_tag(),
and update comment for blk_mq_hctx_has_pending().

Yufen Yu (2):
  blk-mq: use blk_mq_put_driver_tag() to put tag
  blk-mq: update comment for blk_mq_hctx_has_pending()

 block/blk-flush.c | 4 ++--
 block/blk-mq.c    | 3 ++-
 block/blk-mq.h    | 9 ---------
 3 files changed, 4 insertions(+), 12 deletions(-)

-- 
2.16.2.dirty


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

* [PATCH 1/2] blk-mq: use blk_mq_put_driver_tag() to put tag
  2019-03-24  9:57 [PATCH 0/2] blk-mq: cleaup code and update comment Yufen Yu
@ 2019-03-24  9:57 ` Yufen Yu
  2019-03-24  9:57 ` [PATCH 2/2] blk-mq: update comment for blk_mq_hctx_has_pending() Yufen Yu
  2019-03-24 16:25 ` [PATCH 0/2] blk-mq: cleaup code and update comment Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Yufen Yu @ 2019-03-24  9:57 UTC (permalink / raw)
  To: axboe, linux-block

Expect arguments, blk_mq_put_driver_tag_hctx() and blk_mq_put_driver_tag()
is same. We can just use argument 'request' to put tag by blk_mq_put_driver_tag().
Then we can remove the unused blk_mq_put_driver_tag_hctx().

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 block/blk-flush.c | 4 ++--
 block/blk-mq.h    | 9 ---------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/block/blk-flush.c b/block/blk-flush.c
index 6e0f2d97fc6d..d95f94892015 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -220,7 +220,7 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)
 		blk_mq_tag_set_rq(hctx, flush_rq->tag, fq->orig_rq);
 		flush_rq->tag = -1;
 	} else {
-		blk_mq_put_driver_tag_hctx(hctx, flush_rq);
+		blk_mq_put_driver_tag(flush_rq);
 		flush_rq->internal_tag = -1;
 	}
 
@@ -324,7 +324,7 @@ static void mq_flush_data_end_io(struct request *rq, blk_status_t error)
 
 	if (q->elevator) {
 		WARN_ON(rq->tag < 0);
-		blk_mq_put_driver_tag_hctx(hctx, rq);
+		blk_mq_put_driver_tag(rq);
 	}
 
 	/*
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 0ed8e5a8729f..d704fc7766f4 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -224,15 +224,6 @@ static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
 	}
 }
 
-static inline void blk_mq_put_driver_tag_hctx(struct blk_mq_hw_ctx *hctx,
-				       struct request *rq)
-{
-	if (rq->tag == -1 || rq->internal_tag == -1)
-		return;
-
-	__blk_mq_put_driver_tag(hctx, rq);
-}
-
 static inline void blk_mq_put_driver_tag(struct request *rq)
 {
 	if (rq->tag == -1 || rq->internal_tag == -1)
-- 
2.16.2.dirty


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

* [PATCH 2/2] blk-mq: update comment for blk_mq_hctx_has_pending()
  2019-03-24  9:57 [PATCH 0/2] blk-mq: cleaup code and update comment Yufen Yu
  2019-03-24  9:57 ` [PATCH 1/2] blk-mq: use blk_mq_put_driver_tag() to put tag Yufen Yu
@ 2019-03-24  9:57 ` Yufen Yu
  2019-03-24 16:25 ` [PATCH 0/2] blk-mq: cleaup code and update comment Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Yufen Yu @ 2019-03-24  9:57 UTC (permalink / raw)
  To: axboe, linux-block

For now, blk_mq_hctx_has_pending() checks any of ctx, hctx->dispatch
or io scheduler have pending work. So, update the comment accordingly.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 block/blk-mq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 2ad06150ebff..e3f2c85f048c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -59,7 +59,8 @@ static int blk_mq_poll_stats_bkt(const struct request *rq)
 }
 
 /*
- * Check if any of the ctx's have pending work in this hardware queue
+ * Check if any of the ctx, dispatch list or elevator
+ * have pending work in this hardware queue.
  */
 static bool blk_mq_hctx_has_pending(struct blk_mq_hw_ctx *hctx)
 {
-- 
2.16.2.dirty


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

* Re: [PATCH 0/2] blk-mq: cleaup code and update comment
  2019-03-24  9:57 [PATCH 0/2] blk-mq: cleaup code and update comment Yufen Yu
  2019-03-24  9:57 ` [PATCH 1/2] blk-mq: use blk_mq_put_driver_tag() to put tag Yufen Yu
  2019-03-24  9:57 ` [PATCH 2/2] blk-mq: update comment for blk_mq_hctx_has_pending() Yufen Yu
@ 2019-03-24 16:25 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2019-03-24 16:25 UTC (permalink / raw)
  To: Yufen Yu, linux-block

On 3/24/19 3:57 AM, Yufen Yu wrote:
> Hi,
> 
> This patchset replace blk_mq_put_driver_tag_hctx() by blk_mq_put_driver_tag(),
> and update comment for blk_mq_hctx_has_pending().

Both look good to me, and it's nice to get rid of the _hctx() tag put variant.

-- 
Jens Axboe


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

end of thread, other threads:[~2019-03-24 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-24  9:57 [PATCH 0/2] blk-mq: cleaup code and update comment Yufen Yu
2019-03-24  9:57 ` [PATCH 1/2] blk-mq: use blk_mq_put_driver_tag() to put tag Yufen Yu
2019-03-24  9:57 ` [PATCH 2/2] blk-mq: update comment for blk_mq_hctx_has_pending() Yufen Yu
2019-03-24 16:25 ` [PATCH 0/2] blk-mq: cleaup code and update comment Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).