bpf: adding BPF linked list iteration support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Currently, we have BPF kfuncs which allow BPF programs to add and
remove elements from a BPF linked list. However, we're currently
missing other simple capabilities, like being able to iterate over the
elements within the BPF linked lists. What is our current appetite
with regards to adding new BPF kfuncs that support this kind of
capability to BPF linked lists?

I know that we're now somewhat advocating for using BPF arenas
whenever and wherever possible, especially when it comes to building
out and supporting more complicated data structures in BPF. However,
IMO BPF linked lists still have their place. Specifically, and as of
now, I'd argue that the BPF linked list implementation could be
considered more memory efficient when compared to a BPF arena backed
linked list implementation. This is purely due to the fact that the
BPF linked list implementation can perform more constrained memory
allocations for elements via bpf_obj_new_impl() based on the demand,
whereas for a BPF arena based implementation a BPF program needs to
allocate memory upfront in terms of the number of pages (modulo the
fact that not all pages for the BPF arena will necessarily be reserved
upfront). The fact that allocations are performed in terms of
multiples of PAGE_SIZE can lead to unnecessary memory wastage.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux