* [PATCH v2] null_blk: add "no_sched" module parameter
@ 2017-09-30 1:49 weiping zhang
2017-09-30 8:22 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: weiping zhang @ 2017-09-30 1:49 UTC (permalink / raw)
To: axboe; +Cc: linux-block
add an option that disable io scheduler for null block device.
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
---
drivers/block/null_blk.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index bd92286..38f4a8c 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -154,6 +154,10 @@ enum {
NULL_Q_MQ = 2,
};
+static int g_no_sched;
+module_param_named(no_sched, g_no_sched, int, S_IRUGO);
+MODULE_PARM_DESC(no_sched, "No io scheduler");
+
static int g_submit_queues = 1;
module_param_named(submit_queues, g_submit_queues, int, S_IRUGO);
MODULE_PARM_DESC(submit_queues, "Number of submission queues");
@@ -1754,6 +1758,8 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)
set->numa_node = nullb ? nullb->dev->home_node : g_home_node;
set->cmd_size = sizeof(struct nullb_cmd);
set->flags = BLK_MQ_F_SHOULD_MERGE;
+ if (g_no_sched)
+ set->flags |= BLK_MQ_F_NO_SCHED;
set->driver_data = NULL;
if ((nullb && nullb->dev->blocking) || g_blocking)
--
2.9.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] null_blk: add "no_sched" module parameter
2017-09-30 1:49 [PATCH v2] null_blk: add "no_sched" module parameter weiping zhang
@ 2017-09-30 8:22 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-09-30 8:22 UTC (permalink / raw)
To: linux-block
On 09/30/2017 03:49 AM, weiping zhang wrote:
> add an option that disable io scheduler for null block device.
Applied for 4.15, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-30 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30 1:49 [PATCH v2] null_blk: add "no_sched" module parameter weiping zhang
2017-09-30 8:22 ` Jens Axboe
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.