Merge tag 'wireless-drivers-for-davem-2019-09-26' of https://git.kernel.org/pub/scm...
[linux-2.6-block.git] / Documentation / block / null_blk.rst
CommitLineData
04c56957
AA
1.. SPDX-License-Identifier: GPL-2.0
2
898bd37a 3========================
12f8f4fc 4Null block device driver
898bd37a 5========================
12f8f4fc 6
04c56957
AA
7Overview
8========
12f8f4fc 9
04c56957 10The null block device (``/dev/nullb*``) is used for benchmarking the various
12f8f4fc 11block-layer implementations. It emulates a block device of X gigabytes in size.
04c56957
AA
12It does not execute any read/write operation, just mark them as complete in
13the request queue. The following instances are possible:
898bd37a 14
12f8f4fc 15 Multi-queue block-layer
898bd37a 16
12f8f4fc
MB
17 - Request-based.
18 - Configurable submission queues per device.
898bd37a 19
12f8f4fc 20 No block-layer (Known as bio-based)
898bd37a 21
12f8f4fc
MB
22 - Bio-based. IO requests are submitted directly to the device driver.
23 - Directly accepts bio data structure and returns them.
24
89ed05ee 25All of them have a completion queue for each core in the system.
12f8f4fc 26
04c56957
AA
27Module parameters
28=================
12f8f4fc
MB
29
30queue_mode=[0-2]: Default: 2-Multi-queue
31 Selects which block-layer the module should instantiate with.
32
898bd37a
MCC
33 = ============
34 0 Bio-based
04c56957 35 1 Single-queue (deprecated)
898bd37a
MCC
36 2 Multi-queue
37 = ============
12f8f4fc
MB
38
39home_node=[0--nr_nodes]: Default: NUMA_NO_NODE
89ed05ee 40 Selects what CPU node the data structures are allocated from.
12f8f4fc
MB
41
42gb=[Size in GB]: Default: 250GB
43 The size of the device reported to the system.
44
45bs=[Block size (in bytes)]: Default: 512 bytes
46 The block size reported to the system.
47
e8815241 48nr_devices=[Number of devices]: Default: 1
12f8f4fc
MB
49 Number of block devices instantiated. They are instantiated as /dev/nullb0,
50 etc.
51
a2787312 52irqmode=[0-2]: Default: 1-Soft-irq
12f8f4fc
MB
53 The completion mode used for completing IOs to the block-layer.
54
898bd37a
MCC
55 = ===========================================================================
56 0 None.
57 1 Soft-irq. Uses IPI to complete IOs across CPU nodes. Simulates the overhead
89ed05ee 58 when IOs are issued from another CPU node than the home the device is
12f8f4fc 59 connected to.
898bd37a 60 2 Timer: Waits a specific period (completion_nsec) for each IO before
12f8f4fc 61 completion.
898bd37a 62 = ===========================================================================
12f8f4fc 63
e8815241 64completion_nsec=[ns]: Default: 10,000ns
a2787312 65 Combined with irqmode=2 (timer). The time each completion event must wait.
12f8f4fc 66
04c56957 67submit_queues=[1..nr_cpus]: Default: 1
12f8f4fc 68 The number of submission queues attached to the device driver. If unset, it
23c4490d 69 defaults to 1. For multi-queue, it is ignored when use_per_node_hctx module
70 parameter is 1.
12f8f4fc 71
89ed05ee 72hw_queue_depth=[0..qdepth]: Default: 64
12f8f4fc
MB
73 The hardware queue depth of the device.
74
04c56957
AA
75Multi-queue specific parameters
76-------------------------------
12f8f4fc 77
20005244 78use_per_node_hctx=[0/1]: Default: 0
04c56957 79 Number of hardware context queues.
898bd37a
MCC
80
81 = =====================================================================
82 0 The number of submit queues are set to the value of the submit_queues
20005244 83 parameter.
898bd37a 84 1 The multi-queue block layer is instantiated with a hardware dispatch
20005244 85 queue for each CPU node in the system.
898bd37a 86 = =====================================================================
b2b7e001 87
fc186311 88no_sched=[0/1]: Default: 0
04c56957 89 Enable/disable the io scheduler.
898bd37a
MCC
90
91 = ======================================
92 0 nullb* use default blk-mq io scheduler
93 1 nullb* doesn't use io scheduler
94 = ======================================
bf9fc98b 95
6723d8dc 96blocking=[0/1]: Default: 0
04c56957 97 Blocking behavior of the request queue.
898bd37a
MCC
98
99 = ===============================================================
100 0 Register as a non-blocking blk-mq driver device.
101 1 Register as a blocking blk-mq driver device, null_blk will set
6723d8dc
LB
102 the BLK_MQ_F_BLOCKING flag, indicating that it sometimes/always
103 needs to block in its ->queue_rq() function.
898bd37a 104 = ===============================================================
6723d8dc 105
bf9fc98b 106shared_tags=[0/1]: Default: 0
04c56957 107 Sharing tags between devices.
898bd37a
MCC
108
109 = ================================================================
110 0 Tag set is not shared.
111 1 Tag set shared between devices for blk-mq. Only makes sense with
bf9fc98b 112 nr_devices > 1, otherwise there's no tag set to share.
898bd37a 113 = ================================================================
ca4b2a01
MB
114
115zoned=[0/1]: Default: 0
04c56957 116 Device is a random-access or a zoned block device.
898bd37a
MCC
117
118 = ======================================================================
119 0 Block device is exposed as a random-access block device.
120 1 Block device is exposed as a host-managed zoned block device. Requires
373282e7 121 CONFIG_BLK_DEV_ZONED.
898bd37a 122 = ======================================================================
ca4b2a01
MB
123
124zone_size=[MB]: Default: 256
125 Per zone size when exposed as a zoned block device. Must be a power of two.
0d413829
MI
126
127zone_nr_conv=[nr_conv]: Default: 0
128 The number of conventional zones to create when block device is zoned. If
129 zone_nr_conv >= nr_zones, it will be reduced to nr_zones - 1.