next up previous
Next: Destroying a CPU Reserve Up: API for LinuxRK Previous: Attaching a Process to

Creating a CPU Reserve


rk_reserve_t rk_cpu_reserve_create(rk_resource_set_t rs,cpu_reserve_attr_t attr)

Creates a CPU reservation and attaches it to resource set rs. The attributes of the CPU reservation are specified by the attr parameter, that is a pointer to a cpu_reserve_attr structure defined as follows:

struct cpu_reserve_attr {    

struct timespec compute_time;
struct timespec period;
struct timespec deadline;
struct timespec blocking_time;
struct timespec start_time;
rk_reserve_param_data_t reserve_type;
ticket_type_t ticket_type;
unsigned long quota_tickets;
cpu_tick_data_t ticket_age;
};

The amount of CPU reservation is specified by struct timespec computed_time and struct timespec period. The struct timespec deadline parameter is the relative deadline used by Deadline Monotonic or Earliest Deadline First, whereas struct timespec blocking_time and struct timespec start_time are the reserve blocking time (used for admission control) and start time respectively.

Parameters for CPU reservation are passed using the rk_reserve_param_t reserve_type field, that let you specify the enforcement and replenishment modes. Currently, LinuxRK supports the RSV_HARD, RSV_FIRM, and RSV_SOFT enforcement modes:

Replenishment modes:

Returns data structure rk_reserve_t on success and NULL_RESERVE on failure.


next up previous
Next: Destroying a CPU Reserve Up: API for LinuxRK Previous: Attaching a Process to
Luca Abeni 2000-11-03