Linux block layer
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Chaitanya Kulkarni <kch@nvidia.com>, linux-block@vger.kernel.org
Cc: axboe@kernel.dk, damien.lemoal@opensource.wdc.com,
	johannes.thumshirn@wdc.com, ming.lei@redhat.com,
	bvanassche@acm.org, shinichiro.kawasaki@wdc.com,
	vincent.fu@samsung.com
Subject: Re: [PATCH V2 1/1] null_blk: add moddule parameter check
Date: Mon, 10 Apr 2023 14:58:02 +0900	[thread overview]
Message-ID: <5ac02fed-1669-9b3c-a1f6-07b08290bbee@kernel.org> (raw)
In-Reply-To: <20230410051352.36856-2-kch@nvidia.com>

On 4/10/23 14:13, Chaitanya Kulkarni wrote:
>  static bool g_virt_boundary = false;
>  module_param_named(virt_boundary, g_virt_boundary, bool, 0444);
>  MODULE_PARM_DESC(virt_boundary, "Require a virtual boundary for the device. Default: False");
> @@ -86,11 +113,13 @@ module_param_named(no_sched, g_no_sched, int, 0444);
>  MODULE_PARM_DESC(no_sched, "No io scheduler");
>  
>  static int g_submit_queues = 1;
> -module_param_named(submit_queues, g_submit_queues, int, 0444);
> +NULL_PARAM(submit_queues, 1, INT_MAX);

INT_MAX ? That is a little large... Why not using CONFIG_NR_CPUS ? Or
CONFIG_NR_CPUS * 2 to leave some room for experiments.

> +device_param_cb(submit_queues, &null_submit_queues_param_ops, &g_submit_queues, 0444);
>  MODULE_PARM_DESC(submit_queues, "Number of submission queues");

[...]

>  static int g_bs = 512;
> -module_param_named(bs, g_bs, int, 0444);
> +NULL_PARAM(bs, 1, PAGE_SIZE);

Allowing min=1 here does not make sense. This should be 512. And you could add a
"bool is_power_of_2" argument to null_param_store_int() to check that the value
is a power of 2.

> +device_param_cb(bs, &null_bs_param_ops, &g_bs, 0444);
>  MODULE_PARM_DESC(bs, "Block size (in bytes)");

[...]

>  static int g_hw_queue_depth = 64;
> -module_param_named(hw_queue_depth, g_hw_queue_depth, int, 0444);
> +NULL_PARAM(hw_qdepth, 1, INT_MAX);

INT_MAX here is a little silly. Way too large to make any sense in my opinion.
NVMe allows up to 65536, why not use the same value here ?

> +device_param_cb(hw_queue_depth, &null_hw_qdepth_param_ops, &g_hw_queue_depth, 0444);
>  MODULE_PARM_DESC(hw_queue_depth, "Queue depth for each hardware queue. Default: 64");
>  
>  static bool g_use_per_node_hctx;


  reply	other threads:[~2023-04-10  5:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10  5:13 [PATCH V2 0/1 null_blk: add modparam checks Chaitanya Kulkarni
2023-04-10  5:13 ` [PATCH V2 1/1] null_blk: add moddule parameter check Chaitanya Kulkarni
2023-04-10  5:58   ` Damien Le Moal [this message]
2023-04-10 17:47   ` Nitesh Shetty
2023-04-11  5:29     ` Damien Le Moal
2023-04-11  6:40       ` Chaitanya Kulkarni
2023-04-11  7:02         ` Damien Le Moal

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=5ac02fed-1669-9b3c-a1f6-07b08290bbee@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=vincent.fu@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox