User-Space Memory Swapping for Application-Specific Storage
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The memory swapping mechanism of an operating system's kernel fails to meet the diversified requirements of different applications, as it typically uses a universal storage device, which cannot accommodate the varied needs of diverse applications.
Innovation Solution
Implementing a user-mode memory swapping framework by disposing user interfaces for different applications in user space, allowing these interfaces to correspond to specific storage devices, thereby enabling customized memory swapping operations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Stability of the object's composition
If a universal fixed storage device is used for kernel memory swapping, then system stability is improved, but adaptability to diversified application requirements deteriorates
Solution Approach 1:
The patent segments the memory swapping function by introducing a user-space paging component (CO-PAGER) that operates independently from the kernel. This allows different applications to have dedicated paging threads and storage device assignments, while the kernel maintains its stable, universal swapping mechanism. The segmentation enables both kernel-level stability and application-level adaptability to coexist.
Solution Approach 2:
The CO-PAGER component acts as an intermediary between applications and the kernel's memory management system. It receives paging requests from applications, manages the actual swapping operations with storage devices, and communicates with the kernel through minimal interface calls. This intermediary layer provides adaptability to diverse applications without compromising kernel stability.
2Adaptability or versatility
If a user-space paging component is introduced, then adaptability to application requirements is improved, but system complexity increases
Solution Approach 1:
The patent extracts the paging management functionality from the kernel and places it in user space as a separate CO-PAGER component. This extraction reduces kernel complexity while providing the needed adaptability. The user-space component handles all application-specific paging logic, leaving the kernel with only essential, simplified memory management functions.
Solution Approach 2:
Each application is assigned its own dedicated paging thread in user space that autonomously manages its own memory paging operations. The paging component detects page faults, selects storage devices, and performs swapping without requiring complex kernel intervention. This self-service approach simplifies the overall system architecture by distributing management responsibilities.
3Productivity
If dedicated storage devices are assigned to different applications, then application performance is improved, but device resource utilization deteriorates
Solution Approach 1:
The patent implements dynamic storage device assignment where the mapping between applications and storage devices can change over time. The user-space paging component can dynamically select which storage device to use based on current system conditions, application needs, and device availability. This dynamic approach allows dedicated performance when needed while enabling resource sharing when appropriate.
Solution Approach 2:
Storage devices are designed to serve multiple applications simultaneously through the user-space paging component's arbitration. While each application has preferred or dedicated storage devices for optimal performance, the system allows multiple applications to share storage resources when performance requirements permit, thereby improving overall device utilization while maintaining application performance.
Data Source
Figure 1~2
Figure 3
Figure 4a
AI summary
A data swapping method and apparatus are provided, and relate to the field of storage technologies, to resolve a problem that a memory swapping mechanism of a kernel of an operating system cannot meet diversified requirements of different applications. The data swapping method is applied to a host. An operating system and a target application are installed on the host. The operating system includes user space. A user interface of the target application is disposed in the user space. The user interface corresponds to one storage device. A specific solution includes: The host obtains a swap request of the target application, and calls, based on the swap request, the user interface to perform an operation on the storage device. The swap request is a swap-in request or a swap-out request. The swap-out request is used to request to write data of the target application from a memory of the host to the storage device. The swap-in request is used to request to write data in the storage device to the memory.