Merging Critical Sections via Dataflow Cost Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In parallel multi-threaded architectures, the limited number of physical mutexes often necessitates merging critical sections, which can lead to performance degradation due to the serialization effect on threads accessing shared data, as compilers attempt to allocate these resources efficiently.

Innovation Solution

A system comprising an instruction analysis module, cost estimation module, partition generator, redundant instruction module, and mutual exclusion lock module merges critical sections by performing dataflow analysis, generating cost matrices, and assigning physical mutexes to minimize the size of merged critical sections, thereby optimizing resource allocation and reducing performance degradation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If critical sections are merged to allocate physical mutexes efficiently, then resource allocation is optimized, but the size of merged critical sections increases causing performance degradation

Engineering Contradiction:
Improveresource allocation efficiencyVSAvoidthread serialization time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent segments critical sections into merged groups that can be processed together, dividing the program's critical sections into N merged critical sections that can be allocated to M physical mutexes. This segmentation allows efficient resource allocation while managing the serialization effect by grouping compatible critical sections together.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent merges multiple virtual critical sections into fewer merged critical sections that can be handled by physical mutexes. By merging critical sections that access the same shared data, the system reduces the number of synchronization operations while maintaining correctness, thus optimizing resource allocation.

Inventive Principle:
Principle #5Merging (Combining)

2Quantity of substance

If the number of physical mutexes is limited, then hardware resources are constrained, but merging critical sections increases complexity of allocation

Engineering Contradiction:
Improvenumber of physical mutexesVSAvoidcompiler allocation complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent implements self-service through automated compiler analysis that performs dataflow analysis, cost estimation, and partition generation. The system automatically identifies merging opportunities and allocates physical mutexes without manual intervention, reducing the complexity burden on the compiler while working within limited hardware resources.

Inventive Principle:
Principle #25Self-service

3Productivity

If critical sections are merged to match physical mutexes, then resource utilization improves, but redundant instructions increase

Engineering Contradiction:
Improvemutex utilization efficiencyVSAvoidredundant instructions
Core Design Contradiction:
ProductivityVSLoss of substance

Solution Approach 1:

The patent performs preliminary dataflow analysis and cost estimation before generating the final partition. By analyzing the program in advance and identifying redundant instructions, the system can eliminate unnecessary synchronization operations before code generation, thus improving mutex utilization without retaining redundant instructions.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent discards redundant instructions that arise from merging critical sections. The analysis phase identifies instructions that become unnecessary after merging, and these are removed in the partition generation phase, recovering space and improving efficiency while maintaining the benefits of merged critical sections.

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS7392513B2Methods and apparatus for merging critical sections
Publication Date: 2008.06.24 BEIJING XIAOMI MOBILE SOFTWARE CO LTD
  • US7392513B2 patent drawing
  • US7392513B2 patent drawing
  • US7392513B2 patent drawing

AI summary

Methods and apparatus for merging critical sections are disclosed. An example disclosed system estimates the cost of merging a first critical section and a second critical section using a dataflow analysis on the first and second critical sections. In the example system, the first critical section and the second critical section are merged based on a least expensive cost of merging critical sections.