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