Dynamic Memory Allocation for Priority Queues
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional network devices require significant memory resources due to deep priority queues to manage unpredictable bursts of network packets, leading to inefficient memory utilization and increased costs.
Innovation Solution
Implementing a dynamic memory management system that allows multiple priority queues to share a common memory space, using write and prefetch buffers to efficiently store and process packets in a first-in, first-out (FIFO) order, reducing the need for pre-allocated memory and enhancing memory bandwidth efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If deep priority queues are implemented to accommodate unpredictable bursts of network packets, then packet buffering capability is improved, but memory requirements increase significantly
Solution Approach 1:
Multiple priority queues share a common memory space instead of each having dedicated memory. The system uses a single memory region that is dynamically allocated and managed across all priority queues, allowing the memory to be pooled and reused efficiently. This merging approach maintains the ability to buffer packets for multiple priorities while significantly reducing total memory requirements compared to separate deep queues for each priority level.
Solution Approach 2:
The system dynamically allocates and deallocates memory pages to priority queues based on actual packet arrival patterns and queue depth requirements. Instead of pre-allocating fixed deep queues for each priority, the system can expand or contract memory allocation dynamically, allowing the memory resources to adapt to varying network conditions and burst patterns without wasting memory on unused capacity.
2Reliability
If pre-allocated memory is assigned to each priority queue to match aggregate packet size, then packet buffering is ensured, but memory utilization efficiency decreases
Solution Approach 1:
The system changes the memory allocation parameters from static pre-allocated sizes to dynamic allocation based on actual queue depth and packet arrival patterns. Memory pages are allocated and deallocated at runtime, allowing the system to match memory resources more closely with actual usage patterns, thereby improving utilization efficiency while maintaining buffering guarantees when needed.
Solution Approach 2:
When priority queues become empty or reduce their depth requirements, the system deallocates and recovers the memory pages for reuse by other queues or for future allocation. This prevents memory waste by discarding (deallocating) pre-allocated memory that is no longer needed, converting it into available resources that can be efficiently allocated when required.
3Ease of operation
If separate deep queues are maintained for each priority level, then priority-based packet processing is achieved, but device complexity increases
Solution Approach 1:
The system merges the memory storage function across all priority queues into a single common memory space, while maintaining separate queue data structures for tracking packet references and metadata. This separation of concerns simplifies memory management while preserving priority-based processing capabilities, as each queue still maintains its own reference list but all queues share the same underlying memory region.
Data Source
AI summary
In general, the invention is directed to techniques for improving memory utilization in a priority queuing system of a network device. More specifically, a priority queue memory management system is described in which memory pages are assigned to the various priority queues in order to implement an efficient first in, first out (FIFO) functionality. The dynamic memory techniques described herein allow the multiple priority queues to share a common memory space. As a result, each priority queue does not require a pre-allocated amount of memory that matches the aggregate size of the packets that must be buffered by the queue.


