代码拉取完成,页面将自动刷新
【标题描述】能够简要描述问题:说明什么场景下,做了什么操作,出现什么问题(尽量使用正向表达方式)
数通产品线出现UBI后台线程长时间(30~40min)CPU占用率高(50%)的问题
top - 12:10:42 up 5 min, 2 users, load average: 1.76, 0.68, 0.27
Tasks: 123 total, 3 running, 54 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.2 us, 27.1 sy, 0.0 ni, 68.9 id, 2.0 wa, 0.0 hi, 0.8 si, 0.0 st
KiB Mem : 7450768 total, 7117392 free, 85744 used, 247632 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 7055348 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1589 root 20 0 0 0 0 R 45.0 0.0 0:38.86 ubi_bgt0d
319 root 20 0 0 0 0 I 15.2 0.0 0:15.29 kworker/0:3-eve
371 root 20 0 0 0 0 I 14.9 0.0 0:12.85 kworker/3:3-eve
20 root 20 0 0 0 0 I 11.3 0.0 0:05.33 kworker/1:0-eve
202 root 20 0 0 0 0 I 11.3 0.0 0:04.93 kworker/2:3-eve
【环境信息】
硬件信息:
NA
软件信息:
OLK5.10
【问题复现步骤】
具体操作步骤
在内核加打印
diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c
index 28f55f9cf715..ea6f2e37cffa 100644
--- a/drivers/mtd/ubi/fastmap-wl.c
+++ b/drivers/mtd/ubi/fastmap-wl.c
@@ -148,8 +148,12 @@ void ubi_refill_pools(struct ubi_device *ubi)
if (wl_pool->size < wl_pool->max_size) {
if (!ubi->free.rb_node ||
- (ubi->free_count - ubi->beb_rsvd_pebs < 5))
+ (ubi->free_count - ubi->beb_rsvd_pebs < 5)) {
+ if (wl_pool->size == 0 && !strncmp(current->comm, "kworker", strlen("kworker"))) {
+ pr_err("ZERO\n");
+ }
break;
+ }
e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
self_check_in_wl_tree(ubi, e, &ubi->free);
./setup.sh 1
fsstress -l0 -n10000 -p4 -d /root/temp
出现概率(是否必现,概率性错误)小
【预期结果】
看到内核打印ZERO后停掉fsstress,ubi_bgt0d线程的CPU占用率在10%以上
【实际结果】
【附件信息】
setup.sh
#!/bin/bash
set -e
TMP=/root/temp
umount $TMP 2>/dev/null || true
mkdir -p $TMP
modprobe -r ubifs 2>/dev/null || true
for i in $(seq 0 1)
do
ubidetach -p /dev/mtd$i 2>/dev/null || true
done
modprobe -r ubi 2>/dev/null || true
modprobe -r nandsim 2>/dev/null || true
mtd=/dev/mtd0
ubi=/dev/ubi0
ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB
#ID="0x20,0xa5,0x00,0x15" # 2GB 128KB PEB, 2KB page
#ID="0x20,0xa5,0x00,0x26" # 4G 256KB 4KB 1KB-sub-page
#ID="0x20,0xa7,0x00,0x26" # 4G 256KB 4KB 2KB-sub-page
#ID="0x20,0x33,0x00,0x00" # 16M 16KB PEB, 512 page
modprobe nandsim id_bytes=$ID
if [ "$1" == "1" ]
then
modprobe ubi mtd="0,2048" fm_autoconvert
ubimkvol -N vol_a -m -n 0 /dev/ubi0
modprobe ubifs
mkfs.ubifs -j 6221824 -R 0 /dev/ubi0_0
mount -osync -t ubifs /dev/ubi0_0 $TMP
else
nandwrite /dev/mtd0 mtdblock1 > /dev/null
modprobe ubi mtd="0,2048" #fm_autoconvert
modprobe ubifs
mount -t ubifs /dev/ubi0_9 $TMP
fi
Hi czh549642238, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @pi3orama , @成坚 (CHENG Jian) , @jiaoff , @Xie XiuQi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论