kernel-fxtec-pro1x/tools/testing/selftests
Michal Hocko 01522e4d4a selftests: vm: drop dependencies on page flags from mlock2 tests
commit eea274d64e6ea8aff2224d33d0851133a84cc7b5 upstream.

It was noticed that mlock2 tests are failing after 9c4e6b1a70 ("mm,
mlock, vmscan: no more skipping pagevecs") because the patch has changed
the timing on when the page is added to the unevictable LRU list and thus
gains the unevictable page flag.

The test was just too dependent on the implementation details which were
true at the time when it was introduced.  Page flags and the timing when
they are set is something no userspace should ever depend on.  The test
should be testing only for the user observable contract of the tested
syscalls.  Those are defined pretty well for the mlock and there are other
means for testing them.  In fact this is already done and testing for page
flags can be safely dropped to achieve the aimed purpose.  Present bits
can be checked by /proc/<pid>/smaps RSS field and the locking state by
VmFlags although I would argue that Locked: field would be more
appropriate.

Drop all the page flag machinery and considerably simplify the test.  This
should be more robust for future kernel changes while checking the
promised contract is still valid.

Fixes: 9c4e6b1a70 ("mm, mlock, vmscan: no more skipping pagevecs")
Reported-by: Rafael Aquini <aquini@redhat.com>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Rafael Aquini <aquini@redhat.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Eric B Munson <emunson@akamai.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20200324154218.GS19542@dhcp22.suse.cz
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:48:51 +02:00
..
android selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
bpf selftests: bpf: Reset global state between reuseport test runs 2020-02-24 08:34:51 +01:00
breakpoints
capabilities
cgroup cgroup: kselftest: relax fs_spec checks 2019-08-06 19:06:55 +02:00
cpu-hotplug selftests: cpu-hotplug: fix case where CPUs offline > CPUs present 2019-03-13 14:02:28 -07:00
cpufreq
drivers selftests: usbip: add wait after attach and before checking port status 2018-10-09 16:13:42 +02:00
efivarfs selftests/efivarfs: add required kernel configs 2018-09-05 10:58:07 -06:00
exec
filesystems
firmware selftests: firmware: Fix it to do root uid check and skip 2020-01-17 19:47:14 +01:00
ftrace selftests/ftrace: Fix multiple kprobe testcase 2020-01-12 12:17:10 +01:00
futex selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
gpio selftests: gpio-mockup-chardev: Check asprintf() for error 2019-03-05 17:58:48 +01:00
ia64
intel_pstate
ipc selftests/ipc: Fix msgque compiler warnings 2020-01-27 14:50:40 +01:00
kcmp
kmod
kvm selftests: kvm: fix build with glibc >= 2.30 2019-12-13 08:51:05 +01:00
lib
locking
media_tests
membarrier
memfd
memory-hotplug selftests: memory-hotplug: add required configs 2018-09-05 10:58:31 -06:00
mount selftests: mount: remove no longer needed config option 2018-08-09 11:26:07 -06:00
mqueue
net selftests/net/fib_tests: update addr_metric_test for peer route testing 2020-03-18 07:14:17 +01:00
netfilter selftests: netfilter: missing error check when setting up veth interface 2019-06-22 08:15:15 +02:00
networking/timestamping selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
nsfs
ntb
powerpc selftests/powerpc: Skip test instead of failing 2019-12-13 08:51:45 +01:00
prctl
proc selftests: fix warning: "_GNU_SOURCE" redefined 2019-12-01 09:17:00 +01:00
pstore selftests: pstore: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
ptp
ptrace
rcutorture rcutorture: Change units of onoff_interval to jiffies 2018-07-12 15:42:01 -07:00
rseq rseq/selftests: Turn off timeout setting 2020-01-17 19:47:15 +01:00
rtc selftests: rtc: rtctest: add alarm test on minute boundary 2019-03-05 17:58:47 +01:00
seccomp selftests: skip seccomp get_metadata test if not real root 2019-04-05 22:33:07 +02:00
sigaltstack
size kselftest: Minimise dependency of get_size on C library interfaces 2020-02-24 08:34:37 +01:00
sparc64 selftests: sparc64: Add missing SPDX License Identifiers 2018-06-18 09:29:20 -06:00
splice
static_keys selftests: static_keys: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
sync selftests: sync: add config fragment for testing sync framework 2018-06-18 09:11:10 -06:00
sysctl selftests: sysctl: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
tc-testing tc-testing: fix build of eBPF programs 2019-11-24 08:20:29 +01:00
timers selftests/timers: Add missing fflush(stdout) calls 2019-06-19 08:18:04 +02:00
uevent
user selftests: user: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
vDSO selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run 2018-07-11 10:14:26 -06:00
vm selftests: vm: drop dependencies on page flags from mlock2 tests 2020-04-17 10:48:51 +02:00
watchdog selftests: watchdog: Fix error message. 2019-12-01 09:16:59 +01:00
x86 selftests/x86/ptrace_syscall_32: Fix no-vDSO segfault 2020-04-17 10:48:40 +02:00
zram selftests: zram: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
.gitignore
gen_kselftest_tar.sh
kselftest.h selftests: kselftest: Remove outdated comment 2018-08-27 14:07:46 -06:00
kselftest_harness.h selftests: do not macro-expand failed assertion expressions 2019-01-26 09:32:38 +01:00
kselftest_install.sh
lib.mk selftests: fix too long argument 2020-03-11 14:14:48 +01:00
Makefile selftests: add script to stress-test nft packet path vs. control plane 2018-12-17 09:24:31 +01:00