nullblk - animeshtrivedi/notes GitHub Wiki
Location: linux development -> storage notes -> emulation simulation platforms -> Null, memory-backed block device
Always read the modinfo help
- documentation: https://docs.kernel.org/block/null_blk.html
- code: https://github.com/torvalds/linux/tree/v6.8/drivers/block/null_blk (it has its own folder now, from being a single file)
Configurations: https://github.com/animeshtrivedi/notes/wiki/linux-development#setup-null-block-device
sudo profile
and run fio with parallel files
...
_raw_spin_unlock_irq
_raw_spin_unlock_irq
null_process_cmd
null_queue_rq
null_queue_rqs
blk_mq_flush_plug_list.part.0
blk_mq_flush_plug_list
__blk_flush_plug
blk_finish_plug
__iomap_dio_rw
iomap_dio_rw
xfs_file_dio_write_aligned
xfs_file_write_iter
io_write
io_issue_sqe
io_wq_submit_work
io_worker_handle_work
io_wq_worker
ret_from_fork
ret_from_fork_asm
- iou-wrk-463170 (463170)
1893
_raw_spin_unlock_irq
_raw_spin_unlock_irq
null_process_cmd
null_queue_rq
null_queue_rqs
blk_mq_flush_plug_list.part.0
blk_mq_flush_plug_list
__blk_flush_plug
blk_finish_plug
__iomap_dio_rw
iomap_dio_rw
xfs_file_dio_write_aligned
xfs_file_write_iter
io_write
io_issue_sqe
io_wq_submit_work
io_worker_handle_work
io_wq_worker
ret_from_fork
ret_from_fork_asm
- iou-wrk-463169 (463169)
1897
This code path
null_process_cmd
null_queue_rq
null_queue_rqs
This is the lock here that stops scaling (global per-device lock!): https://elixir.bootlin.com/linux/v6.9/source/drivers/block/null_blk/main.c#L1215
sudo modprobe null_blk queue_mode=2 gb=32 bs=4096 nr_devices=1 irqmode=2 hw_queue_depth=512 use_per_node_hctx=0 completion_nsec=10000 memory_backed=1
https://github.com/animeshtrivedi/notes/wiki/linux-development#tmpfs-and-null-block-device-options