【问题描述】 使用ltp进行内核功能测试系统调用,执行命令:./runltp -f controllers 未能全都Pass 【测试环境】 # cat /etc/os-release NAME="Anolis OS" VERSION="8.4" ID="anolis" ID_LIKE="rhel fedora centos" VERSION_ID="8.4" PLATFORM_ID="platform:an8" PRETTY_NAME="Anolis OS 8.4" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" # lscpu 架构: loongarch64 字节序: Little Endian CPU: 4 在线 CPU 列表: 0-3 每个核的线程数: 1 每个座的核数: 4 座: 1 NUMA 节点: 1 CPU 系列: Loongson-64bit 型号名称: Loongson-3A5000 BogoMIPS: 5000.00 L1d 缓存: 64K L1i 缓存: 64K L2 缓存: 256K L3 缓存: 16384K NUMA 节点0 CPU: 0-3 标记: cpucfg lam ual fpu lsx lasx complex crypto lvz lbt_x86 lbt_arm lbt_mips # free -h total used free shared buff/cache available Mem: 7.8Gi 1.3Gi 5.7Gi 16Mi 867Mi 5.5Gi Swap: 7.9Gi 9.0Mi 7.9Gi 【测试日志】 <<<test_start>>> tag=cpuset_memory_spread stime=1641351077 cmdline="cpuset_memory_spread_testset.sh" contacts="" analysis=exit <<<test_output>>> cpuset_memory_spread 1 TINFO: CPUs are numbered continuously starting at 0 (0-31) cpuset_memory_spread 1 TINFO: Nodes are numbered continuously starting at 0 (0-7) 记录了100+0 的读入 记录了100+0 的写出 104857600 bytes (105 MB, 100 MiB) copied, 0.0757754 s, 1.4 GB/s cpuset_memory_spread 1 TPASS: Cpuset memory spread page test succeeded. cpuset_memory_spread 3 TPASS: Cpuset memory spread page test succeeded. cpuset_memory_spread 5 TFAIL: hog the memory on the unexpected node(FilePages_For_Nodes(KB): _0: -48 _1: 102368 _2: -16 _3: 0 _4: 48 _5: 0 _6: -80 _7: 6176, Expect Nodes: 1). cpuset_memory_spread 7 TFAIL: hog the memory on the unexpected node(FilePages_For_Nodes(KB): _0: 48 _1: 102176 _2: 48 _3: -48 _4: -16 _5: 112 _6: 16 _7: 12448, Expect Nodes: 1). cpuset_memory_spread 9 TFAIL: hog the memory on the unexpected node(FilePages_For_Nodes(KB): _0: 102384 _1: -32 _2: 32 _3: 48 _4: 0 _5: 0 _6: -48 _7: 10240, Expect Nodes: 0). cpuset_memory_spread 11 TFAIL: hog the memory on the unexpected node(FilePages_For_Nodes(KB): _0: 51056 _1: 51056 _2: -32 _3: -32 _4: -16 _5: -16 _6: 64 _7: 9760, Expect Nodes: 0,1). cpuset_memory_spread 13 TPASS: Cpuset memory spread page test succeeded. <<<execution_status>>> initiation_status="ok" duration=8 termination_type=exited termination_id=1 corefile=no cutime=236 cstime=397 <<<test_end>>> 【预期结果】 Pass 【相关描述】 经查询,同类型问题: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1830585
非bug, 由于ltp的cpuset_memory_spread测试用例设计不合理导致. 从测试失败的log上看, 内存spread的测试在期望节点的页缓存增加都是符合预期的. 导致测试失败的原因是其它节点上页缓存的增加超过了2000KB, 而这个测试用例并没有约束cpuset_mem_hog测试程序期间, 其它进程及内核线程使用页缓存上的约束, 导致其它节点在使用页缓存上存在不确定性.