Skip to contentSkip to conversation

blk-mq: trivial helper and fixes comments

PATCH Applied Minwoo Im 3 participants 8 messages Dec 4, 2020 – Dec 12, 2020 Block layer

lore
Share & tools
lore

Minwoo Im

author
#0 lore raw

cover blk-mq: trivial helper and fixes comments

Hello,

This patch set contains:
- Introduce a helper to allocate tagset tags for the first time without 'realloc' keyword that used to be taken.
- Fixes for comments need to be updated.

Please have a look.

Thanks,

Minwoo Im (3):
blk-mq: add helper allocating tagset->tags
blk-mq: update arg in comment of blk_mq_map_queue
blk-mq: fix msec comment from micro to milli seconds

 block/blk-mq.c | 14 ++++++++++----
 block/blk-mq.h |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/3 blk-mq: add helper allocating tagset->tags

tagset->set is allocated from blk_mq_alloc_tag_set() rather than being reallocated. This patch added a helper to make its meaning explicitly which is to allocate rather than to reallocate.

---
 block/blk-mq.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
block/blk-mq.c +7 -1
index 37c682855a63..69771ba18f1f 100644
@@ -3377,6 +3377,12 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
 	return 0;
 }
 
+static int blk_mq_alloc_tag_set_tags(struct blk_mq_tag_set *set,
+				int new_nr_hw_queues)
+{
+	return blk_mq_realloc_tag_set_tags(set, 0, new_nr_hw_queues);
+}
+
 /*
  * Alloc a tag set to be associated with one or more request queues.
  * May fail with EINVAL for various error conditions. May adjust the
@@ -3430,7 +3436,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
 	if (set->nr_maps == 1 && set->nr_hw_queues > nr_cpu_ids)
 		set->nr_hw_queues = nr_cpu_ids;
 
-	if (blk_mq_realloc_tag_set_tags(set, 0, set->nr_hw_queues) < 0)
+	if (blk_mq_alloc_tag_set_tags(set, set->nr_hw_queues) < 0)
 		return -ENOMEM;
 
 	ret = -ENOMEM;
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/3 blk-mq: update arg in comment of blk_mq_map_queue

In reply to Minwoo Im

Update mis-named argument description of blk_mq_map_queue(). This patch also updates description that argument to software queue percpu context.

---
 block/blk-mq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.h +1 -1
index c696515766c7..c1458d9502f1 100644
@@ -99,7 +99,7 @@ static inline struct blk_mq_hw_ctx *blk_mq_map_queue_type(struct request_queue *
  * blk_mq_map_queue() - map (cmd_flags,type) to hardware queue
  * @q: request queue
  * @flags: request command flags
- * @cpu: cpu ctx
+ * @ctx: software queue cpu ctx
  */
 static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q,
 						     unsigned int flags,
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH 3/3 blk-mq: fix msec comment from micro to milli seconds

In reply to Minwoo Im

Delay to wait for queue running is milli second unit which is passed to delayed work via msecs_to_jiffies() which is to convert milliseconds to jiffies.

---
 block/blk-mq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
block/blk-mq.c +3 -3
index 69771ba18f1f..284d103bd0e7 100644
@@ -1594,7 +1594,7 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
  * __blk_mq_delay_run_hw_queue - Run (or schedule to run) a hardware queue.
  * @hctx: Pointer to the hardware queue to run.
  * @async: If we want to run the queue asynchronously.
- * @msecs: Microseconds of delay to wait before running the queue.
+ * @msecs: Milliseconds of delay to wait before running the queue.
  *
  * If !@async, try to run the queue now. Else, run the queue asynchronously and
  * with a delay of @msecs.
@@ -1623,7 +1623,7 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async,
 /**
  * blk_mq_delay_run_hw_queue - Run a hardware queue asynchronously.
  * @hctx: Pointer to the hardware queue to run.
- * @msecs: Microseconds of delay to wait before running the queue.
+ * @msecs: Milliseconds of delay to wait before running the queue.
  *
  * Run a hardware queue asynchronously with a delay of @msecs.
  */
@@ -1687,7 +1687,7 @@ EXPORT_SYMBOL(blk_mq_run_hw_queues);
 /**
  * blk_mq_delay_run_hw_queues - Run all hardware queues asynchronously.
  * @q: Pointer to the request queue to run.
- * @msecs: Microseconds of delay to wait before running the queues.
+ * @msecs: Milliseconds of delay to wait before running the queues.
  */
 void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs)
 {
Signature · 1 line
2.17.1
author
#6 lore raw
In reply to Minwoo Im
Quoted 12 lines · Minwoo Im

Hello,

This patch set contains:
- Introduce a helper to allocate tagset tags for the first time without 'realloc' keyword that used to be taken.
- Fixes for comments need to be updated.

Please have a look.

Thanks,

Quoted 12 lines

Minwoo Im (3):
blk-mq: add helper allocating tagset->tags
blk-mq: update arg in comment of blk_mq_map_queue
blk-mq: fix msec comment from micro to milli seconds

 block/blk-mq.c | 14 ++++++++++----
 block/blk-mq.h |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1

Hello,

Gentle ping.

Thanks!

maintainer Applied
#7 lore raw
In reply to Minwoo Im
Quoted 8 lines · Minwoo Im

Hello,

This patch set contains:
- Introduce a helper to allocate tagset tags for the first time without 'realloc' keyword that used to be taken.
- Fixes for comments need to be updated.

Please have a look.

Applied, thanks.

Signature · 1 line
Jens Axboe