Hardware-Assisted Autonomic Code Patching via Metadata Pointers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional methods for optimizing program code performance require modification of the original code, which is not desirable, and do not allow for autonomous patching of branch instructions or other types of instructions to improve execution efficiency without altering the code itself.

Innovation Solution

The use of hardware assistance, specifically metadata and a new flag in the machine status register, enables autonomous patching of code by redirecting execution to alternative or reorganized instructions without modifying the original code, allowing for performance optimization functions like reorganizing code sequences based on access patterns.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If code is reorganized to improve cache performance, then execution efficiency is improved, but the original code is modified

Engineering Contradiction:
Improveexecution efficiencyVSAvoidcode integrity
Core Design Contradiction:
ProductivityVSStability of the object's composition

Solution Approach 1:

The patent creates a copy of the original code block and places it in a different memory location with improved cache organization. The patched code pointer redirects execution to this copied version, allowing performance optimization without modifying the original code. This resolves the contradiction by maintaining code integrity while achieving execution efficiency through the copied optimized version.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent introduces a patched code pointer as an intermediary between the original code and the optimized code. This pointer acts as a mediator that redirects execution flow to the optimized version without altering the original code structure. The intermediary enables performance improvement while preserving the original code's integrity and stability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Speed

If code patching is implemented to optimize performance, then execution speed is improved, but device complexity increases

Engineering Contradiction:
Improveexecution speedVSAvoidsystem complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The system performs self-service by autonomously generating patched code and updating pointers without requiring external intervention or complex patch management infrastructure. The performance monitoring application automatically identifies optimization opportunities, generates optimized code blocks, and updates the patched code pointers, reducing overall system complexity while achieving execution speed improvement.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent prepares optimized code blocks in advance and stores them in memory before they are needed during execution. The patched code pointers are pre-configured to point to these prepared optimized blocks, allowing immediate execution speed improvement without requiring complex runtime code generation or transformation mechanisms, thereby reducing system complexity.

Inventive Principle:
Principle #10Preliminary action

3Productivity

If branch instructions are patched to improve performance, then productivity is improved, but the difficulty of detecting and measuring increases

Engineering Contradiction:
Improveperformance optimizationVSAvoidpatch detection difficulty
Core Design Contradiction:
ProductivityVSDifficulty of detecting and measuring

Solution Approach 1:

The patent implements feedback mechanisms where the performance monitoring application continuously monitors execution performance and automatically adjusts patched code pointers based on measured performance metrics. This feedback loop makes patching decisions detectable and measurable by providing explicit performance data that indicates when and how branch instructions are being optimized, resolving the detection difficulty while maintaining productivity improvements.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS7415705B2Autonomic method and apparatus for hardware assist for patching code
Publication Date: 2008.08.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US7415705B2 patent drawing
  • US7415705B2 patent drawing
  • US7415705B2 patent drawing

AI summary

A method, apparatus and computer instructions for hardware assist for autonomically patching code. The present invention provides hardware microcode to a new type of metadata to selectively identify instructions to be patched for specific performance optimization functions. The present invention also provides a new flag in the machine status register (MSR) to enable or disable a performance monitoring application or process to perform code-patching functions. If the code patching function is enabled, the application or process may patch code at run time by associating the metadata with the selected instructions. The metadata includes pointers pointing to the patch code block code. The program code may be patched autonomically without modifying original code.