OS Scheduler Adjusts CPU Time Quantum for Fair Cache Sharing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional CPU schedulers on multi-core processors fail to ensure fair cache memory sharing among threads, leading to unfair CPU sharing, poor priority enforcement, and inaccurate CPU accounting due to co-runner dependency, which affects performance and billing accuracy in multi-core environments.

Innovation Solution

An operating system scheduler adjusts CPU latency by computing and calibrating the fair CPU time quantum for each thread based on cache miss rates and CPI values, ensuring equal cache sharing by dynamically adjusting CPU time allocation and compensating other threads to maintain performance fairness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If conventional CPU schedulers allocate equal time slices to threads, then CPU time sharing appears fair, but cache memory sharing becomes unfair due to co-runner dependency

Engineering Contradiction:
ImproveCPU time allocation fairnessVSAvoidcache memory sharing fairness
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The scheduler implements feedback mechanisms by monitoring cache miss rates and CPI values of running threads. Based on this feedback, the scheduler dynamically adjusts CPU time quantum allocation to compensate for unfair cache sharing, ensuring that threads receive equitable CPU performance despite hardware-controlled cache allocation

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system changes the parameter of CPU time quantum allocation dynamically based on observed cache performance metrics. Instead of fixed equal time slices, the scheduler adjusts time quantum values for different threads based on their cache miss rates and CPI, transforming the scheduling approach from static to adaptive

Inventive Principle:
Principle #35Parameter changes

2Productivity

If threads share a single L2 cache memory on multi-core processors, then hardware utilization improves, but performance variability increases due to co-runner dependency

Engineering Contradiction:
Improvehardware utilizationVSAvoidperformance consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The operating system scheduler acts as an intermediary between threads and the shared cache memory. It introduces a software layer that compensates for hardware-level cache sharing unfairness by adjusting CPU time allocation, thereby mediating the performance variability caused by co-runner dependency while maintaining the benefits of shared cache

Inventive Principle:
Principle #24Intermediary (Mediator)

3Device complexity

If conventional schedulers assume single CPU resource, then scheduling is simple, but accounting accuracy deteriorates on multi-core systems

Engineering Contradiction:
Improvescheduling mechanism simplicityVSAvoidCPU accounting accuracy
Core Design Contradiction:
Device complexityVSMeasurement precision

Solution Approach 1:

The scheduler segments the multi-core processing system into individual thread performance accounts, tracking cache miss rates and CPI values for each thread separately. This segmentation enables accurate per-thread accounting on multi-core systems while maintaining manageable complexity through modular tracking of individual thread metrics

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8069444B2Method and apparatus for achieving fair cache sharing on multi-threaded chip multiprocessors
Publication Date: 2011.11.29 ORACLE AMERICAN INC
  • US8069444B2 patent drawing
  • US8069444B2 patent drawing
  • US8069444B2 patent drawing

AI summary

In a computer system with a multi-core processor having a shared cache memory level, an operating system scheduler adjusts the CPU latency of a thread running on one of the cores to be equal to the fair CPU latency which that thread would experience when the cache memory was equally shared by adjusting the CPU time quantum of the thread. In particular, during a reconnaissance time period, the operating system scheduler gathers information regarding the threads via conventional hardware counters and uses an analytical model to estimate a fair cache miss rate that the thread would experience if the cache memory was equally shared. During a subsequent calibration period, the operating system scheduler computes the fair CPU latency using runtime statistics and the previously computed fair cache miss rate value to determine the fair CPI value.