Re: Generic Data Structure Iterators

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

 



On Mon, Feb 12, 2024 at 12:48 PM Matt Bobrowski
<mattbobrowski@xxxxxxxxxx> wrote:
>
[...]
>
> Now having said this, I'm wondering whether anyone here has considered
> possibly solving this iterator based problem a little more
> generically? That is, by exposing a set of kfuncs that allow you to
> iterate over a list_head, hlist_head, rbtree, etc, independent of an
> underlying in-kernel type and similar to your *list_for_each*() based
> helpers that you'd typically find for each of these in-kernel generic
> data structures. If so, what were your findings when exploring this
> problem space?

Here are my 2 cents on this:

BPF iterators are designed to be really safe. So it is necessary to handle
locking/refcounting accurately in the helpers. AFAICT, it is hard to do
something universal, like list_for_each(), and still be safe.

If we can accept failures (user space core dump, etc.), we can use
kcore based solutions, such as crash and drgn.

Thanks,
Song





[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