mlock203 test in ubuntu_ltp_syscalls failed with Xenial kernel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Po-Hsu Lin |
Bug Description
== Justification ==
When one vma was with flag VM_LOCKED|
mlock2(
VM_LOCKED flag only.
There is a hole in mlock_fixup() which increase mm->locked_vm twice even
the two operations are on the same vma and both with VM_LOCKED flags.
The issue can be reproduced by following code:
mlock2(p, 1024 * 64, MLOCK_ONFAULT); //VM_LOCKED|
mlock(p, 1024 * 64); //VM_LOCKED
Then check the increase VmLck field in /proc/pid/status(to 128k).
When vma is set with different vm_flags, and the new vm_flags is with
VM_LOCKED, it is not necessarily be a "new locked" vma.
There is a dedicated reproducer, the "mlock203" test in ubuntu_
<<<test_start>>>
tag=mlock203 stime=1537369891
cmdline="mlock203"
contacts=""
analysis=exit
<<<test_output>>>
tst_test.c:1063: INFO: Timeout per run is 0h 05m 00s
mlock203.c:63: FAIL: Locking one memory again increased VmLck
Summary:
passed 0
failed 1
skipped 0
warnings 0
== Fix ==
b155b4fd (mm: mlock: avoid increase mm->locked_vm on mlock() when already mlock2(
A test kernel for Xenial / Xenial-KVM could be found here:
http://
== Regression Potential ==
Low, this patch prevents mm->locked_vm from increment just by adding an extra check to see if the old vm_flags is already VM_LOCKED.
== Test Case ==
Run the mlock203 test in ubuntu_ltp_syscalls test suite. And it will pass with the patched kernel.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.4.0-1068-aws x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
Date: Thu Sep 20 06:44:13 2018
Ec2AMI: ami-0e32ec5bc22
Ec2AMIManifest: (unknown)
Ec2Availability
Ec2InstanceType: c3.large
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
SourcePackage: linux-aws
UpgradeStatus: No upgrade log present (probably fresh install)
summary: |
- mlock203 test in ubuntu_ltp_syscalls failed with X-AWS + mlock203 test in ubuntu_ltp_syscalls failed with Xenial kernel |
Changed in ubuntu-kernel-tests: | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
status: | New → In Progress |
Changed in linux (Ubuntu): | |
status: | Incomplete → In Progress |
no longer affects: | ubuntu-kernel-tests |
Changed in ubuntu-kernel-tests: | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
status: | New → In Progress |
Changed in linux (Ubuntu): | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
description: | updated |
description: | updated |
Changed in linux (Ubuntu Xenial): | |
status: | New → Fix Committed |
Changed in linux (Ubuntu Xenial): | |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
Changed in linux (Ubuntu): | |
assignee: | Po-Hsu Lin (cypressyew) → nobody |
Changed in ubuntu-kernel-tests: | |
status: | In Progress → Fix Released |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Released |
I can reproduce this in 4.4.0-1067-aws, so this is not a regression.