blob: edbbab2f12f8c7b99f6a7059acbfa3760b1ac98e [file] [log] [blame]
André Almeida04c56952019-09-11 11:46:34 -03001.. SPDX-License-Identifier: GPL-2.0
2
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03003========================
Matias Bjorling12f8f4f2013-12-18 13:41:42 +01004Null block device driver
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03005========================
Matias Bjorling12f8f4f2013-12-18 13:41:42 +01006
André Almeida04c56952019-09-11 11:46:34 -03007Overview
8========
Matias Bjorling12f8f4f2013-12-18 13:41:42 +01009
André Almeida04c56952019-09-11 11:46:34 -030010The null block device (``/dev/nullb*``) is used for benchmarking the various
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010011block-layer implementations. It emulates a block device of X gigabytes in size.
André Almeida04c56952019-09-11 11:46:34 -030012It does not execute any read/write operation, just mark them as complete in
13the request queue. The following instances are possible:
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030014
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010015 Multi-queue block-layer
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030016
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010017 - Request-based.
18 - Configurable submission queues per device.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030019
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010020 No block-layer (Known as bio-based)
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030021
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010022 - Bio-based. IO requests are submitted directly to the device driver.
23 - Directly accepts bio data structure and returns them.
24
Matias Bjørling89ed05e2013-12-21 00:10:59 +010025All of them have a completion queue for each core in the system.
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010026
André Almeida04c56952019-09-11 11:46:34 -030027Module parameters
28=================
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010029
30queue_mode=[0-2]: Default: 2-Multi-queue
31 Selects which block-layer the module should instantiate with.
32
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030033 = ============
34 0 Bio-based
André Almeida04c56952019-09-11 11:46:34 -030035 1 Single-queue (deprecated)
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030036 2 Multi-queue
37 = ============
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010038
39home_node=[0--nr_nodes]: Default: NUMA_NO_NODE
Matias Bjørling89ed05e2013-12-21 00:10:59 +010040 Selects what CPU node the data structures are allocated from.
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010041
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
Minwoo Ime8815242017-11-07 22:23:01 +090048nr_devices=[Number of devices]: Default: 1
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010049 Number of block devices instantiated. They are instantiated as /dev/nullb0,
50 etc.
51
Fam Zhenga2787312014-08-14 13:26:22 +080052irqmode=[0-2]: Default: 1-Soft-irq
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010053 The completion mode used for completing IOs to the block-layer.
54
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030055 = ===========================================================================
56 0 None.
57 1 Soft-irq. Uses IPI to complete IOs across CPU nodes. Simulates the overhead
Matias Bjørling89ed05e2013-12-21 00:10:59 +010058 when IOs are issued from another CPU node than the home the device is
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010059 connected to.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030060 2 Timer: Waits a specific period (completion_nsec) for each IO before
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010061 completion.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030062 = ===========================================================================
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010063
Minwoo Ime8815242017-11-07 22:23:01 +090064completion_nsec=[ns]: Default: 10,000ns
Fam Zhenga2787312014-08-14 13:26:22 +080065 Combined with irqmode=2 (timer). The time each completion event must wait.
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010066
André Almeida04c56952019-09-11 11:46:34 -030067submit_queues=[1..nr_cpus]: Default: 1
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010068 The number of submission queues attached to the device driver. If unset, it
weiping zhang23c44902017-10-14 00:26:28 +080069 defaults to 1. For multi-queue, it is ignored when use_per_node_hctx module
70 parameter is 1.
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010071
Matias Bjørling89ed05e2013-12-21 00:10:59 +010072hw_queue_depth=[0..qdepth]: Default: 64
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010073 The hardware queue depth of the device.
74
André Almeida04c56952019-09-11 11:46:34 -030075Multi-queue specific parameters
76-------------------------------
Matias Bjorling12f8f4f2013-12-18 13:41:42 +010077
Matias Bjørling20005242013-12-21 00:11:00 +010078use_per_node_hctx=[0/1]: Default: 0
André Almeida04c56952019-09-11 11:46:34 -030079 Number of hardware context queues.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030080
81 = =====================================================================
82 0 The number of submit queues are set to the value of the submit_queues
Matias Bjørling20005242013-12-21 00:11:00 +010083 parameter.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030084 1 The multi-queue block layer is instantiated with a hardware dispatch
Matias Bjørling20005242013-12-21 00:11:00 +010085 queue for each CPU node in the system.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030086 = =====================================================================
Matias Bjørlingb2b7e002015-11-12 20:25:10 +010087
weiping zhangfc186312017-10-14 00:26:54 +080088no_sched=[0/1]: Default: 0
André Almeida04c56952019-09-11 11:46:34 -030089 Enable/disable the io scheduler.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030090
91 = ======================================
92 0 nullb* use default blk-mq io scheduler
93 1 nullb* doesn't use io scheduler
94 = ======================================
Minwoo Imbf9fc982017-11-07 09:25:37 -070095
Liu Bo6723d8d2018-05-25 22:40:04 +080096blocking=[0/1]: Default: 0
André Almeida04c56952019-09-11 11:46:34 -030097 Blocking behavior of the request queue.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030098
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
Liu Bo6723d8d2018-05-25 22:40:04 +0800102 the BLK_MQ_F_BLOCKING flag, indicating that it sometimes/always
103 needs to block in its ->queue_rq() function.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -0300104 = ===============================================================
Liu Bo6723d8d2018-05-25 22:40:04 +0800105
Minwoo Imbf9fc982017-11-07 09:25:37 -0700106shared_tags=[0/1]: Default: 0
André Almeida04c56952019-09-11 11:46:34 -0300107 Sharing tags between devices.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -0300108
109 = ================================================================
110 0 Tag set is not shared.
111 1 Tag set shared between devices for blk-mq. Only makes sense with
Minwoo Imbf9fc982017-11-07 09:25:37 -0700112 nr_devices > 1, otherwise there's no tag set to share.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -0300113 = ================================================================
Matias Bjørlingca4b2a02018-07-06 19:38:39 +0200114
115zoned=[0/1]: Default: 0
André Almeida04c56952019-09-11 11:46:34 -0300116 Device is a random-access or a zoned block device.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -0300117
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
John Pittman373282e2019-01-04 12:06:37 -0500121 CONFIG_BLK_DEV_ZONED.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -0300122 = ======================================================================
Matias Bjørlingca4b2a02018-07-06 19:38:39 +0200123
124zone_size=[MB]: Default: 256
125 Per zone size when exposed as a zoned block device. Must be a power of two.
Minwoo Im0d413822019-04-07 17:19:38 +0900126
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.