All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: weiping zhang <zhangweiping@didichuxing.com>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH] null_blk: add "no_sched" module parameter
Date: Fri, 29 Sep 2017 23:39:03 +0200	[thread overview]
Message-ID: <04e29850-3634-131b-5098-85842873658e@kernel.dk> (raw)
In-Reply-To: <20170929170951.GA18535@localhost.didichuxing.com>

On 09/29/2017 07:09 PM, weiping zhang wrote:
> 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, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
> index bd92286..3c63863 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");
> @@ -1753,7 +1757,7 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)
>  						g_hw_queue_depth;
>  	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;
> +	set->flags = g_no_sched ? BLK_MQ_F_NO_SCHED : BLK_MQ_F_SHOULD_MERGE;

This should be:

	set->flags = BLK_MQ_F_SHOULD_MERGE;
	if (g_no_sched)
		set->flags |= BLK_MQ_F_NO_SCHED;

-- 
Jens Axboe

  reply	other threads:[~2017-09-29 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 17:09 [PATCH] null_blk: add "no_sched" module parameter weiping zhang
2017-09-29 21:39 ` Jens Axboe [this message]
2017-09-30  1:40   ` weiping zhang

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=04e29850-3634-131b-5098-85842873658e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=zhangweiping@didichuxing.com \
    /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.