Cache Slice Allocation for CPU Thread Performance

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current computing systems face performance issues when handling a large number of objects with limited worker threads, leading to CPU cache thrashing and inefficient resource utilization, especially when both procedural and message-passing approaches are used concurrently.

Innovation Solution

A cache slice allocation algorithm that dynamically assigns exclusive or shared cache slices to database objects based on their priority, allowing for efficient load balancing and resource distribution across multiple objects and threads, utilizing simultaneous multi-threading capabilities to optimize CPU resource usage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a worker thread frequently switches between multiple objects to process, then the worker thread can handle more objects, but the CPU cache is thrashed causing performance to degrade

Engineering Contradiction:
Improveworker thread object handling capabilityVSAvoidprocessing performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The CPU cache is segmented into multiple cache slices, with each slice dedicated to caching data for a specific object. When a worker thread processes an object, that object's data is cached in its dedicated slice, preventing cache thrashing even when the thread switches between multiple objects. This segmentation allows the worker thread to maintain high adaptability while preserving processing performance.

Inventive Principle:
Principle #1Segmentation

2Reliability

If locks are used for synchronization in procedural programming, then exclusive access to shared data is ensured, but thread concurrency is limited and performance scales poorly

Engineering Contradiction:
Improvedata access correctnessVSAvoidthread concurrency performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

A message queue serves as an intermediary between multiple worker threads and the processing system. Instead of worker threads directly competing for shared data with locks, they post messages to the queue. The system processes messages sequentially, ensuring data correctness without requiring thread synchronization locks. This intermediary mechanism enables high thread concurrency while maintaining reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Quantity of substance

If the number of worker threads is limited while the number of objects is large, then resource utilization is controlled, but cache thrashing occurs and performance collapses

Engineering Contradiction:
Improvenumber of objects handledVSAvoidprocessing performance
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The cache is segmented into multiple slices, with each slice dedicated to a specific object. This allows a limited number of worker threads to handle a large number of objects without cache thrashing, as each object's data resides in its dedicated cache slice. The segmentation enables controlled resource utilization while maintaining high processing performance.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each cache slice is assigned a specific quality characteristic - dedication to a particular object. This local quality ensures that when a worker thread processes any object, that object's data is always available in its dedicated slice, eliminating cache conflicts and maintaining high performance even with limited threads handling many objects.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10810124B2Designations of message-passing worker threads and job worker threads in a physical processor core
Publication Date: 2020.10.20 SAP SE
  • US10810124B2 patent drawing
  • US10810124B2 patent drawing
  • US10810124B2 patent drawing

AI summary

A central processing unit (CPU) forming part of a computing device, initiates execution of code associated with each of a plurality of objects used by a worker thread. The CPU has an associated cache that is split into a plurality of slices. It is determined, by a cache slice allocation algorithm for each object, whether any of the slices will be exclusive to or shared by the object. Thereafter, for each object, any slices determined to be exclusive to the object are activated such that the object exclusively uses such slices and any slices determined to be shared by the object are activated such that the object shares or is configured to share such slices.