Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

rt_scheduler.h File Reference


Detailed Description

Common interface for using an OS-level real-time scheduler.

Note:
This is just an interface, there is no default implementation available, the appropriate one must be selected and linked in.
See also:
rt_scheduler_unix.c

rt_scheduler_rk.c

Definition in file rt_scheduler.h.

Include dependency graph for rt_scheduler.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  rts_scheduler_data
struct  rts_schedule

Typedefs

typedef rts_scheduler_data * rts_scheduler_data_t
typedef void * rts_schedulable_t
 An opaque reference to scheduler specific data.
typedef rts_schedule * rts_schedule_t

Enumerations

enum  { RSDB_RESERVATIONS }
enum  { RSDF_RESERVATIONS = (1L << RSDB_RESERVATIONS) }
enum  rts_reserve_mode_t { RTS_RSV_MIN, RTS_RSV_SOFT, RTS_RSV_HARD, RTS_RSV_MAX }
 The reservation mode. More...

Functions

int rts_query_scheduler (rts_scheduler_data_t rsd_out)
 Get information about the underlying scheduler.
int rts_grab_schedulable (rts_schedulable_t *rs_out, pid_t member, const char *name)
 Grab a reference to a schedulable entity.
int rts_release_schedulable (rts_schedulable_t rs)
 Release a reference to a schedulable entity.
int rts_set_schedule (rts_schedulable_t rsa, rts_schedule_t rs)
 Set the real-time schedule for a schedulable.
int rts_get_schedule (rts_schedulable_t rsa, rts_schedule_t rs_out)
 Get the real-time schedule for a schedulable.
int rts_clear_schedule (rts_schedulable_t rsa)
 Clear the real-time schedule for a schedulable and return it to a best-effort scheduler.


Typedef Documentation

typedef void* rts_schedulable_t
 

An opaque reference to scheduler specific data.

The schedulable is used to collect multiple processes under a single schedulable entity. For example, TimeSys Linux schedules a "resource set", which in turn, schedules a process in that set.

See also:
rts_grab_schedulable

rts_release_schedulable

Definition at line 73 of file rt_scheduler.h.

Referenced by main().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
RSDF_RESERVATIONS  The scheduler supports CPU reservations.

Definition at line 37 of file rt_scheduler.h.

enum rts_reserve_mode_t
 

The reservation mode.

Enumeration values:
RTS_RSV_MIN  Minimum allowed value.
RTS_RSV_SOFT  Soft reservation - use best-effort when needed.
RTS_RSV_HARD  Hard reservation - never use best-effort.
RTS_RSV_MAX  Maximum allowed value.

Definition at line 118 of file rt_scheduler.h.


Function Documentation

int rts_clear_schedule rts_schedulable_t  rsa  ) 
 

Clear the real-time schedule for a schedulable and return it to a best-effort scheduler.

Parameters:
rsa The schedulable to clear.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 71 of file rt_scheduler_unix.c.

