Processor Preemption Control for Lock Contention
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In computer systems, lock contention between processes accessing shared resources can lead to prolonged waiting times and performance degradation, especially in heterogeneous multi-core processor environments, due to delayed lock release by the lock owning process, potentially causing fatal system faults.
Innovation Solution
A method and system that control the lock release time point by deactivating preemption for the processor based on the priority of waiting processes, ensuring the lock owning process completes its execution before releasing the lock, thereby preventing blockage by higher-priority processes and optimizing system performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If preemption is enabled for the processor, then higher-priority processes can be executed promptly, but the lock owning process may be blocked by other processes causing delayed lock release
Solution Approach 1:
The system dynamically adjusts the preemption state of the processor based on whether a process holds a lock. When a lock is acquired, preemption is deactivated to ensure the lock owning process completes without being blocked. When no lock is held, preemption is reactivated to allow high-priority processes to execute. This dynamic switching resolves the contradiction by adapting the preemption behavior to the current locking state.
2Loss of time
If the lock owning process is allowed to execute until completion, then lock release time is advanced, but preemption cannot respond to higher-priority processes causing performance degradation
Solution Approach 1:
The system dynamically switches between two operational modes: when a lock is held, the processor operates in a non-preemptive mode to ensure rapid lock release; when no lock is held, it operates in preemptive mode to maximize system throughput by executing high-priority processes. This resolves the contradiction by optimizing for lock release speed when needed and system productivity when not needed.
3Reliability
If preemption is deactivated to prevent blockage, then lock contention is reduced, but higher-priority processes cannot be executed promptly causing performance inversion
Solution Approach 1:
The system dynamically controls the preemption state based on lock ownership. Preemption is deactivated only during the critical period when a process holds a lock, ensuring reliable lock release. Preemption is reactivated when no lock is held, allowing high-priority processes to execute promptly. This time-dependent dynamic control resolves the contradiction between reliability and speed.
Data Source
AI summary
Provided is a method of controlling access a shared resources when executing a first process that acquires a lock on the shared resource and adding a second process to a waiting queue. A determination is made on whether to deactivate preemption for the processor based on a priority of the second process, and based on determining to deactivate preemption for the processor, executing the first process until execution of the first process on the shared resource is completed, then retrieving the lock from the first process after execution of the first process on the shared resource is completed and reactivating preemption for the processor.


