qmgr_base.h File Reference

Base class definitions for predictor and controller types. More...

#include <linux/aquosa/qos_types.h>
#include <linux/aquosa/qmgr_types.h>
#include <linux/aquosa/qmgr_time.h>
#include <linux/aquosa/qmgr_config.h>
#include <linux/aquosa/qos_queue.h>

Go to the source code of this file.

Data Structures

struct  qmgr_pred_struct
 Base struct for statistics-based predictors. More...
struct  qmgr_ctrl_struct
 Base class for feedback controllers. More...
struct  qmgr_struct
 QMGR Structure. More...
struct  qmgr_pred_params_struct
 Predictor type and common parameters specification. More...
struct  qmgr_ctrl_params_struct
 Controller type and parameters specification. More...
struct  qmgr_lib_descriptor_t
 Library descriptor for a submodule. More...
struct  qmgr_pred_descriptor_t
struct  qmgr_ctrl_descriptor_t


typedef struct qmgr_pred_struct qmgr_pred_t
 Base struct for statistics-based predictors.
typedef struct qmgr_ctrl_struct qmgr_ctrl_t
 Base class for feedback controllers.
typedef struct qmgr_struct qmgr_t
 QMGR Structure.
typedef struct
 Predictor type and common parameters specification.
typedef struct
 Controller type and parameters specification.
typedef struct
 Library descriptor for a submodule.
typedef qos_rv(* qmgr_pred_init_f )(qmgr_pred_t *self, qmgr_pred_params_t *params)
typedef struct
typedef qos_rv(* qmgr_ctrl_init_f )(qmgr_ctrl_t *self, qmgr_ctrl_params_t *params)
typedef struct



Location of a submodule.



qos_rv qmgr_pred_final (qmgr_pred_t *pred)
 Predictor base class destructor.
qos_rv qmgr_set_pred_user (qmgr_pred_t *pred)
 Sets an application-provided predictor.
qos_rv qmgr_ctrl_final (qmgr_ctrl_t *ctrl)
 Controller base class destructor.
qos_rv qmgr_set_ctrl_user (qmgr_ctrl_t *ctrl)
 Sets an application-provided feedback controller.
qos_bw_t qmgr_ctrl_end_cycle (qmgr_ctrl_t *ctrl, int skip, qres_time_t *p_sched_error, qres_time_t *p_exec_time)
 Signals the end of a job (cycle) to the Controller.
qos_rv qmgr_pred_init (qmgr_pred_t *pred, qmgr_pred_params_t *params)
 Predictor base class constructor: sets all vtable pointers to null * and copies the type field from the params to the object.
qos_rv qmgr_ctrl_init (qmgr_ctrl_t *ctrl, qmgr_ctrl_params_t *params)
 Controller base class constructor: sets all vtable pointers to null * and copies the type field from the params to the object.
qos_rv qmgr_create_params (qmgr_t **pp, struct qmgr_params_struct *params)
qos_rv qmgr_ctrl_create (qmgr_ctrl_t **pp, qmgr_ctrl_params_t *params)
qos_rv qmgr_pred_create (qmgr_pred_t **pp, qmgr_pred_params_t *params)
qos_rv qmgr_destroy (qmgr_t *qmgr)
 Destroy the QMGR subcomponent(s).
qos_rv qmgr_ctrl_destroy (qmgr_ctrl_t *fb)
qos_rv qmgr_pred_destroy (qmgr_pred_t *pred)
void qmgr_ctrl_set_predictor (qmgr_ctrl_t *ctrl, qmgr_pred_t *pred)
 Set reference to predictor object.
qos_rv qmgr_ctrl_begin_cycle (qmgr_ctrl_t *ctrl)
 Automatically compute next deadline based on periodic assumption.
qos_bw_t qmgr_ctrl_begin_cycle_deadline (qmgr_ctrl_t *ctrl, struct timespec *now, struct timespec *abs_dl)
 Push explicitly passed deadline into the deadlines queue.
void qmgr_ctrl_set_deadline (qmgr_ctrl_t *ctrl, const struct timespec *abs_dl)
 Set deadline that will be used by next qmgr_ctrl_end_cycle() call for feedback-based scheduling decisions.
void qmgr_ctrl_get_deadline (qmgr_ctrl_t *ctrl, struct timespec *abs_dl)
 Get deadline.


qmgr_pred_descriptor_tpred_descriptors [QMGR_NUM_PREDS]
 The array of descriptors for the predictor submodules.
qmgr_ctrl_descriptor_tctrl_descriptors [QMGR_NUM_CTRLS]
 The array of descriptors for the controller submodules.

Detailed Description

Base class definitions for predictor and controller types.

This file defines the general expandibility mechanism that allows the QoS Manager to support various predictor and controller types, by means of C++-like "virtual" functions, i.e. function pointers. The base predictor has been designed with a "flat" interface where different predictor (sub)types must implement one or more of the defined virtual methods. This has been done to avoid a too complex (i.e. deep) hierarchy of predictors, where the corresponding functionality is, most of the times, quite simple, e.g. providing statistics computed on a moving window on past job execution times.

This file also defines the "Factory interface", i.e. a mechanism for registering a new class with the framework, so to allow direct invocation of some type-dependent (not object-dependent) services directly from the class identifier (i.e. one of the QMGR_PRED_x or QMGR_CTRL_x values), so to minimize the number of switch()es in the code and ease the task of adding a new submodule.

Definition in file qmgr_base.h.

Typedef Documentation

typedef struct qmgr_pred_struct qmgr_pred_t

Base struct for statistics-based predictors.

Predictors must provide at least the add_sample and one of the statistics based functions. Each controller may need a different set of statistics, and is supposed to check that the corresponding functions are provided (i.e. non-zero function pointers) during controller initialization.

Enumeration Type Documentation

Location of a submodule.

The Unknown value is used for purposes related to code and configuration debug.


Location of submodule unknown.


Submodule located into kernel.


Submodule located into library.


Submod in both library and kernel.

Definition at line 152 of file qmgr_base.h.

Function Documentation

qos_bw_t qmgr_ctrl_end_cycle ( qmgr_ctrl_t ctrl,
int  skip,
qres_time_t *  p_sched_error,
qres_time_t *  p_exec_time 

Signals the end of a job (cycle) to the Controller.

The controller, on the basis of the provided values for the current absolute and process execution times, undertakes the following steps:

  • computes the last job duration
  • computes the scheduling error for the just finished job
  • applies the (virtual) feedback mechanism to compute the new value of the required bandwidth for the process

If skip is set to 1, then the execution time of the job will be considered anomalous, thus it will not be considered for updating predictor statistics.

ctrl Reference to the controller object
skip Whether last job is anomalous or not
p_sched_error If non-null, it is used to store the scheduling error
p_exec_time If non-null, it is used to store the job execution time
qos_rv qmgr_set_ctrl_user ( qmgr_ctrl_t ctrl  ) 

Sets an application-provided feedback controller.

Returns error if predictor or qmgr configured for being into the kernel

qos_rv qmgr_set_pred_user ( qmgr_pred_t pred  ) 

Sets an application-provided predictor.

Returns error if predictor or qmgr configured for being into the kernel

pred A pointer to an application-provided predictor structure. The set of statistics (i.e. function pointers) to be provided depens on the controller that the application is going to use.

Variable Documentation

The array of descriptors for the controller submodules.

A copy exists in both spaces, but with different fields filled in.

Generated on Mon Aug 2 22:38:48 2010 for qosmgr by  doxygen 1.6.3