From: David Marchevsky <david.marchevsky@linux.dev>
To: Dave Marchevsky <davemarchevsky@fb.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@kernel.org>,
Kernel Team <kernel-team@fb.com>,
yonghong.song@linux.dev, sdf@google.com,
Nathan Slingerland <slinger@meta.com>
Subject: Re: [PATCH v2 bpf-next 2/3] bpf: Introduce task_vma open-coded iterator kfuncs
Date: Mon, 21 Aug 2023 16:32:45 -0400 [thread overview]
Message-ID: <62c0e98e-6a91-ba19-e36f-dbfc122693d4@linux.dev> (raw)
In-Reply-To: <20230821173415.1970776-3-davemarchevsky@fb.com>
On 8/21/23 1:34 PM, Dave Marchevsky wrote:
> This patch adds kfuncs bpf_iter_task_vma_{new,next,destroy} which allow
> creation and manipulation of struct bpf_iter_task_vma in open-coded
> iterator style. BPF programs can use these kfuncs directly or through
> bpf_for_each macro for natural-looking iteration of all task vmas.
>
> The implementation borrows heavily from bpf_find_vma helper's locking -
> differing only in that it holds the mmap_read lock for all iterations
> while the helper only executes its provided callback on a maximum of 1
> vma. Aside from locking, struct vma_iterator and vma_next do all the
> heavy lifting.
>
> The newly-added struct bpf_iter_task_vma has a name collision with a
> selftest for the seq_file task_vma iter's bpf skel, so the selftests/bpf/progs
> file is renamed in order to avoid the collision.
>
> Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
> Cc: Nathan Slingerland <slinger@meta.com>
> ---
> include/uapi/linux/bpf.h | 4 +
> kernel/bpf/helpers.c | 3 +
> kernel/bpf/task_iter.c | 79 +++++++++++++++++++
> tools/include/uapi/linux/bpf.h | 5 ++
I forgot to update the tools bpf.h to match
new changes in this respin.
will send v3 shortly doing so
next prev parent reply other threads:[~2023-08-21 20:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 17:34 [PATCH v2 bpf-next 0/3] Open-coded task_vma iter Dave Marchevsky
2023-08-21 17:34 ` [PATCH v2 bpf-next 1/3] bpf: Don't explicitly emit BTF for struct btf_iter_num Dave Marchevsky
2023-08-22 1:21 ` Yonghong Song
2023-08-21 17:34 ` [PATCH v2 bpf-next 2/3] bpf: Introduce task_vma open-coded iterator kfuncs Dave Marchevsky
2023-08-21 20:32 ` David Marchevsky [this message]
2023-08-21 22:24 ` Alexei Starovoitov
2023-08-21 17:34 ` [PATCH v2 bpf-next 3/3] selftests/bpf: Add tests for open-coded task_vma iter Dave Marchevsky
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=62c0e98e-6a91-ba19-e36f-dbfc122693d4@linux.dev \
--to=david.marchevsky@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davemarchevsky@fb.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
--cc=sdf@google.com \
--cc=slinger@meta.com \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox