Re: [PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Andrii Nakryiko
On Wed, May 13, 2020 at 3:42 PM Alexei Starovoitov wrote: > > On Wed, May 13, 2020 at 2:23 PM Andrii Nakryiko wrote: > > > > 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. Pr

Re: [PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Alexei Starovoitov
On Wed, May 13, 2020 at 2:23 PM Andrii Nakryiko wrote: > > 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 r

Re: [PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Yonghong Song
On 5/13/20 2:20 PM, Andrii Nakryiko wrote: 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.

[PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Andrii Nakryiko
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