All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Jonathan Lemon <jonathan.lemon@gmail.com>
Cc: Networking <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Yonghong Song <yhs@fb.com>, bpf <bpf@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH 2/3 v4 bpf-next] bpf: Use thread_group_leader()
Date: Fri, 18 Dec 2020 13:02:09 -0800	[thread overview]
Message-ID: <CAEf4BzY8ePP7PoOpeU1uS1AFicGzY-w28KM2DMhjPqz4Tuh7bA@mail.gmail.com> (raw)
In-Reply-To: <20201218185032.2464558-3-jonathan.lemon@gmail.com>

On Fri, Dec 18, 2020 at 12:47 PM Jonathan Lemon
<jonathan.lemon@gmail.com> wrote:
>
> From: Jonathan Lemon <bsd@fb.com>
>
> Instead of directly comparing task->tgid and task->pid, use the
> thread_group_leader() helper.  This helps with readability, and
> there should be no functional change.
>
> Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
> ---

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>  kernel/bpf/task_iter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
> index 8033ab19138a..dc4007f1843b 100644
> --- a/kernel/bpf/task_iter.c
> +++ b/kernel/bpf/task_iter.c
> @@ -37,7 +37,7 @@ static struct task_struct *task_seq_get_next(struct pid_namespace *ns,
>                 if (!task) {
>                         ++*tid;
>                         goto retry;
> -               } else if (skip_if_dup_files && task->tgid != task->pid &&
> +               } else if (skip_if_dup_files && !thread_group_leader(task) &&
>                            task->files == task->group_leader->files) {
>                         put_task_struct(task);
>                         task = NULL;
> --
> 2.24.1
>

  reply	other threads:[~2020-12-18 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 18:50 [PATCH 0/3 v4 bpf-next] bpf: increment and use correct thread iterator Jonathan Lemon
2020-12-18 18:50 ` [PATCH 1/3 v4 bpf-next] bpf: save correct stopping point in file seq iteration Jonathan Lemon
2020-12-18 21:01   ` Andrii Nakryiko
2020-12-24  1:08     ` Daniel Borkmann
2020-12-18 18:50 ` [PATCH 2/3 v4 bpf-next] bpf: Use thread_group_leader() Jonathan Lemon
2020-12-18 21:02   ` Andrii Nakryiko [this message]
2020-12-18 18:50 ` [PATCH 3/3 v4 bpf-next] bpf: optimize task iteration Jonathan Lemon
2020-12-18 21:03   ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzY8ePP7PoOpeU1uS1AFicGzY-w28KM2DMhjPqz4Tuh7bA@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.