eBPF is put in the Linux kernel for unexpected new uses • Registry

Linux plumbers conference The Linux Plumbers Conference in Dublin ends today and some talks have revealed interesting new uses for the eBPF function.

Several different teams have introduced tools that all use a part of the kernel that was originally intended to control packet filtering for completely new and different purposes. Google’s ghOSt allows for fine-tuning of process scheduling, while Red Hat’s HID-BPF will make it easier to accommodate new input devices.

Both are used eBPF It was introduced in kernel 3.18. record I talked about eBPF when Microsoft made its own version for Windows. eBPF gives the kernel an intentionally limited registry-based virtual machine, which allows very small and limited programs to execute within the kernel itself.

It is derived from the 30-year-old Berkeley Packet Filter, which aims to provide flexible tools for filtering data flowing in and out of the Unix kernel. linux extended Application More general, and what’s interesting about these projects is that they don’t relate directly to networking, firewalls, or packet filtering at all.

Google programmer Barrett Rhoden accident Introduced the company’s ghOSt project, which allows modification and control of the scheduling program completely fair to the kernel (CFS) of programs running in user space – outside the kernel itself.

The tool is divided into two parts: ghOSt . kernel And the ghOSt user space. The second link contains an overview of what it does. The accident Online, as with slides [PDF].

Bernard Tessoar from Red Hat inserted HID-BPF, which will allow rapid modifications to human interface devices (HIDs) without modifying the kernel.

Almost anything that allows you to control a computer with a USB device is HID: pointing devices, keyboards, webcams, styluses, etc. USB-HID is a very old standard, dating back to Windows 95, and most devices use generic drivers that are very stable and rarely change.

The problem is when a device needs a disk to one of the generic drivers. Mostly, the changes are very small tweaks, but that still means a custom driver – that means rebuilding the kernel. The HID-BPF will allow minor adjustments, such as reversing the X-axis, or adjusting the scaling factor, to be done quickly. Talking continues Youtube and Tissoires’ Power point [PDF] Explains how it works.

HID-BPF is still being implemented, and developers are currently targeting kernel 6.2; Nucleus revision It was first introduced earlier this year.

The ghOSt facility is somewhat of a niche, although it will likely prove useful for teams building specific Linux-based products. HID-PBF is more generic. It’s not a new type of device driver, so it won’t require a kernel rebuild or even a reboot. Once included, end users will only be able to copy a small file onto their device, which can customize how the input device works. One of the examples given in the hadith allows Microsoft Surface Dial To redefine it, quickly, as a scroll wheel. No software installation or restart is required.

So far, the WebAssembly tool for cross-platform binaries It received much more coverage. ePBF is superficially comparable, given that it’s a new CPU-independent runtime, but it’s much smaller, simpler, and more limited…although it has great potential too, and it’s good to see some of it being realized. ®