2019-09-11 17:46:34 +03:00
.. SPDX-License-Identifier: GPL-2.0
2019-04-19 01:45:00 +03:00
========================
2013-12-18 16:41:42 +04:00
Null block device driver
2019-04-19 01:45:00 +03:00
========================
2013-12-18 16:41:42 +04:00
2019-09-11 17:46:34 +03:00
Overview
========
2013-12-18 16:41:42 +04:00
2019-09-11 17:46:34 +03:00
The null block device (`` /dev/nullb* `` ) is used for benchmarking the various
2013-12-18 16:41:42 +04:00
block-layer implementations. It emulates a block device of X gigabytes in size.
2019-09-11 17:46:34 +03:00
It does not execute any read/write operation, just mark them as complete in
the request queue. The following instances are possible:
2019-04-19 01:45:00 +03:00
2013-12-18 16:41:42 +04:00
Multi-queue block-layer
2019-04-19 01:45:00 +03:00
2013-12-18 16:41:42 +04:00
- Request-based.
- Configurable submission queues per device.
2019-04-19 01:45:00 +03:00
2013-12-18 16:41:42 +04:00
No block-layer (Known as bio-based)
2019-04-19 01:45:00 +03:00
2013-12-18 16:41:42 +04:00
- Bio-based. IO requests are submitted directly to the device driver.
- Directly accepts bio data structure and returns them.
2013-12-21 03:10:59 +04:00
All of them have a completion queue for each core in the system.
2013-12-18 16:41:42 +04:00
2019-09-11 17:46:34 +03:00
Module parameters
=================
2013-12-18 16:41:42 +04:00
queue_mode=[0-2]: Default: 2-Multi-queue
Selects which block-layer the module should instantiate with.
2019-04-19 01:45:00 +03:00
= ============
0 Bio-based
2019-09-11 17:46:34 +03:00
1 Single-queue (deprecated)
2019-04-19 01:45:00 +03:00
2 Multi-queue
= ============
2013-12-18 16:41:42 +04:00
home_node=[0--nr_nodes]: Default: NUMA_NO_NODE
2013-12-21 03:10:59 +04:00
Selects what CPU node the data structures are allocated from.
2013-12-18 16:41:42 +04:00
gb=[Size in GB]: Default: 250GB
The size of the device reported to the system.
bs=[Block size (in bytes)]: Default: 512 bytes
The block size reported to the system.
2017-11-07 16:23:01 +03:00
nr_devices=[Number of devices]: Default: 1
2013-12-18 16:41:42 +04:00
Number of block devices instantiated. They are instantiated as /dev/nullb0,
etc.
2014-08-14 09:26:22 +04:00
irqmode=[0-2]: Default: 1-Soft-irq
2013-12-18 16:41:42 +04:00
The completion mode used for completing IOs to the block-layer.
2019-04-19 01:45:00 +03:00
= ===========================================================================
0 None.
1 Soft-irq. Uses IPI to complete IOs across CPU nodes. Simulates the overhead
2013-12-21 03:10:59 +04:00
when IOs are issued from another CPU node than the home the device is
2013-12-18 16:41:42 +04:00
connected to.
2019-04-19 01:45:00 +03:00
2 Timer: Waits a specific period (completion_nsec) for each IO before
2013-12-18 16:41:42 +04:00
completion.
2019-04-19 01:45:00 +03:00
= ===========================================================================
2013-12-18 16:41:42 +04:00
2017-11-07 16:23:01 +03:00
completion_nsec=[ns]: Default: 10,000ns
2014-08-14 09:26:22 +04:00
Combined with irqmode=2 (timer). The time each completion event must wait.
2013-12-18 16:41:42 +04:00
2019-09-11 17:46:34 +03:00
submit_queues=[1..nr_cpus]: Default: 1
2013-12-18 16:41:42 +04:00
The number of submission queues attached to the device driver. If unset, it
2017-10-13 19:26:28 +03:00
defaults to 1. For multi-queue, it is ignored when use_per_node_hctx module
parameter is 1.
2013-12-18 16:41:42 +04:00
2013-12-21 03:10:59 +04:00
hw_queue_depth=[0..qdepth]: Default: 64
2013-12-18 16:41:42 +04:00
The hardware queue depth of the device.
2019-09-11 17:46:34 +03:00
Multi-queue specific parameters
-------------------------------
2013-12-18 16:41:42 +04:00
2013-12-21 03:11:00 +04:00
use_per_node_hctx=[0/1]: Default: 0
2019-09-11 17:46:34 +03:00
Number of hardware context queues.
2019-04-19 01:45:00 +03:00
= =====================================================================
0 The number of submit queues are set to the value of the submit_queues
2013-12-21 03:11:00 +04:00
parameter.
2019-04-19 01:45:00 +03:00
1 The multi-queue block layer is instantiated with a hardware dispatch
2013-12-21 03:11:00 +04:00
queue for each CPU node in the system.
2019-04-19 01:45:00 +03:00
= =====================================================================
2015-11-12 22:25:10 +03:00
2017-10-13 19:26:54 +03:00
no_sched=[0/1]: Default: 0
2019-09-11 17:46:34 +03:00
Enable/disable the io scheduler.
2019-04-19 01:45:00 +03:00
= ======================================
0 nullb* use default blk-mq io scheduler
1 nullb* doesn't use io scheduler
= ======================================
2017-11-07 19:25:37 +03:00
2018-05-25 17:40:04 +03:00
blocking=[0/1]: Default: 0
2019-09-11 17:46:34 +03:00
Blocking behavior of the request queue.
2019-04-19 01:45:00 +03:00
= ===============================================================
0 Register as a non-blocking blk-mq driver device.
1 Register as a blocking blk-mq driver device, null_blk will set
2018-05-25 17:40:04 +03:00
the BLK_MQ_F_BLOCKING flag, indicating that it sometimes/always
needs to block in its ->queue_rq() function.
2019-04-19 01:45:00 +03:00
= ===============================================================
2018-05-25 17:40:04 +03:00
2017-11-07 19:25:37 +03:00
shared_tags=[0/1]: Default: 0
2019-09-11 17:46:34 +03:00
Sharing tags between devices.
2019-04-19 01:45:00 +03:00
= ================================================================
0 Tag set is not shared.
1 Tag set shared between devices for blk-mq. Only makes sense with
2017-11-07 19:25:37 +03:00
nr_devices > 1, otherwise there's no tag set to share.
2019-04-19 01:45:00 +03:00
= ================================================================
2018-07-06 20:38:39 +03:00
zoned=[0/1]: Default: 0
2019-09-11 17:46:34 +03:00
Device is a random-access or a zoned block device.
2019-04-19 01:45:00 +03:00
= ======================================================================
0 Block device is exposed as a random-access block device.
1 Block device is exposed as a host-managed zoned block device. Requires
2019-01-04 20:06:37 +03:00
CONFIG_BLK_DEV_ZONED.
2019-04-19 01:45:00 +03:00
= ======================================================================
2018-07-06 20:38:39 +03:00
zone_size=[MB]: Default: 256
Per zone size when exposed as a zoned block device. Must be a power of two.
2019-04-07 11:19:38 +03:00
zone_nr_conv=[nr_conv]: Default: 0
The number of conventional zones to create when block device is zoned. If
zone_nr_conv >= nr_zones, it will be reduced to nr_zones - 1.