null_blk.txt 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Null block device driver
  2. ================================================================================
  3. I. Overview
  4. The null block device (/dev/nullb*) is used for benchmarking the various
  5. block-layer implementations. It emulates a block device of X gigabytes in size.
  6. The following instances are possible:
  7. Single-queue block-layer
  8. - Request-based.
  9. - Single submission queue per device.
  10. - Implements IO scheduling algorithms (CFQ, Deadline, noop).
  11. Multi-queue block-layer
  12. - Request-based.
  13. - Configurable submission queues per device.
  14. No block-layer (Known as bio-based)
  15. - Bio-based. IO requests are submitted directly to the device driver.
  16. - Directly accepts bio data structure and returns them.
  17. All of them have a completion queue for each core in the system.
  18. II. Module parameters applicable for all instances:
  19. queue_mode=[0-2]: Default: 2-Multi-queue
  20. Selects which block-layer the module should instantiate with.
  21. 0: Bio-based.
  22. 1: Single-queue.
  23. 2: Multi-queue.
  24. home_node=[0--nr_nodes]: Default: NUMA_NO_NODE
  25. Selects what CPU node the data structures are allocated from.
  26. gb=[Size in GB]: Default: 250GB
  27. The size of the device reported to the system.
  28. bs=[Block size (in bytes)]: Default: 512 bytes
  29. The block size reported to the system.
  30. nr_devices=[Number of devices]: Default: 1
  31. Number of block devices instantiated. They are instantiated as /dev/nullb0,
  32. etc.
  33. irqmode=[0-2]: Default: 1-Soft-irq
  34. The completion mode used for completing IOs to the block-layer.
  35. 0: None.
  36. 1: Soft-irq. Uses IPI to complete IOs across CPU nodes. Simulates the overhead
  37. when IOs are issued from another CPU node than the home the device is
  38. connected to.
  39. 2: Timer: Waits a specific period (completion_nsec) for each IO before
  40. completion.
  41. completion_nsec=[ns]: Default: 10,000ns
  42. Combined with irqmode=2 (timer). The time each completion event must wait.
  43. submit_queues=[1..nr_cpus]:
  44. The number of submission queues attached to the device driver. If unset, it
  45. defaults to 1. For multi-queue, it is ignored when use_per_node_hctx module
  46. parameter is 1.
  47. hw_queue_depth=[0..qdepth]: Default: 64
  48. The hardware queue depth of the device.
  49. III: Multi-queue specific parameters
  50. use_per_node_hctx=[0/1]: Default: 0
  51. 0: The number of submit queues are set to the value of the submit_queues
  52. parameter.
  53. 1: The multi-queue block layer is instantiated with a hardware dispatch
  54. queue for each CPU node in the system.
  55. no_sched=[0/1]: Default: 0
  56. 0: nullb* use default blk-mq io scheduler.
  57. 1: nullb* doesn't use io scheduler.
  58. blocking=[0/1]: Default: 0
  59. 0: Register as a non-blocking blk-mq driver device.
  60. 1: Register as a blocking blk-mq driver device, null_blk will set
  61. the BLK_MQ_F_BLOCKING flag, indicating that it sometimes/always
  62. needs to block in its ->queue_rq() function.
  63. shared_tags=[0/1]: Default: 0
  64. 0: Tag set is not shared.
  65. 1: Tag set shared between devices for blk-mq. Only makes sense with
  66. nr_devices > 1, otherwise there's no tag set to share.
  67. zoned=[0/1]: Default: 0
  68. 0: Block device is exposed as a random-access block device.
  69. 1: Block device is exposed as a host-managed zoned block device.
  70. zone_size=[MB]: Default: 256
  71. Per zone size when exposed as a zoned block device. Must be a power of two.