Coarse-Grained Shared Memory Tracking for Multi-Process Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional memory usage tracking in shared memory systems across multiple processes is inaccurate, leading to overcharging or undercharging, and increased crashes due to out-of-memory conditions, as the 'first touch' principle fails to reflect actual usage.
Innovation Solution
Implementing a coarse-grained multi-process control group with lazy updating using a background thread to track shared memory usage across multiple processes, ensuring equitable allocation and reducing overhead, thereby preventing overcharging and crashes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If the first touch principle is used to track shared memory usage, then the tracking implementation is simple, but the measurement precision of memory usage is poor
Solution Approach 1:
The patent segments the tracking system into two levels: coarse-grained control groups for multi-process tracking and fine-grained single-process control groups. This segmentation allows the system to maintain simplicity at the multi-process level while achieving precise measurement at the individual process level, resolving the contradiction between measurement precision and system complexity.
Solution Approach 2:
The patent introduces a new dimension of tracking by implementing both coarse-grained and fine-grained control groups simultaneously. This multi-dimensional approach enables the system to achieve high measurement precision without proportionally increasing complexity, as the fine-grained tracking is only activated when needed for specific processes.
2Ease of operation
If the first touch principle is used to charge processes for shared memory, then the charging mechanism is straightforward, but the fairness of resource allocation deteriorates
Solution Approach 1:
The patent divides the charging mechanism into coarse-grained control group charging for shared memory and fine-grained single-process control group charging for individual process usage. This segmentation enables fair resource allocation by ensuring each process is charged only for its actual usage while maintaining operational simplicity through the hierarchical structure.
Solution Approach 2:
The patent implements partial tracking at the coarse-grained level and full tracking at the fine-grained level only when necessary. This partial action approach maintains simplicity for the majority of operations while ensuring fairness when multiple processes access shared memory, avoiding the need for complex full-tracking mechanisms in all scenarios.
3Measurement precision
If page-level tracking is implemented for each process, then the measurement precision is high, but the device complexity and overhead increase
Solution Approach 1:
The patent segments the tracking granularity by implementing coarse-grained control groups that aggregate memory usage across multiple processes and fine-grained tracking only where necessary. This segmentation reduces the overall tracking overhead while maintaining high measurement precision for individual process accountability, thus preserving system performance.
Solution Approach 2:
The patent merges multiple processes into coarse-grained control groups for collective tracking, reducing the number of individual tracking operations needed. This merging approach decreases system overhead and improves productivity while maintaining measurement precision through the associated fine-grained control groups when detailed tracking is required.
Data Source
AI summary
An apparatus in one embodiment comprises a host device that includes at least one processor and an associated memory. The host device is configured to implement a plurality of processes each configured to access a shared region of the memory. The host device is further configured to establish a multi-process control group for the shared region, to maintain state information for the multi-process control group, and to track usage of the shared region by the processes based at least in part on the state information. At least a subset of the processes may comprise respective containers implemented utilizing operating system level virtualization of the processor of the host device. The multi-process control group established for the shared region illustratively comprises a coarse-grained control group having a granularity greater than a single page of the shared region.


