Bug 124 - [Anolis OS 8.4 龙芯版][4.19.190-3.an8.loongarch64]ltp测试时mincore04用例fail,fail原因为mincore reports 0 pages resident but 3 pages locked by child process
Summary: [Anolis OS 8.4 龙芯版][4.19.190-3.an8.loongarch64]ltp测试时mincore04用例fail,fail原因为m...
Status: CLOSED FIXED
Alias: None
Product: ANCK 4.19 Dev
Classification: ANCK
Component: general/others (show other bugs) general/others
Version: unspecified
Hardware: loongarch Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: shanxifanshi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-17 11:17 UTC by shanxifanshi
Modified: 2023-07-25 16:28 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shanxifanshi alibaba_cloud_group 2021-12-17 11:17:40 UTC
[缺陷描述]:
ltp测试时syscalls目录下的mincore04用例fail,fail原因为mincore reports 0 pages resident but 3 pages locked by child process

测试日志:
<<<test_start>>>
tag=mincore04 stime=1639707140
cmdline="mincore04"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_test.c:1411: TINFO: Timeout per run is 0h 05m 00s
mincore04.c:103: TFAIL: mincore reports 0 pages resident but 3 pages locked by child process

Summary:
passed   0
failed   1
broken   0
skipped  0
warnings 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=0
<<<test_end>>>

系统镜像:
http://8.131.87.1/kojifiles/output/an-8-loongarch64-RC1/compose/BaseOS/loongarch64/iso/

复现环境:
龙芯物理机

复现概率:
必现

内核信息:
# uname -r
4.19.190-3.an8.loongarch64

操作系统信息:
# cat /etc/anolis-release
Anolis OS release 8.4
[root@localhost ~]# 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/"

cpu信息:
# lscpu
Architecture:        loongarch64
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
CPU family:          Loongson-64bit
Model name:          Loongson-3A5000LL
BogoMIPS:            4600.00
L1d cache:           64K
L1i cache:           64K
L2 cache:            256K
L3 cache:            16384K
NUMA node0 CPU(s):   0-3
Flags:               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:           15Gi       1.3Gi       2.7Gi        18Mi        11Gi        12Gi
Swap:         7.9Gi       1.0Mi       7.9Gi

[期望结果]:
mincore04用例pass

[实际结果]:
mincore04用例fail

[初步分析]:
测试代码路径:ltp/testcases/kernel/syscalls/mincore/mincore04.c

测试原理:父进程mapped的page,在子进程中lock,预期mincore系统调用检查该page在内存中驻留,实际没有驻留

疑似如下问题未解决,请开发同学确认:
参考资料:https://man7.org/linux/man-pages/man2/mincore.2.html

BUGS         top
       Before kernel 2.6.21, mincore() did not return correct
       information for MAP_PRIVATE mappings, or for nonlinear mappings
       (established using remap_file_pages(2)).
Comment 1 liqianwen loongson_group 2021-12-24 17:11:10 UTC
[测试描述]
x86 ltp测试时syscalls目录下的mincore04用例pass
[测试日志]
<<<test_start>>>
tag=mincore04 stime=1640336692
cmdline="mincore04"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_test.c:1428: TINFO: Timeout per run is 0h 05m 00s
mincore04.c:100: TPASS: mincore reports all 3 pages locked by child process are resident
Summary:
passed   1
failed   0
broken   0
skipped  0
warnings 0
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=0
<<<test_end>>>
[复现步骤]
git clone https://github.com/linux-test-project/ltp.git
cd ltp
make autotools
./configure
make
make install
/opt/ltp/runltp -f syscalls -s mincore04
[内核信息]
# uname -r
4.18.0-305.25.1.el8_4.x86_64
[操作系统信息]
# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
[cpu信息 ]
# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           8
NUMA node(s):        1
Vendor ID:           GenuineIntel
BIOS Vendor ID:      Red Hat
CPU family:          6
Model:               85
Model name:          Intel Xeon Processor (Skylake, IBRS)
BIOS Model name:     RHEL-8.2.0 PC (Q35 + ICH9, 2009)
Stepping:            4
CPU MHz:             2194.838
BogoMIPS:            4389.67
Virtualization:      VT-x
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            4096K
L3 cache:            16384K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat umip pku ospke md_clear arch_capabilities
[内存信息]
# free -h
              total        used        free      shared  buff/cache   available
Mem:           15Gi       672Mi        14Gi        20Mi       711Mi        14Gi
Swap:            0B          0B          0B
Comment 2 yangyinglu loongson_group 2022-01-11 19:03:49 UTC
已在龙芯内部内核仓库合入修正补丁
Comment 3 Caspar admin 2022-03-24 04:22:03 UTC
fixed as described
Comment 4 shanxifanshi alibaba_cloud_group 2023-07-25 16:28:35 UTC
如上面评论,已在龙芯内部解决,关闭该bug