Re: [PATCH v2 bpf-next 0/3] libbpf: support non-mmap()'able data sections

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

 



On Wed, Oct 19, 2022 at 05:58:13AM IST, Andrii Nakryiko wrote:
> Make libbpf more conservative in using BPF_F_MMAPABLE flag with internal BPF
> array maps that are backing global data sections. See patch #2 for full
> description and justification.
>
> Changes in this dataset support having bpf_spinlock, kptr, rb_tree nodes and
> other "special" variables as global variables. Combining this with libbpf's
> existing support for multiple custom .data.* sections allows BPF programs to
> utilize multiple spinlock/rbtree_node/kptr variables in a pretty natural way
> by just putting all such variables into separate data sections (and thus ARRAY
> maps).
>
> v1->v2:
>   - address Stanislav's feedback, adds acks.
>

Thanks a lot for working on this!

Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>

I like that __hidden also works for static variables, that allows hiding this
whole thing in a macro, like so:

#define private(name) SEC(".data." #name) __hidden

private(A) struct bpf_spin_lock lock;
private(A) struct bpf_list_head head __contains(foo, node);



[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