-
Notifications
You must be signed in to change notification settings - Fork 130
Replace CONFIG_DMABUF_SYSFS_STATS with BPF #8942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Upstream branch: 075001c |
Upstream branch: 075001c |
a3651f4
to
6f2c15b
Compare
cd6f190
to
9d014db
Compare
Upstream branch: 075001c |
6f2c15b
to
abfbbe1
Compare
Upstream branch: 075001c |
abfbbe1
to
c8dd55f
Compare
9d014db
to
f5f3988
Compare
Upstream branch: 075001c |
c8dd55f
to
9eff81c
Compare
f5f3988
to
102d348
Compare
Rename the debugfs list and mutex so it's clear they are now usable without the need for CONFIG_DEBUG_FS. The list will always be populated to support the creation of a BPF iterator for dmabufs. Signed-off-by: T.J. Mercier <[email protected]> Reviewed-by: Christian König <[email protected]> Acked-by: Song Liu <[email protected]>
The dmabuf iterator traverses the list of all DMA buffers. DMA buffers are refcounted through their associated struct file. A reference is taken on each buffer as the list is iterated to ensure each buffer persists for the duration of the bpf program execution without holding the list mutex. Signed-off-by: T.J. Mercier <[email protected]> Reviewed-by: Christian König <[email protected]> Acked-by: Song Liu <[email protected]>
This open coded iterator allows for more flexibility when creating BPF programs. It can support output in formats other than text. With an open coded iterator, a single BPF program can traverse multiple kernel data structures (now including dmabufs), allowing for more efficient analysis of kernel data compared to multiple reads from procfs, sysfs, or multiple traditional BPF iterator invocations. Signed-off-by: T.J. Mercier <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Song Liu <[email protected]>
This test creates a udmabuf, and a dmabuf from the system dmabuf heap, and uses a BPF program that prints dmabuf metadata with the new dmabuf_iter to verify they can be found. Signed-off-by: T.J. Mercier <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Song Liu <[email protected]>
Use the same test buffers as the traditional iterator and a new BPF map to verify the test buffers can be found with the open coded dmabuf iterator. Signed-off-by: T.J. Mercier <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Song Liu <[email protected]>
Upstream branch: 075001c |
9eff81c
to
d02e73b
Compare
Pull request for series with
subject: Replace CONFIG_DMABUF_SYSFS_STATS with BPF
version: 5
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=962140