Notes
main
main
  • Introduction
  • linuxKernel
    • tips
    • make_help
    • old linux
      • compile_linux0.11
      • TestEnvironment
      • load_setup
      • get_hard_data
    • list
    • plist
    • fifo
    • idr
    • xarray
    • rbtree
    • maple_tree
    • syscall
    • bitmap
    • page
    • page_flags
    • page_size
    • page mapcount
    • page refcount
    • folio
    • slub
      • proc_slabinfo
      • slub_theory
      • kmalloc_kfree
      • kmem_cache
      • slab_alloc
      • slab_free
      • proc_meminfo_SReclaimable_SReclaimable
    • vmalloc
    • brk
    • mmap
    • mremap
    • mprotect
    • madvise
    • read
    • write
    • shmem
    • huge_page
    • page_fault
    • rmap
    • lru
    • multi-gen-LRU
    • page_reclaim
    • page_cache
    • page_table
    • rcu
    • kvm
    • aarch64_boot
    • tracing_system
    • cache_coherence_and_memory_consistency
    • cpu_speculates
    • mmap_lock
    • per-vma_lock
    • cgroup
    • symbol
    • campact
    • page_ext
    • mempool
    • kernelstack
    • filesystem
    • io_stack
    • workingset
    • ioremap
    • sched_period
  • linuxDebug
    • openocd_openjtag
    • i2c_tools
    • objdump
    • addr2line
    • gdb_useage
    • debug_linux_kernel_via_gdb
    • debug_linux_module_via_gdb
    • early_boot
    • sequentially_execute
    • dynamic_debug
    • research_linuxKernel_by_patch
    • tracefs
    • ebpf
    • bpftrace
    • perf
    • flame_graph
    • crash
    • ASAN_HWASAN_MTE_check_mem_bug
    • page_owner
    • vmtouch
    • fio
    • benchmark
  • linuxSystem
    • common
      • system_version
      • procfs
      • proc_sys_vm
      • cmd_ps
      • makefile
      • file_descriptor
      • psi
      • ulimit
      • top
      • delay_accounting
    • ubuntu
      • custom_kernel
      • get_cmd_src
      • record_ssh_info
      • log
      • run_custom_script
      • repo
      • cockpit
      • nfs
      • tftp
      • misc
    • fedora
      • system_upgrade
      • custom_kernel
      • lvextend
      • yt-dlp
      • jellyfin
  • linuxDriver
    • i2c_peripherals_driver
    • spi_peripherals_driver
    • gpio_subsystem
    • IRQ_driver
    • blockIO_unblockIO_async
    • linux_own_driver
    • misc_device
    • input_device
    • timer
    • atomic_spinlock_semaphore_mutex
    • lcd
    • touch_screen
    • debugfs
    • v4l2
    • mmap
  • hardware
    • paging_mmu_pt
    • iommu
  • process_thread_scheduler
    • scheduler01
    • scheduler02
    • scheduler03
    • scheduler04
    • scheduler05
    • scheduler06
  • memory_management
    • mm1
    • mm2
    • mm3
    • mm4
    • mm5
  • input_output_filesystem
    • io_fs_01
    • io_fs_02
    • io_fs_03
    • io_fs_04
  • lock_and_lockup_detector
    • general_lock
    • hung_task
    • softLockup_hardLockup
    • crash_experiment
  • MIT_6.S081
    • 6.S081_Operating_System_Engineering
    • Schedule.md
    • Class
      • Overview
      • Administrivia
    • Labs
      • Tools
      • Guidance
      • startup
      • syscall
      • page_table
      • Calling_Convention
      • traps
    • xv6
      • xv6
    • References.md
  • qemu
    • qemu_buildroot
    • qemu_busybox.md
    • Serial.md
    • demo_mini2440
      • 0_compilation_error_summary
      • 1_compilation_steps
      • 2_operation_mode
      • 3_transplant_tools_libraries
      • 4_tools_use
      • reference_website
  • tools
    • getKernelSourceCodeList
    • nat
    • shell
    • translating
    • YouCompleteMe
    • cscope
    • global
    • vscode
    • vim
    • binary
    • markdown
    • draw
    • git
    • tig
    • tmux
    • mail_client
    • download_patchset_from_LKML
    • minicom
    • clash
  • other
    • interview
    • interview_c_base
    • know_dontknow
    • Stop-Ask-Questions-The-Stupid-Ways
    • How-To-Ask-Questions-The-Smart-Way
    • docker
    • buildroot
    • rv32_to_rv64
