Main QRES server "class" implementation file. More...
#include <linux/aquosa/rres_config.h>
#include "qres_config.h"
#include <linux/aquosa/qos_debug.h>
#include <linux/posix-timers.h>
#include <linux/time.h>
#include <linux/aquosa/qos_prof.h>
#include <linux/aquosa/qos_types.h>
#include "qres_gw.h"
#include <linux/aquosa/rres_interface.h>
#include <linux/aquosa/rres_kpi_protected.h>
#include <linux/aquosa/qos_kernel_dep.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <linux/sched.h>
#include "qsup_gw.h"
#include "qsup.h"
#include <linux/aquosa/kal_sched.h>
#include "qres_interface.h"
#include <linux/aquosa/qos_memory.h>
#include <linux/aquosa/qos_func.h>
#include <linux/aquosa/rres.h>
Go to the source code of this file.
Defines | |
#define | QOS_DEBUG_LEVEL QRES_MOD_DEBUG_LEVEL |
Functions | |
qos_rv | qres_init (void) |
Static QRES constructor. | |
qos_rv | qres_cleanup (void) |
Static QRES destructor. | |
static qos_bool_t | authorize_for_task (struct task_struct *tsk) |
Check authorizations for operations affecting a task. | |
static qos_bool_t | authorize_for_server (qres_server_t *qres) |
Check authorizations for operations affecting an existing server. | |
qos_func_define (qos_rv, qres_create_server, qres_params_t *param, qres_sid_t *p_sid) | |
QRES Factory Method. | |
void | qres_update_bandwidths (void) |
qos_func_define (qos_rv, qres_init_server, qres_server_t *qres, qres_params_t *param) | |
QRES Server constructor. | |
qos_func_define (qos_rv, qres_destroy_server, qres_server_t *qres) | |
qos_func_define (qos_rv, _qres_cleanup_server, server_t *rres) | |
Non-virtual QRES server destructor. | |
qos_bw_t | _qres_get_bandwidth (server_t *srv) |
Non-virtual bandwidth getter. | |
qos_func_define (qos_rv, qres_attach_task, qres_server_t *qres, struct task_struct *tsk) | |
Attach to the server identified by srv_id the task identified by tsk. | |
qos_func_define (qos_rv, qres_detach_task, qres_server_t *qres, struct task_struct *tsk) | |
Asks the RRES to detach the current task from its server. | |
qos_func_define (qos_rv, qres_set_params, qres_server_t *qres, qres_params_t *param) | |
Set QRES server parameters Q, Q_min and P. | |
qos_func_define (qos_rv, qres_get_params, qres_server_t *qres, qres_params_t *params) | |
qos_func_define (qres_time_t, qres_get_curr_budget, qres_server_t *qres) | |
qos_func_define (qres_time_t, qres_get_next_budget, qres_server_t *qres) | |
qos_func_define (qres_time_t, qres_get_appr_budget, qres_server_t *qres) | |
qos_func_define (qos_rv, qres_get_deadline, qres_server_t *qres, struct timespec *p_deadline) | |
qos_func_define (qos_rv, qres_get_exec_abs_time, qres_server_t *qres, qres_time_t *exec_time, qres_atime_t *abs_time) | |
kal_uid_t | qres_get_owner_uid (qres_server_t *qres) |
Return the user id of the owner of the server. | |
EXPORT_SYMBOL_GPL (qres_get_owner_uid) | |
kal_gid_t | qres_get_owner_gid (qres_server_t *qres) |
Return the group id of the owner of the server. | |
EXPORT_SYMBOL_GPL (qres_get_owner_gid) | |
EXPORT_SYMBOL_GPL (qres_create_server) | |
EXPORT_SYMBOL_GPL (qres_destroy_server) | |
EXPORT_SYMBOL_GPL (qres_attach_task) | |
EXPORT_SYMBOL_GPL (qres_detach_task) | |
EXPORT_SYMBOL_GPL (qres_set_params) | |
EXPORT_SYMBOL_GPL (qres_get_params) | |
EXPORT_SYMBOL_GPL (qres_get_exec_abs_time) | |
EXPORT_SYMBOL_GPL (qres_get_deadline) | |
EXPORT_SYMBOL_GPL (_qres_get_bandwidth) | |
EXPORT_SYMBOL_GPL (_qres_cleanup_server) |
Main QRES server "class" implementation file.
Implements all operations defined for a QRES server.
Definition in file qresmod/qres.c.
#define QOS_DEBUG_LEVEL QRES_MOD_DEBUG_LEVEL |
Definition at line 18 of file qresmod/qres.c.
Non-virtual bandwidth getter.
Definition at line 257 of file qresmod/qres.c.
References _rres_get_bandwidth(), qres_find_by_rres(), qsup_get_approved_bw(), and qres_server::rres.
Referenced by qos_func_define().
static qos_bool_t authorize_for_server | ( | qres_server_t * | qres | ) | [static] |
Check authorizations for operations affecting an existing server.
Definition at line 86 of file qresmod/qres.c.
References qres_get_owner_uid().
Referenced by qos_func_define().
static qos_bool_t authorize_for_task | ( | struct task_struct * | tsk | ) | [static] |
Check authorizations for operations affecting a task.
Operations on a process different from the current one are only allowed if the two processes have the same euid, or if the calling process is effectively-owned by the super-user.
tsk | Pointer to the task_struct corresponding to process that is going to be affected by the operation. |
Definition at line 77 of file qresmod/qres.c.
Referenced by qos_func_define().
EXPORT_SYMBOL_GPL | ( | _qres_cleanup_server | ) |
EXPORT_SYMBOL_GPL | ( | _qres_get_bandwidth | ) |
EXPORT_SYMBOL_GPL | ( | qres_get_deadline | ) |
EXPORT_SYMBOL_GPL | ( | qres_get_exec_abs_time | ) |
EXPORT_SYMBOL_GPL | ( | qres_get_params | ) |
EXPORT_SYMBOL_GPL | ( | qres_set_params | ) |
EXPORT_SYMBOL_GPL | ( | qres_detach_task | ) |
EXPORT_SYMBOL_GPL | ( | qres_attach_task | ) |
EXPORT_SYMBOL_GPL | ( | qres_destroy_server | ) |
EXPORT_SYMBOL_GPL | ( | qres_create_server | ) |
EXPORT_SYMBOL_GPL | ( | qres_get_owner_gid | ) |
EXPORT_SYMBOL_GPL | ( | qres_get_owner_uid | ) |
qos_func_define | ( | qos_rv | , | |
qres_get_exec_abs_time | , | |||
qres_server_t * | qres, | |||
qres_time_t * | exec_time, | |||
qres_atime_t * | abs_time | |||
) |
Definition at line 378 of file qresmod/qres.c.
References kal_time2usec(), kal_time_now(), QOS_OK, qres_server::rres, and rres_get_exec_time().
qos_func_define | ( | qos_rv | , | |
qres_get_deadline | , | |||
qres_server_t * | qres, | |||
struct timespec * | p_deadline | |||
) |
Definition at line 374 of file qresmod/qres.c.
References qres_server::rres, and rres_get_deadline().
qos_func_define | ( | qres_time_t | , | |
qres_get_appr_budget | , | |||
qres_server_t * | qres | |||
) |
Definition at line 370 of file qresmod/qres.c.
References bw2Q(), qres_params_t::P, qres_server::params, qres_server::rres, and rres_get_bandwidth().
qos_func_define | ( | qres_time_t | , | |
qres_get_next_budget | , | |||
qres_server_t * | qres | |||
) |
Definition at line 366 of file qresmod/qres.c.
References bw2Q(), qres_params_t::P, qres_server::params, qres_server::rres, and rres_get_current_bandwidth().
qos_func_define | ( | qres_time_t | , | |
qres_get_curr_budget | , | |||
qres_server_t * | qres | |||
) |
Definition at line 362 of file qresmod/qres.c.
References qres_server::rres, and rres_get_curr_budget().
qos_func_define | ( | qos_rv | , | |
qres_get_params | , | |||
qres_server_t * | qres, | |||
qres_params_t * | params | |||
) |
Definition at line 356 of file qresmod/qres.c.
References qres_server::params, qos_chk_do, QOS_E_INTERNAL_ERROR, and QOS_OK.
qos_func_define | ( | qos_rv | , | |
qres_set_params | , | |||
qres_server_t * | qres, | |||
qres_params_t * | param | |||
) |
Set QRES server parameters Q, Q_min and P.
Definition at line 313 of file qresmod/qres.c.
References authorize_for_server(), bw2Q(), qres_params_t::flags, MIN_SRV_MAX_BUDGET, MIN_SRV_PERIOD, qres_server::owner_gid, qres_server::owner_uid, qres_params_t::P, qres_server::params, qres_params_t::Q, qres_params_t::Q_min, qos_chk_do, qos_chk_ok_ret, QOS_E_INTERNAL_ERROR, QOS_E_INVALID_PARAM, QOS_E_UNAUTHORIZED, QOS_E_UNIMPLEMENTED, qos_log_debug, QOS_OK, QRES_TIME_FMT, qsup_cleanup_server(), qsup_get_approved_bw(), qsup_init_server(), qsup_set_required_bw(), r2bw(), r2bw_ceil(), qres_server::rres, and rres_set_params().
qos_func_define | ( | qos_rv | , | |
qres_detach_task | , | |||
qres_server_t * | qres, | |||
struct task_struct * | tsk | |||
) |
Asks the RRES to detach the current task from its server.
If the detached task was the last one attached to the server, then this function asks supervisor to destroy information associated to this server, and also asks the RRES to destroy the server related info.
Definition at line 293 of file qresmod/qres.c.
References authorize_for_server(), authorize_for_task(), qos_chk_do, qos_chk_ok_ret, QOS_E_INTERNAL_ERROR, QOS_E_NOT_FOUND, QOS_E_UNAUTHORIZED, QOS_OK, qsup_set_required_bw(), qres_server::rres, rres_check_destroy(), rres_detach_task(), and rres_has_ready_tasks().
qos_func_define | ( | qos_rv | , | |
qres_attach_task | , | |||
qres_server_t * | qres, | |||
struct task_struct * | tsk | |||
) |
Attach to the server identified by srv_id the task identified by tsk.
Definition at line 268 of file qresmod/qres.c.
References authorize_for_server(), authorize_for_task(), qres_params_t::P, qres_server::params, qres_params_t::Q, qos_chk_do, qos_chk_ok_ret, QOS_E_INTERNAL_ERROR, QOS_E_UNAUTHORIZED, QOS_OK, qsup_set_required_bw(), r2bw(), qres_server::rres, rres_attach_task(), and rres_has_ready_tasks().
Non-virtual QRES server destructor.
Definition at line 233 of file qresmod/qres.c.
References _rres_cleanup_server(), _rres_get_bandwidth(), authorize_for_server(), server_t::cleanup, server_t::get_bandwidth, qos_chk_do, qos_chk_ok_ret, QOS_E_INTERNAL_ERROR, QOS_E_UNAUTHORIZED, QOS_OK, qres_find_by_rres(), qsup_cleanup_server(), and qres_server::rres.
qos_func_define | ( | qos_rv | , | |
qres_destroy_server | , | |||
qres_server_t * | qres | |||
) |
Definition at line 217 of file qresmod/qres.c.
References qos_chk_do, qos_chk_ok_ret, QOS_E_INTERNAL_ERROR, QOS_OK, qres_server::rres, rres_any_blocked_task(), rres_any_ready_task(), rres_destroy_server(), and rres_detach_task().
qos_func_define | ( | qos_rv | , | |
qres_init_server | , | |||
qres_server_t * | qres, | |||
qres_params_t * | param | |||
) |
QRES Server constructor.
Compute Q value as approved by supervisor
Then, create associated RRES resources
Definition at line 122 of file qresmod/qres.c.
References _qres_cleanup_server(), _qres_get_bandwidth(), bw2Q(), bw_min(), server_t::cleanup, qres_params_t::flags, server_t::get_bandwidth, MIN_SRV_MAX_BUDGET, MIN_SRV_PERIOD, qres_server::owner_gid, qres_server::owner_uid, qres_params_t::P, qres_server::params, qres_params_t::Q, qres_params_t::Q_min, QOS_BW_FMT, qos_chk_do, qos_chk_ok_ret, QOS_E_INTERNAL_ERROR, QOS_E_INVALID_PARAM, QOS_E_UNAUTHORIZED, QOS_F_DEFAULT, qos_log_debug, qos_log_info, QOS_OK, qos_strerror(), QRES_TIME_FMT, qres_update_bandwidths(), qsup_cleanup_server(), QSUP_DEFAULT_SRV_GID, QSUP_DEFAULT_SRV_UID, qsup_get_approved_bw(), qsup_init_server(), qsup_set_required_bw(), r2bw(), r2bw_ceil(), qres_server::rres, and rres_init_server().
qos_func_define | ( | qos_rv | , | |
qres_create_server | , | |||
qres_params_t * | param, | |||
qres_sid_t * | p_sid | |||
) |
QRES Factory Method.
Definition at line 92 of file qresmod/qres.c.
References qres_params_t::flags, qres_params_t::P, qres_params_t::Q, qres_params_t::Q_min, qos_chk_do, qos_chk_rv, qos_create, QOS_E_INTERNAL_ERROR, QOS_E_NO_MEMORY, qos_free(), qos_log_debug, qos_log_info, QOS_OK, qos_strerror(), qres_init_server(), QRES_TIME_FMT, qres_server::rres, and rres_get_sid().
void qres_update_bandwidths | ( | void | ) |
Definition at line 112 of file qresmod/qres.c.
References bw2Q(), for_each_server, q, rres_get_bandwidth(), rres_get_period(), rres_set_budget(), and srv.
Referenced by qos_func_define().