User Command Daemon Preserving Locked Memory Pages
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In multithreaded operating systems, context switching between threads can cause delays and page faults, especially when a real-time application is executed in user mode, as existing systems may unlock memory pages during system calls, leading to re-loading of memory pages and performance issues.
Innovation Solution
A user command daemon is introduced to execute system commands while maintaining memory pages in a locked state, using a socket interface to route signals and return values without causing latencies, ensuring that memory pages remain locked during command processing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If system calls are executed in user mode, then application functionality is maintained, but memory pages may be unlocked causing page faults and delays
Solution Approach 1:
A kernel thread is introduced as an intermediary to execute system calls on behalf of user-mode threads. The user thread makes a system call request, which is handled by the kernel thread that runs in kernel mode, thereby preventing memory pages from being unlocked while maintaining application functionality.
Solution Approach 2:
The system separates the execution environment into user mode for application logic and kernel mode for system call execution. By segmenting the execution contexts, the patent allows user-mode threads to maintain locked memory pages while kernel-mode threads handle system calls that require unlocked pages.
2Productivity
If memory pages are locked in main memory, then real-time application performance is improved, but system call execution may be affected
Solution Approach 1:
The kernel thread acts as a mediator that enables system call execution without requiring the user thread to unlock its memory pages. The kernel thread temporarily assumes control in kernel mode, executes the system call, and returns results, thus preserving the locked state of user memory pages.
Solution Approach 2:
The patent adds a temporal dimension to system call execution by using asynchronous communication between user threads and kernel threads. System calls are executed in a different execution context (kernel mode) at different times, allowing memory pages to remain locked while system calls are still executed.
3Productivity
If context switching occurs between threads, then multitasking is achieved, but delays and page faults occur in real-time applications
Solution Approach 1:
The patent segments thread execution into user-mode execution (where memory pages remain locked) and kernel-mode system call execution. This segmentation allows real-time application threads to maintain locked memory pages while still enabling multitasking through kernel-managed context switches.
Solution Approach 2:
The kernel thread serves as an intermediary that handles system call execution during context switches. When a real-time application thread needs to make a system call, the kernel thread executes it in kernel mode, preventing the real-time thread from being forced to unlock its memory pages during context switching.
Data Source
AI summary
A method, apparatus and program storage device for preserving locked pages in memory when in user mode. A user command daemon is provided for executing a command string received from a user application. A socket interface is disposed between the user command daemon and the application for routing signals between the user application and the user command daemon. The user command daemon provides a returned value to application for loading into memory without causing latencies to the running of the application.


