BPF Map Manipulations via Uprobe Triggered Kernel Probes

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing Berkeley Packet Filter (BPF) map operations in computing environments face significant time delays due to the need for multiple system calls when performing batch processing, which reduces efficiency and increases the number of transitions between user and kernel spaces.

Innovation Solution

A method involving a user program with a trigger function that triggers a kernel BPF probe, allowing a BPF map agent to perform operations in the kernel space with reduced transitions, using operation parameters to manipulate BPF maps efficiently, such as reading or writing data with a single transition from user to kernel space.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional iterative system calls are used for BPF map operations, then the operations can be performed with simple interface, but the time delay is significant and throughput is low

Engineering Contradiction:
Improvethroughput of BPF map operationsVSAvoidtime delay for batch processing
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent merges multiple BPF map operations into a single kernel space execution context. By installing a kernel BPF probe on a trigger function and passing batch operation parameters through function arguments, multiple map manipulations are combined into one transition from user to kernel space, eliminating the need for repeated system calls and significantly reducing time delay while improving throughput.

Inventive Principle:
Principle #5Merging (Combining)

2Ease of operation

If multiple system calls are used for batch processing of BPF maps, then each operation can be performed individually, but the number of transitions between user and kernel spaces increases

Engineering Contradiction:
Improvesimplicity of individual operationsVSAvoidnumber of transitions between user and kernel spaces
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent introduces a trigger function as an intermediary mechanism. This function serves as a bridge between user space and kernel space, allowing batch operation parameters to be passed through function arguments rather than requiring multiple system calls. The kernel BPF probe intercepts this single function call and processes all operations within the kernel space, reducing transition complexity while maintaining operational simplicity.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If native system calls are used for reading and writing BPF maps, then data transfer between user and kernel space is enabled, but the time delay for batch operations is significant

Engineering Contradiction:
Improvedata transfer capabilityVSAvoidspeed of batch map operations
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies preliminary action by preparing all operation parameters in user space before the single transition to kernel space. The trigger function collects and structures all necessary operation data (read/write/clear operations on multiple map locations) into function arguments ahead of time. When the kernel BPF probe is triggered, it processes the pre-prepared batch operations without requiring additional transitions, thereby maintaining reliable data transfer capability while significantly improving the speed of batch operations.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11928529B2High-throughput BPF map manipulations with uprobes
Publication Date: 2024.03.12 NEW RELIC INC
  • US11928529B2 patent drawing
  • US11928529B2 patent drawing
  • US11928529B2 patent drawing

AI summary

High-throughput BPF map manipulations with uprobes are disclosed. A method for manipulating a Berkeley Packet Filter (BPF) map comprises running a user program in a user space of a computing environment. The user program includes a trigger function. A corresponding kernel BPF probe is installed by the user program on the trigger function. The kernel BPF probe is triggered by reaching a memory address of the trigger function in the user space. The trigger function includes one or more arguments that the BPF map agent interprets as operation parameters. The BPF map agent performs one or more operations to manipulate a BPF map in the kernel space based on the operation parameters.