Re: [QUESTION] BPF trampoline limits

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

 



On Fri, Mar 31, 2023 at 4:32 AM andrea terzolo <andreaterzolo3@xxxxxxxxx> wrote:
>
> Hello! If I can I would like to ask one question about the BPF
> trampoline. Reading the description of this commit [0] I noticed the
> following statement:
>
> - Detach of a BPF program from the trampoline should not fail. To avoid memory
> allocation in detach path the half of the page is used as a reserve and flipped
> after each attach/detach. 2k bytes is enough to call 40+ BPF programs directly
> which is enough for BPF tracing use cases. This limit can be increased in the
> future.
>
> Looking at the kernel code, I found only this limit
> BPF_MAX_TRAMP_LINKS. If I understood correctly, this limit denies us
> the use of the same trampoline for more than 38 bpf programs. So my
> question is, does the commit description refer to another limit or
> does this "call 40+ BPF programs" refer to the BPF_MAX_TRAMP_LINKS
> macro?

No, it's BPF_MAX_TRAMP_LINKS, which got reduced a bit down from its
40+ limit to current 38.


>
> Thank you in advance for your time,
> Andrea
>
> 0: https://github.com/torvalds/linux/commit/fec56f5890d93fc2ed74166c397dc186b1c25951




[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