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