[缺陷描述]: kernel-selftests:breakpoints目录下step_after_suspend_test用例,会导致机器进入睡眠 复现环境: anck 5.10 x86 ecs 复现概率: 必现 内核信息: # uname -r 5.10.134-314.git.81be3767ee32.an8.x86_64 操作系统信息: # cat /etc/os-release NAME="Anolis OS" VERSION="8.8" ID="anolis" ID_LIKE="rhel fedora centos" VERSION_ID="8.8" PLATFORM_ID="platform:an8" PRETTY_NAME="Anolis OS 8.8" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" cpu信息: # lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel BIOS Vendor ID: Alibaba Cloud CPU family: 6 Model: 106 Model name: Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz BIOS Model name: pc-i440fx-2.1 Stepping: 6 CPU MHz: 2699.998 BogoMIPS: 5399.99 Hypervisor vendor: KVM Virtualization type: full L1d cache: 48K L1i cache: 32K L2 cache: 1280K L3 cache: 49152K NUMA node0 CPU(s): 0-3 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm arch_capabilities 内存信息: # free -h total used free shared buff/cache available Mem: 15Gi 229Mi 13Gi 1.0Mi 1.4Gi 14Gi Swap: 0B 0B 0B [复现步骤]: 下载当前内核对应的kernel源码包 rpm -ivh xxx.src.rpm 默认安装到/root下 yum-builddep -y rpmbuild/SPECS/kernel.spec 自动安装前置依赖包,需要yum-utils rpmbuild -bp ./rpmbuild/SPECS/kernel.spec # 这个步骤会打相关的patch, 解压缩tar包,生成BUILD目录 cd rpmbuild/BUILD/kernel-xxx/linux-xxx/ cd /tools/testing/selftests/breakpoints make 执行测试用例 ./step_after_suspend_test [期望结果]: 用例pass [实际结果]: 机器卡住,无法做进一步操作,手动重启机器恢复正常后,登录查看/var/log/messages日志,机器进入了睡眠模式kernel: PM: suspend entry (s2idle)
调研了一下,这个用例执行过程中会导致机器进入睡眠,之后ssh连接会断开,执行时长大约20分钟左右,用例执行完,机器会从睡眠恢复正常,这个时候就可以正常登录了,睡眠阶段机器是无法连接的,也ping不通,应该是用例的测试场景就是这个样子,只是不具备自动化执行条件。 Feb 23 16:32:49 anolis8-nightly-func-x86-3 kernel: PM: suspend entry (s2idle) Feb 23 16:32:49 anolis8-nightly-func-x86-3 kernel: Filesystems sync: 0.001 seconds Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: Freezing user space processes ... (elapsed 0.000 seconds) done. Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: OOM killer disabled. Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done. Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: printk: Suspending console(s) (use no_console_suspend to debug) Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: OOM killer enabled. Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: Restarting tasks ... done. Feb 23 16:51:17 anolis8-nightly-func-x86-3 kernel: PM: suspend exit