summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-05-14 08:51:37 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-05-15 04:37:32 +0300
commitc70f34a8ac66c2cb05593ef5760142e5f862a9b4 (patch)
tree8c0045ceb528c231cc94e10534e305f9d196cc3c /tools/testing/selftests/bpf
parent0645f7eb6f6af78aba2bdd37ae776bd8754bc8f0 (diff)
downloadlinux-c70f34a8ac66c2cb05593ef5760142e5f862a9b4.tar.xz
bpf: Fix bpf_iter's task iterator logic
task_seq_get_next might stop prematurely if get_pid_task() fails to get task_struct. Failure to do so doesn't mean that there are no more tasks with higher pids. Procfs's iteration algorithm (see next_tgid in fs/proc/base.c) does a retry in such case. After this fix, instead of stopping prematurely after about 300 tasks on my server, bpf_iter program now returns >4000, which sounds much closer to reality. Fixes: eaaacd23910f ("bpf: Add task and task/file iterator targets") Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20200514055137.1564581-1-andriin@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf')
0 files changed, 0 insertions, 0 deletions