User Space OOM Service Decoupling Kernel Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The execution of out of memory (OOM) processes in a kernel state is complex and time-consuming, leading to system deadlocks and reduced stability under high load conditions, making it difficult to manage resource utilization and implement effective OOM processing strategies.
Innovation Solution
The method involves writing OOM event information into a shared memory page between the user space and kernel space, allowing the user space to process and manage OOM events, including switching processes to a sleep state, scoring terminatable processes, and reattempting memory allocation, thereby reducing complexity and improving service stability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If OOM processing is executed in kernel space, then system memory pressure is reduced, but system stability deteriorates due to prolonged kernel state processing causing deadlocks
Solution Approach 1:
The patent extracts the OOM processing logic from the kernel space and relocates it to user space. When OOM occurs, the kernel only writes event information to a shared memory page and notifies the user space OOM service process, which then handles the actual processing. This separation removes the time-consuming processing from the kernel path, preventing system deadlocks while maintaining memory pressure relief functionality.
2Reliability
If OOM processing logic is implemented in kernel space, then OOM events are handled, but service upgrade and deployment difficulty increases
Solution Approach 1:
By extracting OOM processing from the kernel to user space, the patent makes the processing logic independent of the kernel. The OOM service process runs as a user space application that can be independently developed, deployed, and upgraded without requiring kernel modifications or reboots, thereby significantly improving service upgrade and deployment ease.
Solution Approach 2:
The patent implements dynamic OOM processing strategies in user space, allowing the OOM service process to adaptively adjust processing behaviors based on system state and configured policies. This dynamic capability enables flexible strategy changes without fixed kernel constraints, facilitating easier service evolution and deployment.
3Quantity of substance
If OOM processing is performed in kernel space, then memory pressure is relieved, but processing complexity increases
Solution Approach 1:
The patent extracts the complex OOM processing logic from the kernel and places it in user space, where it can be implemented with full flexibility. The kernel's role is simplified to only triggering the event and sharing memory, while the complex decision-making and process management occur in user space, reducing overall system complexity.
Data Source
AI summary
The present application discloses a method and apparatus of unloading an out of memory (OOM) processing flow to a user space. A specific implementation of the method includes: writing related information of an OOM event into a memory page shared by a user space and a kernel space when a process triggers the OOM event, the related information comprising: an identification of the process and a path of a memory resource control sub-system where the process exists; acquiring, by an OOM service process of the user space, the related information of the OOM event through the memory page; and processing, by the OOM service process of the user space, the OOM event using the related information of the OOM event. The implementation implements unloading of an OOM processing in a kernel state to a user state for execution, and the whole OOM processing process is handed over to a user state process for implementation, which reduces the complexity of execution of the OOM processing, and is conducive to adjustment of OOM processing strategies and upgrade and replacement of services.


