CPU Usage of the osq_lock Function Is High When libaio Is Used to Perform the fio Test
Problem Description
Item |
Information |
|---|---|
Source of the Problem |
Online maintenance |
Product |
Kunpeng BoostKit |
Sub-item |
SDS |
Service Scenario |
Debugging and running |
Component |
Other |
Output Time |
2019-10-28 |
Author |
Chen Xiaobo 00416232 |
Team |
Kunpeng BoostKit |
Review Result |
Review passed |
Review Date |
2019-11-05 |
Release Date |
2020-03-20 |
Keywords |
High CPU usage |
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