From: Yonghong Song <yhs@fb.com>
To: Song Liu <songliubraving@fb.com>, <bpf@vger.kernel.org>,
<netdev@vger.kernel.org>, <linux-mm@kvack.org>
Cc: <ast@kernel.org>, <daniel@iogearbox.net>, <kernel-team@fb.com>,
<akpm@linux-foundation.org>
Subject: Re: [PATCH v5 bpf-next 1/4] bpf: introduce task_vma bpf_iter
Date: Mon, 8 Feb 2021 15:12:12 -0800 [thread overview]
Message-ID: <5286e70d-404d-f968-9694-f090eb8fd064@fb.com> (raw)
In-Reply-To: <20210208225255.3089073-2-songliubraving@fb.com>
On 2/8/21 2:52 PM, Song Liu wrote:
> Introduce task_vma bpf_iter to print memory information of a process. It
> can be used to print customized information similar to /proc/<pid>/maps.
>
> Current /proc/<pid>/maps and /proc/<pid>/smaps provide information of
> vma's of a process. However, these information are not flexible enough to
> cover all use cases. For example, if a vma cover mixed 2MB pages and 4kB
> pages (x86_64), there is no easy way to tell which address ranges are
> backed by 2MB pages. task_vma solves the problem by enabling the user to
> generate customize information based on the vma (and vma->vm_mm,
> vma->vm_file, etc.).
>
> To access the vma safely in the BPF program, task_vma iterator holds
> target mmap_lock while calling the BPF program. If the mmap_lock is
> contended, task_vma unlocks mmap_lock between iterations to unblock the
> writer(s). This lock contention avoidance mechanism is similar to the one
> used in show_smaps_rollup().
>
> Signed-off-by: Song Liu <songliubraving@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
next prev parent reply other threads:[~2021-02-08 23:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 22:52 [PATCH v5 bpf-next 0/4] introduce bpf_iter for task_vma Song Liu
2021-02-08 22:52 ` [PATCH v5 bpf-next 1/4] bpf: introduce task_vma bpf_iter Song Liu
2021-02-08 23:12 ` Yonghong Song [this message]
2021-02-09 21:30 ` Alexei Starovoitov
2021-02-09 22:08 ` Song Liu
2021-02-10 3:00 ` Alexei Starovoitov
2021-02-10 8:00 ` Song Liu
2021-02-10 23:02 ` Yonghong Song
2021-02-12 1:41 ` Song Liu
2021-02-08 22:52 ` [PATCH v5 bpf-next 2/4] bpf: allow bpf_d_path in sleepable bpf_iter program Song Liu
2021-02-08 22:52 ` [PATCH v5 bpf-next 3/4] libbpf: introduce section "iter.s/" for " Song Liu
2021-02-08 22:52 ` [PATCH v5 bpf-next 4/4] selftests/bpf: add test for bpf_iter_task_vma Song Liu
2021-02-08 23:12 ` Yonghong Song
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=5286e70d-404d-f968-9694-f090eb8fd064@fb.com \
--to=yhs@fb.com \
--cc=akpm@linux-foundation.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).