summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Bjørling <mb@silverwolf.dk>2012-08-08 14:31:27 -0600
committerJens Axboe <axboe@kernel.dk>2012-10-04 11:04:36 +0200
commit9b086309f89a18b088a9df1eb8026bee43a1ddef (patch)
treedd13e26eae8417ee51de63dab106594630744c2d
parent46b7651c3441cc012d2b1dcfa2a7217203bb5782 (diff)
null: add queue depth configuration parameter
To allow the user to set the queue depth for each hardware queue, we expose a queue depth parameter for the user to pass at module init. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/null.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/null.c b/drivers/block/null.c
index e9ca5924a454..575cee86a8f4 100644
--- a/drivers/block/null.c
+++ b/drivers/block/null.c
@@ -69,6 +69,10 @@ static int completion_nsec = 10000;
module_param(completion_nsec, int, S_IRUGO);
MODULE_PARM_DESC(completion_nsec, "Time in ns to complete a request in hardware. Default: 10,000ns");
+static int hw_queue_depth = 64;
+module_param(hw_queue_depth, int, S_IRUGO);
+MODULE_PARM_DESC(hw_queue_depth, "Queue depth for each hardware queue. Default: 64");
+
static void null_complete_request(struct blk_mq_hw_ctx *hctx,
struct request *rq)
{
@@ -238,6 +242,7 @@ static int null_add_dev(void)
if (use_mq) {
null_mq_reg.numa_node = home_node;
null_mq_reg.nr_hw_queues = submit_queues;
+ null_mq_reg.queue_depth = hw_queue_depth;
nullb->q = blk_mq_init_queue(&null_mq_reg, &nullb->lock);
} else {
nullb->q = blk_init_queue_node(null_request_fn, &nullb->lock, home_node);