linux/tools/testing/selftests
Martin KaFai Lau 3fbfadce60 bpf: Fix test_lru_sanity5() in test_lru_map.c
test_lru_sanity5() fails when the number of online cpus
is fewer than the number of possible cpus.  It can be
reproduced with qemu by using cmd args "--smp cpus=2,maxcpus=8".

The problem is the loop in test_lru_sanity5() is testing
'i' which is incorrect.

This patch:
1. Make sched_next_online() always return -1 if it cannot
   find a next cpu to schedule the process.
2. In test_lru_sanity5(), the parent process does
   sched_setaffinity() first (through sched_next_online())
   and the forked process will inherit it according to
   the 'man sched_setaffinity'.

Fixes: 5db58faf98 ("bpf: Add tests for the LRU bpf_htab")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-17 15:39:39 -05:00
..
bpf bpf: Fix test_lru_sanity5() in test_lru_map.c 2017-01-17 15:39:39 -05:00
breakpoints selftests: arm64: add test for unaligned/inexact watchpoint handling 2016-11-18 17:26:15 +00:00
capabilities
cpu-hotplug
drivers/gpu kselftests: Exercise hw-independent mock tests for i915.ko 2016-12-08 09:34:13 -07:00
efivarfs
exec selftests/exec: Makefile is a run-time dependency, add it to the install list 2016-06-15 13:35:55 -06:00
filesystems selftests: move dnotify_test from Documentation/filesystems 2016-09-20 09:09:00 -06:00
firmware
ftrace selftests: ftrace: Shift down default message verbosity 2016-12-13 11:28:10 -05:00
futex docs: fix locations of several documents that got moved 2016-10-24 08:12:35 -02:00
gpio selftest/gpio: add gpio test case 2016-12-13 07:26:37 -07:00
ia64 selftests: move ia64 tests from Documentation/ia64 2016-09-20 09:58:12 -06:00
intel_pstate tools: testing: define the _GNU_SOURCE macro 2016-05-16 09:06:17 -06:00
ipc
kcmp
lib selftests/lib: set printf.sh executable 2016-06-27 13:17:14 -06:00
media_tests selftests: media_tests add a new video device test 2016-07-26 09:59:30 -06:00
membarrier
memfd
memory-hotplug
mount
mqueue
net selftests: do not require bash to run netsocktests testcase 2017-01-05 13:19:53 -07:00
networking/timestamping selftests: Move networking/timestamping from Documentation 2016-09-20 09:59:50 -06:00
nsfs selftests: add missing gitignore files/dirs 2016-12-08 08:51:32 -07:00
ntb ntb_test: Add a selftest script for the NTB subsystem 2016-08-05 10:21:08 -04:00
powerpc selftests/powerpc: Add ptrace tests for TM SPR registers 2016-11-17 17:11:52 +11:00
prctl selftests: move prctl tests from Documentation/prctl 2016-09-20 09:09:09 -06:00
pstore
ptp selftests: move ptp tests from Documentation/ptp 2016-09-20 09:54:38 -06:00
ptrace
rcutorture torture: Prevent jitter from delaying build-only runs 2016-11-14 10:48:59 -08:00
seccomp seccomp: add tests for ptrace hole 2016-06-14 10:54:38 -07:00
sigaltstack selftests: add missing gitignore files/dirs 2016-12-08 08:51:32 -07:00
size
static_keys
sync selftest: sync: improve assert() failure message 2016-12-13 07:24:34 -07:00
sysctl
timers linux-kselftest-4.10-rc1-update 2016-12-15 14:17:32 -08:00
user
vDSO selftests: move vDSO tests from Documentation/vDSO 2016-09-20 09:58:04 -06:00
vm selftests: expanding more mlock selftest 2016-10-07 18:46:28 -07:00
watchdog selftests: move watchdog tests from Documentation/watchdog 2016-09-20 09:58:34 -06:00
x86 selftests: x86/pkeys: fix spelling mistake: "itertation" -> "iteration" 2017-01-05 13:24:18 -07:00
zram selftests/zram: replace ZRAM_LZ4_COMPRESS 2016-09-20 09:00:01 -06:00
.gitignore selftests: add missing gitignore files/dirs 2016-12-08 08:51:32 -07:00
gen_kselftest_tar.sh
kselftest_install.sh
kselftest.h
lib.mk
Makefile selftests: do not require bash for the generated test 2017-01-05 13:18:32 -07:00