Real-time scheduling for parallel tasks with resource reclamation

Qingqiang He, Yongzheng Sun, Xu Jiang, Mingsong Lv, Jinkyu Lee, Nan GuanReal Time Syst 2024

Abstract

Traditional real-time scheduling for parallel tasks often relies on pessimistic worst-case execution time (WCET) estimates, leading to significant hardware underutilization. This paper presents a novel "ladder-like" resource allocation strategy that combines offline profiling with online monitoring to reclaim idle computing resources while maintaining hard real-time guarantees. Experimental results demonstrate resource reclamation of up to 48.3% with minimal runtime overhead.

Introduction

In high-assurance systems—such as autonomous vehicles, aerospace controls, or medical devices—missing a task deadline can have catastrophic consequences. To ensure safety, these systems typically utilize "Federated Scheduling," which allocates a fixed "rectangular" block of processor cores to a task based on its absolute Worst-Case Execution Time (WCET).

However, this approach is inherently inefficient. The worst-case scenario rarely occurs in practice, and parallel tasks often exhibit varying degrees of parallelism throughout their execution. This leads to "resource-wasting," driven by analysis pessimism, execution pessimism, and the overhead of accounting for conditional logic that may never execute.

Addressing Resource Waste in Parallel Tasks

The fundamental inefficiency in current models stems from the "shape" of parallel execution. A task represented as a Directed Acyclic Graph (DAG) has peaks of high parallelism and valleys where sequential dependencies create bottlenecks. As shown in Figure 1, the same DAG task can result in different execution sequences depending on runtime conditions and resource availability.

A Directed Acyclic Graph (DAG) task example and its potential execution sequences.

Traditional scheduling reserves enough cores for the maximum possible parallelism for the entire duration of the task. By contrast, recognizing the dynamic nature of these execution sequences allows for more flexible resource management.

Methodology: Ladder-Like Resource Allocation

The authors propose a "ladder-like" resource allocation strategy that adapts to the task's actual needs. This hybrid approach functions in two distinct phases:

Offline Profiling

Before the system is deployed, the task is profiled through multiple runs to identify its "typical" execution shape. This data is used to create a "resource distribution"—a series of steps or a "ladder"—that allocates fewer cores during early, less-parallel stages and scales up only when necessary.

Online Monitoring and Reclamation

During runtime, the system tracks the volume of work completed ($w(t)$) and the cumulative time cores have been idle ($l(t)$). Whenever a sub-unit of the task finishes, the scheduler recalculates the minimum number of cores required to meet the remaining deadline. If the task is ahead of schedule, the system "reclaims" those cores, allowing them to be used for non-critical tasks or transitioned to low-power modes.

Crucially, the researchers developed new Schedulability Tests (Theorems 1 and 3) to mathematically prove that even with these dynamic adjustments, the hard real-time deadline will never be missed. This utilizes the "Critical Path Lemma," which observes that if any core is idle in a work-conserving system, the critical path must be executing, allowing for more accurate bounds on remaining work.

Evaluation and Results

The proposed approach was evaluated using synthetic task graphs generated via the Erdös-Rényi and UUnifast methods. The researchers varied parallelism factors and core counts (from 2 to 8) to test scalability.

When compared against the state-of-the-art "SAN" approach, the ladder-like method demonstrated significant improvements:

  • Resource Reclamation: The method reduced actual computing resource usage by an average of 37.8%.
  • Maximum Efficiency: In scenarios where tasks were more sequential (where traditional methods are most wasteful), the approach reclaimed up to 48.3% of resources.
  • Practical Overhead: Despite the continuous monitoring, the performance hit from task migration between cores was less than 1%, making the strategy highly practical for real-world implementation.

Conclusion and Future Work

This research demonstrates that moving away from rigid, rectangular resource blocks to a dynamic, ladder-like allocation can significantly improve hardware efficiency in high-assurance systems. While this study focused on optimizing single heavy parallel tasks, future work will explore multi-task environments and mixed-criticality systems. Applying this logic to systems where high-priority and low-priority tasks share resources could allow reclaimed capacity to help low-priority tasks meet "soft" deadlines more consistently.

Summary updated

BibTeX
@article{he2024real,
  author = {Qingqiang He and Yongzheng Sun and Xu Jiang and Mingsong Lv and Jinkyu Lee and Nan Guan},
  title = {{Real-time scheduling for parallel tasks with resource reclamation}},
  journal = {Real Time Syst.},
  year = {2024},
  doi = {10.1007/s11241-024-09421-9},
}
Figure