Powered by GitBook
On this page
  • 简介
  • 使用
  • 参数解析
  • 结果解析

Was this helpful?

  1. linuxDebug

fio

简介

fio 将生成许多线程/进程来执行用户指定的特定类型 I/O 操作,典型用途是模拟 I/O 负载。

使用

$ fio --name=test --size=10G --ioengine=io_uring --rw=write

运行一个名为 test 进程,创建一个 10G 大小的文件,使用 io_uring 进行 write 操作。

参数解析

  • name :指定进程名字

  • size :指定测试文件总大小

  • ioengine :指定 IO 模式

  • rw :指定 read/write 方式

结果解析

test: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=io_uring, iodepth=1
fio-3.28
Starting 1 process
Jobs: 1 (f=1): [W(1)][100.0%][w=548MiB/s][w=140k IOPS][eta 00m:00s]

第一行代表此次 fio 执行的参数设置

第四行代表此次 fio 执行的程度条,只要等到 100% 才会输出后面内容,其中 BW/IOPS 都是一些瞬时值,动态变化中。

  write: IOPS=139k, BW=541MiB/s (568MB/s)(10.0GiB/18916msec); 0 zone resets
    slat (nsec): min=839, max=35470, avg=1186.94, stdev=225.71
    clat (nsec): min=50, max=16237k, avg=5283.48, stdev=14488.46
     lat (usec): min=4, max=16238, avg= 6.50, stdev=14.49
    clat percentiles (nsec):
     |  1.00th=[ 4896],  5.00th=[ 4960], 10.00th=[ 4960], 20.00th=[ 5024],
     | 30.00th=[ 5024], 40.00th=[ 5088], 50.00th=[ 5088], 60.00th=[ 5152],
     | 70.00th=[ 5152], 80.00th=[ 5280], 90.00th=[ 5664], 95.00th=[ 6304],
     | 99.00th=[ 6752], 99.50th=[ 7456], 99.90th=[22144], 99.95th=[34048],
     | 99.99th=[80384]

这是 write 操作的输出结果,显示平均 IOPS 139K,平均 BW 541MB/s,还有文件总大小 10GB,总耗时 18916ms。

slat 代表从用户触发 write 操作到 submit_bio() 的耗时,即 submit 延迟

clat 代表从 submit_bio() 到真正完成 write 操作的耗时,即 complete 延迟

lat 代表 slat + clat

clat percentiles 代表 clat 分布图,如:1.00th=[ 4896] 1% 的 clat 等于 4896ns

   bw (  KiB/s): min=323136, max=605488, per=100.00%, avg=585594.97, stdev=47035.65, samples=35
   iops        : min=80784, max=151372, avg=146398.74, stdev=11758.91, samples=35

bw : 基于样本 samples 的带宽统计

iops : 基于样本 samples 的 IOPS 统计

  lat (nsec)   : 100=0.01%, 250=0.01%
  lat (usec)   : 2=0.01%, 4=0.01%, 10=99.79%, 20=0.10%, 50=0.08%
  lat (usec)   : 100=0.02%, 250=0.01%, 500=0.01%
  lat (msec)   : 2=0.01%, 10=0.01%, 20=0.01%

TODO

  cpu          : usr=16.86%, sys=38.08%, ctx=2621666, majf=0, minf=13
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=0,2621440,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

user 的 CPU 使用率等于 16.86%

sys 的 CPU 使用率等于38.08%

上下文切换次数等于 2621666

major fault 次数等于 0

minor fault 次数等于 13

Run status group 0 (all jobs):
  WRITE: bw=541MiB/s (568MB/s), 541MiB/s-541MiB/s (568MB/s-568MB/s), io=10.0GiB (10.7GB), run=18916-18916msec

Disk stats (read/write):
  nvme0n1: ios=0/64376, merge=0/43, ticks=0/2042944, in_queue=2043028, util=56.60%

TODO

PreviousvmtouchNextbenchmark

Last updated 6 months ago

Was this helpful?