22,6 → 22,12 |
|
#define FSF_SPARE_CAPACITY_MODULE_SUPPORTED 1 |
|
|
#define FSF_MAX_QUALITY 100 |
#define FSF_MIN_QUALITY 0 |
#define FSF_MAX_IMPORTANCE 5 |
#define FSF_MIN_IMPORTANCE 1 |
|
//// The definition of this types is in fsf_basic_types.h |
// |
//// Granularity of spare capacity requirements |
54,32 → 60,51 |
//#define FSF_NULL_UTILIZATION_SET (fsf_utilization_set_t *)NULL |
// |
|
//fsf_set_contract_reclamation_parameters: The operation updates the |
//specified contract parameters object by setting its maximum usable |
//budget, minimum period, granularity, utilization set, quality, and |
//importance to the specified input parameters. |
/* |
[ERR@RETURNED: |
FSF_ERR_BAD_ARGUMENT : if contract is NULL or |
(budget_max value is grater than period_max or smaller than budget_min) or |
(period_min is smaller than budget_mint or larger than period_max) or |
(granularity is neither FSF_CONTINUOUS nor FSF_DISCRETE) or |
(granularity is FSF_CONTINUOUS and |
utilization_set is not FSF_NULL_UTILIZATION_SET) or |
(granularity is FSF_DISCRETE and |
utilization_set is FSF_NULL_UTILIZATION_SET) or |
(utilization_set is not FSF_NULL_UTILIZATION_SET and |
/** |
\ingroup sparemodule |
|
The operation updates the specified contract parameters object by |
setting its maximum usable budget, minimum period, granularity, |
utilization set, quality, and importance to the specified input |
parameters. |
|
@param [in] contract pointer ot the contract |
@param [in] budget_max maximum budget this contract can obtain |
@param [in] period_min minimum period this contract can obtain |
@param [in] granularity can be either FSF_CONTINUOUS or FSF_DISCRETE |
@param [in] utilization_set in case the granularity is set to |
FSF_DISCRETE it contains a list possible pairs (budget,period) |
@param [in] quality a number between FSF_MIN_QUALITY and FSF_MAX_QUALITY, |
to control how the spare capacity is shared between |
contracts with the same importance. The higher |
is this number, the more likely we get a large increase |
in the capacity |
@param [in] importance a numer between FSF_MIN_IMPORTANCE and |
FSF_MAX_IMPORTANCE, used to control how the spare capacity |
is shared. The higher the number, the more likely we get |
some spare capacity. |
|
@retval 0 if the call is succesful |
@retval FSF_ERR_BAD_ARGUMENT if contract is NULL or one of the |
following conditions is true: |
- (budget_max value is grater than period_max or smaller than |
budget_min); |
- (period_min is smaller than budget_mint or larger than period_max); |
- (granularity is neither FSF_CONTINUOUS nor FSF_DISCRETE); |
- (granularity is FSF_CONTINUOUS and |
utilization_set is not FSF_NULL_UTILIZATION_SET) |
- (granularity is FSF_DISCRETE and utilization_set is |
FSF_NULL_UTILIZATION_SET) |
- (utilization_set is not FSF_NULL_UTILIZATION_SET and |
(size of utilization_set less than 2 or greater |
than FSF_MAX_N_UTILIZATION_VALUES) ) or |
(quality < 0) or |
(importance is less than 1 or greater than FSF_N_IMPORTANCE_LEVELS) or |
(the utilization_set elements are not in increasing utilization order) or |
(the first utilization value in the utilization_set does not match |
the pair (budget_min, period_max) of the contract) or |
(the last utilization value in the utilization_set does not match |
the pair (budget_max, period_min) of the contract) |
] |
|
than FSF_MAX_N_UTILIZATION_VALUES) |
- (quality < 0) |
- (importance is less than 1 or greater than FSF_N_IMPORTANCE_LEVELS) |
- (the utilization_set elements are not in increasing utilization order) |
- (the first utilization value in the utilization_set does not match |
the pair (budget_min, period_max) of the contract); |
- (the last utilization value in the utilization_set does not match |
the pair (budget_max, period_min) of the contract). |
*/ |
int |
fsf_set_contract_reclamation_parameters |
92,16 → 117,20 |
int importance); |
|
|
//fsf_get_contract_reclamation_parameters: The operation obtains from |
//the specified contract parameters object its granularity, |
//utilization set, quality, and importance. Then copies them to the |
//variables pointed to by the specified input parameters. Only the |
//utilization_values of the utilization_set that are in use, are |
//copied (according to its size field). |
/* |
[ERR@RETURNED: |
FSF_ERR_BAD_ARGUMENT : if contract is NULL |
] |
/** |
\ingroup sparemodule |
|
The operation obtains from the specified contract parameters |
object its granularity, utilization set, quality, and |
importance. Then copies them to the variables pointed to by the |
specified input parameters. Only the utilization_values of the |
utilization_set that are in use, are copied (according to its size |
field). |
|
@retval 0 if the operation is succesful |
@retval FSF_ERR_BAD_ARGUMENT : if contract is NULL |
|
@see fsf_set_contract_reclamation_parameters |
*/ |
int |
fsf_get_contract_reclamation_parameters |
114,22 → 143,29 |
int *importance); |
|
|
//fsf_request_change_quality_and_importance: The operation enqueues a |
//request to change the quality and importance parameters of the |
//specified server, and returns immediately. The change operation is |
//performed as soon as it is practical; meanwhile the system operation |
//will continue normally. |
/* |
[ERR@RETURNED: |
FSF_ERR_BAD_ARGUMENT : if the value of the server argument is not in range or |
(quality < 0) or |
(importance is less than 1 or greater than FSF_N_IMPORTANCE_LEVELS) |
FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not |
/** |
\ingroup sparemodule |
|
The operation enqueues a request to change the quality and |
importance parameters of the specified server, and returns |
immediately. The change operation is performed as soon as it is |
practical; meanwhile the system operation will continue normally. |
|
@param server server id |
@param new_importance the new importance |
@param new_quality the new requested quality |
|
@retval FSF_ERR_BAD_ARGUMENT if |
- the value of the server argument is not in range or |
- (quality < 0) |
- (importance is less than 1 or greater than FSF_N_IMPORTANCE_LEVELS). |
|
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is not |
scheduled under the FSF |
FSF_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running |
FSF_ERR_NOT_CONTRACTED_SERVER : if the server has been cancelled or it |
is not valid |
] |
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or |
not running |
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the server has been cancelled |
or it is not valid |
*/ |
int |
fsf_request_change_quality_and_importance |
138,47 → 174,54 |
int new_quality); |
|
|
//fsf_get_total_quality: This operation calculates the sum of the |
//quality parameters for all servers in the system of importance level |
//equal to that of the specified server, and stores it in the variable |
//pointed to by total_quality. |
/* |
[ERR@RETURNED: |
FSF_ERR_BAD_ARGUMENT : if the value of the server argument is not in range or |
total_quality is NULL |
FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not |
/** |
\ingroup sparemodule |
|
This operation calculates the sum of the quality parameters for all |
servers in the system of importance level equal to that of the |
specified server, and stores it in the variable pointed to by |
total_quality. |
|
@param [in] server server id |
@param [out] total_quality the total quality in the system |
|
@retval FSF_ERR_BAD_ARGUMENT if the value of the server argument |
is not in range or total_quality is NULL |
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is not |
scheduled under the FSF |
FSF_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running |
FSF_ERR_NOT_CONTRACTED_SERVER : if the server has been cancelled or it |
is not valid |
] |
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or |
not running |
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the server has been |
cancelled or it is not valid |
*/ |
|
int |
fsf_get_total_quality |
(fsf_server_id_t server, int *total_quality); |
|
|
//fsf_get_available_capacity: This operation stores in the variable |
//pointed to by capacity the spare capacity currently assigned to the |
//importance level of the specified server. The capacity is the number |
//obtained divided by UINT32_MAX, and it represents the processor or |
//network utilization. |
/* |
[ERR@RETURNED: |
FSF_ERR_BAD_ARGUMENT : if the value of the server argument is not in range or |
capacity is NULL |
FSF_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not |
/** |
\ingroup sparemodule |
|
This operation stores in the variable pointed to by capacity the |
spare capacity currently available for the importance level of the |
specified server. The capacity is the utilization (of the |
processor or of the network) and it is represented by an integer |
number between 0 (no utilization) and UINT32_MAX (all |
utilization). |
|
@retval FSF_ERR_BAD_ARGUMENT if the value of the server argument is |
not in range or capacity is NULL |
@retval FSF_ERR_NOT_SCHEDULED_CALLING_THREAD if the calling thread is not |
scheduled under the FSF |
FSF_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running |
FSF_ERR_NOT_CONTRACTED_SERVER : if the server has been cancelled or it |
is not valid |
] |
@retval FSF_ERR_INVALID_SCHEDULER_REPLY the scheduler is wrong or |
not running |
@retval FSF_ERR_NOT_CONTRACTED_SERVER if the server has been cancelled |
or it is not valid |
*/ |
|
int |
fsf_get_available_capacity ( |
fsf_server_id_t server, uint32_t *capacity); |
|
/* @} */ |
|
#endif // _FSF_SPARE_CAPACITY_H_ |