From a5d239237ae02ac01ac7b79b6252f1a51e5ed774 Mon Sep 17 00:00:00 2001 From: telleriam Date: Tue, 6 Feb 2007 16:43:09 +0000 Subject: [PATCH] Adding some corrections detected in Barcelona git-svn-id: http://www.frescor.org/private/svn/frescor/frsh/trunk/include@287 35b4ef3e-fd22-0410-ab77-dab3279adceb --- frsh_core.h | 181 +++++++++++++++++++++--------------------- frsh_spare_capacity.h | 53 +++++++++---- 2 files changed, 127 insertions(+), 107 deletions(-) diff --git a/frsh_core.h b/frsh_core.h index d185db7..6cfbf1e 100644 --- a/frsh_core.h +++ b/frsh_core.h @@ -329,89 +329,6 @@ int frsh_get_contract_timing_requirements int *deadline_miss_sig_notify, union sigval *deadline_miss_sig_value); -/** - * frsh_schedule_timed_job() - * - * This operation is invoked by threads associated with bounded - * workload servers to indicate that a job has been completed (and - * that the scheduler may reassign the unused capacity of the current - * job to other servers). It is also invoked when the first job of - * such threads has to be scheduled. - * - * As an effect, the system will make the current server's budget zero - * for the remainder of the server's period, and will not replenish - * the budget until the specified absolute time. At that time, all - * pending budget replenishments (if any) are made effective. Once the - * server has a positive budget and the scheduler schedules the - * calling thread again, the call returns and at that time, except for - * those parameters equal to NULL pointers, the system reports the - * current period and budget for the current job, whether the deadline - * of the previous job was missed or not, and whether the budget of - * the previous job was overrun or not. - * - * In a system with hierarchical scheduling, since this call makes the - * budget zero, the other threads in the same server are not run. As - * mentioned abobe, only when the call finishes the budget may be - * replenished. - * - * (PEPPE: I have a question, what - * happens to the budget? if I do not get it wrong, the replenishment - * time is set to abs_time and the bandwidth of the server up to time - * abs_time can be reassigned. Is it true? what is the exact - * relationship between this abs_time and the server period? What if - * the user specifies an abs_time less than the end of the current - * server period??) - * - * @param [in] abs_time absolute time at which the budget will be - * replenished - * - * @param [out] next_budget upon return of this function, the variable - * pointed by this function will be equal to - * the current server budget. If this parameter is - * set to NULL, no action is taken. - * - * @param [out] next_period upon return of this function, the variable - * pointed by this function will be equal to - * the current server period. If this parameter is - * set to NULL, no action is taken. - * - * @param [out] was_deadline_missed upon return of this function, the - * variable pointed by this function will be - * equal to true if the previous server deadline - * was missed, to false otherwise. If this - * parameter is set to NULL, no action is - * taken. - * - * @param [out] was_budget_overrun upon return of this function, the - * variable pointed by this function will be - * equal to true if the previous server budget was - * overrun, to false otherwise. If this - * parameter is set to NULL, no action is - * taken. - * - * @return 0 if the operation is succesful - * FRSH_ERR_TIME_SPEC_IN_THE_PAST if the absolute time specification - * is in the past. - * FRSH_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running - * FRSH_ERR_INTERNAL_ERROR : erroneous binding or malfunction of the FRSH - * main scheduler - * FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling - * thread is not scheduled under the FRSH - * FRSH_ERR_NOT_BOUND : if the calling thread does not have a valid - * server bound to it - * FRSH_ERR_BAD_ARGUMENT : if abs_time is NULL - * FRSH_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload of the server - * is not FRSH_BOUNDED - * - * - * @sa frsh_schedule_triggered_job, frsh_timed_schedule_triggered_job - **/ -int frsh_schedule_timed_job - (const struct timespec *abs_time, - struct timespec *next_budget, - struct timespec *next_period, - bool *was_deadline_missed, - bool *was_budget_overran); /*@}*/ @@ -639,6 +556,90 @@ int frsh_timed_schedule_triggered_job int frsh_signal_synch_obj (frsh_synch_obj_handle_t synch_handle); +/** + * frsh_schedule_timed_job() + * + * This operation is invoked by threads associated with bounded + * workload servers to indicate that a job has been completed (and + * that the scheduler may reassign the unused capacity of the current + * job to other servers). It is also invoked when the first job of + * such threads has to be scheduled. + * + * As an effect, the system will make the current server's budget zero + * for the remainder of the server's period, and will not replenish + * the budget until the specified absolute time. At that time, all + * pending budget replenishments (if any) are made effective. Once the + * server has a positive budget and the scheduler schedules the + * calling thread again, the call returns and at that time, except for + * those parameters equal to NULL pointers, the system reports the + * current period and budget for the current job, whether the deadline + * of the previous job was missed or not, and whether the budget of + * the previous job was overrun or not. + * + * In a system with hierarchical scheduling, since this call makes the + * budget zero, the other threads in the same server are not run. As + * mentioned abobe, only when the call finishes the budget may be + * replenished. + * + * (PEPPE: I have a question, what + * happens to the budget? if I do not get it wrong, the replenishment + * time is set to abs_time and the bandwidth of the server up to time + * abs_time can be reassigned. Is it true? what is the exact + * relationship between this abs_time and the server period? What if + * the user specifies an abs_time less than the end of the current + * server period??) + * + * @param [in] abs_time absolute time at which the budget will be + * replenished + * + * @param [out] next_budget upon return of this function, the variable + * pointed by this function will be equal to + * the current server budget. If this parameter is + * set to NULL, no action is taken. + * + * @param [out] next_period upon return of this function, the variable + * pointed by this function will be equal to + * the current server period. If this parameter is + * set to NULL, no action is taken. + * + * @param [out] was_deadline_missed upon return of this function, the + * variable pointed by this function will be + * equal to true if the previous server deadline + * was missed, to false otherwise. If this + * parameter is set to NULL, no action is + * taken. + * + * @param [out] was_budget_overrun upon return of this function, the + * variable pointed by this function will be + * equal to true if the previous server budget was + * overrun, to false otherwise. If this + * parameter is set to NULL, no action is + * taken. + * + * @return 0 if the operation is succesful + * FRSH_ERR_TIME_SPEC_IN_THE_PAST if the absolute time specification + * is in the past. + * FRSH_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running + * FRSH_ERR_INTERNAL_ERROR : erroneous binding or malfunction of the FRSH + * main scheduler + * FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling + * thread is not scheduled under the FRSH + * FRSH_ERR_NOT_BOUND : if the calling thread does not have a valid + * server bound to it + * FRSH_ERR_BAD_ARGUMENT : if abs_time is NULL + * FRSH_ERR_SERVER_WORKLOAD_NOT_COMPATIBLE: if the kind of workload of the server + * is not FRSH_BOUNDED + * + * + * @sa frsh_schedule_triggered_job, frsh_timed_schedule_triggered_job + **/ +int frsh_schedule_timed_job + (const struct timespec *abs_time, + struct timespec *next_budget, + struct timespec *next_period, + bool *was_deadline_missed, + bool *was_budget_overran); + /*@}*/ @@ -897,7 +898,7 @@ int frsh_get_contract frsh_contract_parameters_t *contract); /** - * frsh_get_server_by_contract_id() + * frsh_get_server_contract_id() * * This operation retrieves the server_id whose contract_id * corresponds to the parameter. It returns an error if the @@ -911,7 +912,7 @@ int frsh_get_contract * FRSH_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running * FRSH_ERR_CONTRACT_ID_UNKNOWN: if the contract_id is not known **/ -int frsh_get_server_id_by_contract_id +int frsh_get_server_by_contract_id (frsh_contract_id_t contract_id, frsh_server_id_t *server); @@ -942,7 +943,7 @@ int frsh_cancel_contract (frsh_server_id_t server); /** - * frsh_renegotiate_contract() + * frsh_renegotiate_contract_synchronously() * * The operation renegotiates a contract for an existing server. If * the on-line admission test is enabled it determines whether the @@ -966,13 +967,13 @@ int frsh_cancel_contract (frsh_server_id_t server); * FRSH_ERR_REJECTED_CONTRACT : if the renegotiation fails * **/ -int frsh_renegotiate_contract +int frsh_renegotiate_contract_synchronously (const frsh_contract_parameters_t *new_contract, frsh_server_id_t server); /** - * frsh_request_contract_renegotiation() + * frsh_renegotiate_contract_asynchronously() * * The operation enqueues a renegotiate operation for an existing * server, and returns immediately. The renegotiate operation is @@ -1010,7 +1011,7 @@ int frsh_renegotiate_contract * has been cancelled or it is not valid * **/ -int frsh_request_contract_renegotiation +int frsh_renegotiate_contract_asynchronously (const frsh_contract_parameters_t *new_contract, frsh_server_id_t server, int sig_notify, @@ -1293,7 +1294,7 @@ bool frsh_is_admission_test_enabled(); **/ int frsh_get_resource_usage (frsh_server_id_t server, - struct timespec *cpu_time); + struct timespec *spent); /** * frsh_get_remaining_budget() diff --git a/frsh_spare_capacity.h b/frsh_spare_capacity.h index 578f5c9..3d34463 100644 --- a/frsh_spare_capacity.h +++ b/frsh_spare_capacity.h @@ -104,7 +104,7 @@ * - Specifying a fairness measurement to compete with other servers in the * division of the share. * - * - Specifying a stability_time period for servers that need to have + * - Specifying a stability_time time for servers that need to have * a assigned capacity remain const during time (they would be * annoyed if their budget or period would change). * @@ -115,7 +115,7 @@ * capacity at NEGOTIATION TIME. This is the minimum capacity * that the server will get based on contract negotiation. * This capacity is distributed based on the importance and - * quality values and is known before-hand at the beginning of + * weight values and is known before-hand at the beginning of * a period. * * Besides this extra capacity, there is the DYNAMIC extra @@ -146,11 +146,11 @@ * * 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 + * utilization set, weight, and importance to the specified input * parameters. * * @param contract Contract object - * @param stability_time Time in which FRSH guarantees that the + * @param remaining_stability_time Time in which FRSH guarantees that the * assigned budget and period will remain permanent * even across renegotiations. * @param budget_max The maximum budget that the server aspires to @@ -163,9 +163,9 @@ * @param utilization_set A structure of discrete pairs (budget,period) * @param importance non-cooperative urgency indicator. Server with * higher importance will get all spare capacity des - * @param quality cooperative urgency indicator. At equal + * @param weight cooperative urgency indicator. At equal * importance, spare capacity will be distributed - * proportionally to quality levels. + * proportionally to weight levels. * * @return 0 if successful * FRSH_ERR_BAD_ARGUMENT : if contract is NULL or @@ -179,7 +179,7 @@ * (utilization_set is not FRSH_NULL_UTILIZATION_SET and * (size of utilization_set less than 2 or greater * than FRSH_MAX_N_UTILIZATION_VALUES) ) or - * (quality < 0) or + * (weight < 0) or * (importance is less than 1 or greater than FRSH_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 @@ -189,13 +189,13 @@ * **/ int frsh_set_contract_reclamation_parameters(frsh_contract_parameters_t *contract, - const struct timespec *stability_time, + const struct timespec *remaining_stability_time, const struct timespec *budget_max, const struct timespec *period_min, frsh_granularity_t granularity, const frsh_utilization_set_t *utilization_set, int importance, - int quality); + int weight); /** * frsh_get_contract_reclamation_parameters() @@ -216,13 +216,13 @@ int frsh_set_contract_reclamation_parameters(frsh_contract_parameters_t *contr **/ int frsh_get_contract_reclamation_parameters (const frsh_contract_parameters_t *contract, - struct timespec *stability_time, + struct timespec *remaining_stability_time, struct timespec *budget_max, struct timespec *period_min, frsh_granularity_t *granularity, frsh_utilization_set_t *utilization_set, int *importance,, - int *quality); + int *weight); @@ -247,17 +247,19 @@ int frsh_get_contract_reclamation_parameters **/ int frsh_get_available_capacity(frsh_server_id_t server, uint32_t *capacity); + + /** - * frsh_get_total_quality() + * frsh_get_total_weight() * - * This operation calculates the sum of the quality parameters for all + * This operation calculates the sum of the weight 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. + * total_weight. * * @return 0 if successful * FRSH_ERR_BAD_ARGUMENT : if the value of the server argument is not in range or - * total_quality is NULL + * total_weight is NULL * FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not * scheduled under the FRSH * FRSH_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not running @@ -265,8 +267,25 @@ int frsh_get_available_capacity(frsh_server_id_t server, uint32_t *capacity); * is not valid * ] **/ -int frsh_get_total_quality - (frsh_server_id_t server, int *total_quality); +int frsh_get_total_weight + (frsh_server_id_t server, int *total_weight); + + +/** + * frsh_decrease_capacity() + * + * This operation is mainly intended for distributed systems but may + * also be useful for control application in uniprocessor systems. + * + * It allows the server to ask for less budget and period that what he + * has actually received. The request must be compatible with the + * rest of contract parameters. + * + **/ +int frsh_decrease_capacity(frsh_server_id_t server, + timespec new_budget, + timespec new_period); + /*@}*/ -- 2.39.2