我要评分
获取效率
正确性
完整性
易理解

CPU Usage of the osq_lock Function Is High When libaio Is Used to Perform the fio Test

Symptom

When the libaio engine is used to perform the fio test, the perf top command output indicates that the CPU usage of the osq_lock function in the kernel space exceeds 40%.

Key Process and Cause Analysis

The CPU usage of the osq_lock function in the kernel space of the libaio engine is high.

Conclusion and Solution

The purpose of the test is to check the Ceph performance. If the kernel RBD mode is used, the libaio engine needs to be used for the test, and the CPU usage of its kernel function is high. If the user-mode librbd library is used as the engine for testing, this problem can be avoided.

  • Test command when libaio is used:
    fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=4k -numjobs=1 -group_reporting -name=test1 -filename=/dev/your_device
  • Test command when librbd is used:
    fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=rbd -bs=4k -numjobs=1 -group_reporting -name=test1 -pool=yourpool -rbdname=imagename