Non-Kernel Thread Execution for Network Stack Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional network communication stacks executed in kernel space are inefficient for modern consumer devices with aggressive network demands, as they prioritize kernel tasks over user space applications, leading to suboptimal performance and increased processing overhead, especially in handling bursty network traffic and varying application requirements.

Innovation Solution

Implementing thread-level execution in non-kernel space with dynamic receive mitigation and receive side scaling using consistent hashing, allowing for intelligent context switching and core assignment based on runtime considerations and cross-layer information, enabling efficient distribution of network processing across multiple cores.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If network communication stack is executed in kernel space, then system stability and security are improved, but processing overhead increases and user space application performance deteriorates

Engineering Contradiction:
Improvesystem stabilityVSAvoiduser space application performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the network communication stack into separate kernel space and user space components. The kernel space portion handles essential networking functions with high stability, while the user space portion handles application-specific networking tasks with high performance. This segmentation allows each part to operate independently with optimized characteristics for its specific requirements.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary mechanism (network file descriptor and associated data structures) that enables efficient communication between kernel space network drivers and user space network stacks. This intermediary eliminates the need for frequent context switches and data copying between kernel and user space, thereby reducing processing overhead while maintaining system stability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If kernel space processes prioritize kernel tasks, then system resource management is improved, but network processing speed for user applications deteriorates

Engineering Contradiction:
Improvesystem resource managementVSAvoidnetwork processing speed
Core Design Contradiction:
Ease of operationVSSpeed

Solution Approach 1:

The patent implements dynamic thread-level execution within the user space network stack, allowing the system to adaptively adjust processing priorities based on runtime conditions. Threads can be dynamically created, destroyed, and scheduled based on network traffic patterns and application requirements, enabling the system to optimize network processing speed without compromising overall resource management.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the execution environment parameter from kernel space to user space for the network stack, fundamentally altering the priority and scheduling characteristics. This parameter change allows user space applications to receive equitable CPU scheduling treatment rather than being subordinate to kernel tasks, thereby improving network processing speed while maintaining system resource management through standard operating system mechanisms.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If thread-level execution is implemented in non-kernel space, then processing overhead is reduced and application performance is improved, but system complexity increases

Engineering Contradiction:
Improveapplication performanceVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements a universal user space network stack architecture that can serve multiple applications and network interfaces simultaneously through a single standardized interface. This multi-functional design reduces system complexity by avoiding the need for separate kernel extensions or device drivers for each application, while still enabling optimized thread-level execution for each application's network requirements.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent uses copying of network data structures and buffers between kernel space and user space in a controlled manner, rather than requiring complex shared memory mechanisms. This approach simplifies the system architecture by using well-understood copying semantics while still achieving the performance benefits of user space execution through efficient memory management and reduced context switching.

Inventive Principle:
Principle #26Copying

4Ease of manufacture

If receive mitigation is performed via external function call, then code modularity is improved, but execution speed deteriorates

Engineering Contradiction:
Improvecode modularityVSAvoidexecution speed
Core Design Contradiction:
Ease of manufactureVSSpeed

Solution Approach 1:

The patent implements dynamic receive mitigation that can switch between external function call mode and inline execution mode based on runtime conditions. When network traffic patterns and system state favor modularity, external function calls are used. When execution speed becomes critical, the system dynamically inlines the receive mitigation logic, eliminating function call overhead while maintaining the same modular code structure.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS11799986B2Methods and apparatus for thread level execution in non-kernel space
Publication Date: 2023.10.24 APPLE INC
  • US11799986B2 patent drawing
  • US11799986B2 patent drawing
  • US11799986B2 patent drawing

AI summary

Methods and apparatus for thread-level execution in non-kernel space. Most modern consumer usage scenarios are focused on user experience for only a few network connections; in many such cases, background network applications and/or stale network connections could be de-prioritized and/or even terminated without adverse effect. The exemplary “polylithic” non-kernel space networking architecture concurrently runs multiple instances of a network stack in non-kernel space. Thread execution for each instance can be individually managed by the operating system (OS). Disclosed embodiments dynamically determine receive (RX) mitigation and/or receive side scaling with consistent hashing.