Facebook Engineer Improving BPF "User Programs" Support

Written by Michael Larabel in Linux Kernel on 2 August 2020 at 01:25 PM EDT. Add A Comment
LINUX KERNEL
Facebook engineer Song Liu has sent out a set of patches for "BPF_PROG_TYPE_USER" as a new BPF type for the Linux kernel focused on better supporting user programs.

Given the success of the eBPF in-kernel virtual machine and new use-cases continuing to be worked on it outside of the traditional networking scope, Facebook has been working on BPF_PROG_TYPE_USER for better handling of user-space programs within the realm of BPF. (e)BPF has numerous program types for areas of networking and other areas while this new type is for better handling of user programs.

The intention is for this new user program type to replace some existing programs that rely upon creating a uprobe to a special function for triggering of such user-space programs. But by relying upon uprobe there is additional overhead and other extra complexities.

As part of the self-tests for the proposed BPF user program type is a simple benchmark compared to the uprobe approach that takes 1400 nanoseconds while now with the new type runs in just 300 nanoseconds. In addition to BPF_PROG_TYPE_USER having lower overhead and thus better performance, BPF user-space programs under this new approach can specify on which CPU to run the user-space program as well as passing arguments to the user program. Better support for arguments to these user-space programs and being able to select what CPU the program is run on should help in opening up even more possibilities for eBPF.

More details on the work via this patch series.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week