References rk_cpu_reserve_delete(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_ResourceSet, and rts_schedulable_rk_t.

Referenced by StrictPolicyImpl::RedistributeCPU(), WeightedPolicyImpl::RedistributeCPU(), StrictPolicyImpl::RemoveTask(), and WeightedPolicyImpl::RemoveTask().

Here is the call graph for this function:

int rts_get_schedule rts_schedulable_t  rsa,
rts_schedule_t  rs_out
 

Get the real-time schedule for a schedulable.

Parameters:
rsa The schedulable to schedule.
rs_out The new schedule.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 64 of file rt_scheduler_unix.c.

References cpu_reserve_attr::compute_time, ensure, cpu_reserve_attr::period, cpu_reserve_attr::reserve_type, rk_cpu_reserve_get_attr(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_ResourceSet, RSV_HARD, RSV_SOFT, rts_schedulable_rk_t, and rk_reserve_param::sch_mode.

Here is the call graph for this function:

int rts_grab_schedulable rts_schedulable_t rs_out,
pid_t  member,
const char *  name
 

Grab a reference to a schedulable entity.

The current semantics of this function are as follows:

  • If necessary, the function must make some effort to "repair" the system state by destroying schedulables that are in a suspicious state.
  • Multiple calls to this function with the same parameters need not return the same pointer, however, their values must be equal. The user must also release the schedulables in the opposite order in which they were grabbed.
  • If the schedulable entity already exists at the OS-level, it should be used instead of creating a new one.
  • If no schedulable entity exists that contains the given process or has the given name, one should be created.
Parameters:
rs_out A pointer that should be filled out with the schedulable value.
member A process that is already a member of the schedulable, one that should be added to a newly created schedulable, or -1 if the schedulable should be created by name.
name The name for the schedulable or NULL if one should be made up.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 41 of file rt_scheduler_unix.c.

References rk_cpu_reserve_delete(), rk_proc_get_rset(), rk_reserve_t, rk_resource_set_attach_process(), rk_resource_set_create(), rk_resource_set_get_by_name(), rk_resource_set_get_cpu_rsv(), rk_resource_set_get_num_procs(), rts_schedulable_rk::rsr_Flags, rts_schedulable_rk::rsr_ResourceSet, rts_release_schedulable(), rts_repair_resource_sets(), and rts_schedulable_rk_t.

Referenced by StrictPolicyImpl::AddTask(), WeightedPolicyImpl::AddTask(), and main().

Here is the call graph for this function:

int rts_query_scheduler rts_scheduler_data_t  rsd_out  ) 
 

Get information about the underlying scheduler.

This function is mostly about making it possible to do run-time adaptation to the scheduler's capabilities.

Parameters:
rsd_out A reference to an #rts_scheduler_data object that should be filled in.

Definition at line 25 of file rt_scheduler_unix.c.

Referenced by main().

int rts_release_schedulable rts_schedulable_t  rs  ) 
 

Release a reference to a schedulable entity.

The current semantics of this function are as follows:

  • If the given schedulable created the OS-level entity, this call should destroy it.
  • If the given schedulable entity was used to set the schedule, this call should clear the schedule.
Parameters:
rs The reference from rts_grab_schedulable to release.
Returns:
Zero on success, otherwise an errno value.

Definition at line 50 of file rt_scheduler_unix.c.

References rk_cpu_reserve_delete(), rk_resource_set_destroy(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_Flags, rts_schedulable_rk::rsr_ResourceSet, and rts_schedulable_rk_t.

Referenced by main(), StrictPolicyImpl::RemoveTask(), WeightedPolicyImpl::RemoveTask(), and rts_grab_schedulable().

Here is the call graph for this function:

int rts_set_schedule rts_schedulable_t  rsa,
rts_schedule_t  rs
 

Set the real-time schedule for a schedulable.

Parameters:
rsa The schedulable to schedule.
rs The new schedule.
Returns:
Zero on success, otherwise, an errno code.

Definition at line 57 of file rt_scheduler_unix.c.

References cpu_reserve_attr::compute_time, cpu_reserve_attr::deadline, rk_reserve_param::enf_mode, ensure, cpu_reserve_attr::period, rk_reserve_param::rep_mode, cpu_reserve_attr::reserve_type, rk_cpu_reserve_create(), rk_cpu_reserve_ctl(), rk_resource_set_get_cpu_rsv(), rts_schedulable_rk::rsr_CPUReserve, rts_schedulable_rk::rsr_ResourceSet, RTS_RSV_HARD, RTS_RSV_SOFT, rts_schedulable_rk_t, and rk_reserve_param::sch_mode.

Referenced by StrictPolicyImpl::RedistributeCPU(), and WeightedPolicyImpl::RedistributeCPU().

Here is the call graph for this function:


Generated on Fri Oct 22 07:50:52 2004 for CPU Broker by  doxygen 1.3.9.1