Processor Stack Management via Interrupt Blocking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing processor technologies face challenges in preventing stack overflow errors, particularly during the handling of nested or recursive interrupt requests, which can lead to system instability and crashes due to uncontrolled stack memory usage.
Innovation Solution
Implementing a system that monitors call stack usage levels and selectively disables or delays interrupts based on priority levels when the stack usage exceeds predefined thresholds, ensuring that the call stack does not overflow by temporarily blocking lower-priority interrupts until sufficient space is freed.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If interrupts are serviced by the processor without restrictions, then system responsiveness and interrupt handling capability are improved, but stack overflow errors occur due to uncontrolled stack memory usage
Solution Approach 1:
The system dynamically adjusts interrupt handling behavior based on real-time stack usage conditions. When stack usage exceeds a threshold, the system transitions from allowing all interrupts to selectively blocking interrupts, creating a dynamic response that prevents stack overflow while maintaining system responsiveness under normal conditions
Solution Approach 2:
The system continuously monitors stack usage and uses this feedback to control interrupt handling. The monitoring mechanism provides real-time information about stack consumption, which triggers interrupt blocking when thresholds are exceeded, forming a closed-loop control system that prevents stack overflow
2Reliability
If the call stack size is increased to accommodate more information items, then stack overflow prevention is improved, but memory usage increases
Solution Approach 1:
The system establishes predetermined stack usage thresholds before overflow occurs. By monitoring and comparing current stack usage against these pre-set limits, the system takes preventive action (blocking interrupts) before the stack exceeds available memory, avoiding the need for excessive memory allocation
Solution Approach 2:
The system changes the operational parameters of interrupt handling based on stack usage conditions. Instead of maintaining a fixed large stack size, the system adjusts interrupt acceptance behavior dynamically, changing from permissive to restrictive interrupt handling as stack usage increases
3Productivity
If nested or recursive interrupt requests are allowed without restriction, then system responsiveness to multiple interrupts is improved, but stack memory consumption increases uncontrollably
Solution Approach 1:
The monitoring mechanism provides continuous feedback on stack usage levels caused by nested interrupts. When the feedback indicates excessive consumption, the system responds by blocking further interrupt nesting, preventing uncontrolled memory growth while allowing efficient interrupt handling within safe limits
Solution Approach 2:
The system applies preliminary countermeasures by blocking interrupts before stack overflow can occur. The monitoring and threshold comparison mechanism detects impending overflow conditions and preemptively prevents additional interrupt pushes that would cause uncontrolled memory consumption
Data Source
AI summary
The invention provides a processing system, comprising a memory comprising a processor call stack; a stack space usage register configured to determine the stack space usage of the processor call stack and to store a usage parameter indicative of the determined stack space usage; a first threshold register configured to store a pre-determinable first stack level threshold; and a first comparator configured to compare the usage parameter with the first stack level threshold and to output a first interrupt blocking signal, if the usage parameter exceeds the first stack level threshold, the first interrupt blocking signal being configured to block the decoding of interrupt signals input to the processing system and having interrupt priorities lower than or equal to or just lower than a first interrupt priority threshold. The invention further provides a method for stack management, especially in a processing system.


