qres_gw_ks.c File Reference

Main QRES kernel module implementation file. More...

#include <linux/aquosa/rres_config.h>
#include "qres_config.h"
#include <linux/aquosa/qos_debug.h>
#include <linux/aquosa/qos_prof.h>
#include "qres_gw_ks.h"
#include "qsup_gw_ks.h"
#include "qres_kpi_protected.h"
#include <linux/aquosa/qos_types.h>
#include <linux/aquosa/qos_memory.h>
#include <linux/aquosa/qos_func.h>
#include <linux/aquosa/kal_sched.h>

Go to the source code of this file.

Defines

#define QOS_DEBUG_LEVEL   QRES_MOD_DEBUG_LEVEL
#define COPY_FROM_USER_TO(void_ptr, size, typed_ptr)
 Find the task identified by <pid, tid>, and check if affecting its reservation status would be legal or not.
#define call_sync(func)

Functions

static qos_rv find_task (pid_t pid, tid_t tid, struct task_struct **p_ptsk)
 Find the thread identified by the caller through <pid, tid>.
 qos_func_define (qos_rv, qres_gw_destroy_server, qres_sid_t sid)
 qos_func_define (qos_rv, qres_gw_attach_task, qres_attach_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_detach_task, qres_attach_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_set_params, qres_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_params, qres_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_exec_time, qres_time_iparams_t *iparams)
 Get the execution time of the server since its creation.
 qos_func_define (qos_rv, qres_gw_get_curr_budget, qres_time_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_next_budget, qres_time_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_appr_budget, qres_time_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_server_id, qres_attach_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_deadline, qres_timespec_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_set_weight, qres_weight_iparams_t *iparams)
 qos_func_define (qos_rv, qres_gw_get_weight, qres_weight_iparams_t *iparams)
qos_rv qres_gw_ks (qres_op_t op, void __user *up_iparams, unsigned long size)
 Main US-to-KS gateway function.

Detailed Description

Main QRES kernel module implementation file.

Handle all requests made on server through the QRES library.

Todo:
Add creation flag that, if set, allows to set required bandwidth to zero when the rres server has no activations (should be optional as it may introduce a latency in reclaiming back the given-away bandwidth when the server activates back).

Definition in file qres_gw_ks.c.


Define Documentation

#define call_sync ( func   ) 
Value:
({                                      \
  kal_irq_state flags;                                          \
  qos_rv __rv;                                                  \
  kal_spin_lock_irqsave(rres_get_spinlock(), &flags);           \
  __rv = (func);                                                \
  kal_spin_unlock_irqrestore(rres_get_spinlock(), &flags);      \
  __rv;                                                         \
})

Definition at line 72 of file qres_gw_ks.c.

Referenced by qres_gw_ks().

#define COPY_FROM_USER_TO ( void_ptr,
size,
typed_ptr   ) 
Value:
do { \
  if ((size) != sizeof(*(typed_ptr))) {         \
    qos_log_crit("Got %lu bytes, expecting %zu", \
      (size), sizeof(*(typed_ptr)));            \
    return(QOS_E_INTERNAL_ERROR);               \
  }                                             \
  if (copy_from_user(typed_ptr, void_ptr, (size))) \
    return(QOS_E_INVALID_PARAM);                \
} while (0)

Find the task identified by <pid, tid>, and check if affecting its reservation status would be legal or not.

See also:
authorize_for_task(task_struct *) IOCTL helpers

Definition at line 62 of file qres_gw_ks.c.

Referenced by qres_gw_ks().

#define QOS_DEBUG_LEVEL   QRES_MOD_DEBUG_LEVEL

Definition at line 14 of file qres_gw_ks.c.


Function Documentation

static qos_rv find_task ( pid_t  pid,
tid_t  tid,
struct task_struct **  p_ptsk 
) [static]

Find the thread identified by the caller through <pid, tid>.

The caller thread may refer to itself as <0, 0>.

Definition at line 35 of file qres_gw_ks.c.

References current, qos_chk_do, QOS_E_INTERNAL_ERROR, QOS_E_INVALID_PARAM, and QOS_OK.

Referenced by qos_func_define().

qos_func_define ( qos_rv  ,
qres_gw_get_weight  ,
qres_weight_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_set_weight  ,
qres_weight_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_get_deadline  ,
qres_timespec_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_get_server_id  ,
qres_attach_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_get_appr_budget  ,
qres_time_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_get_next_budget  ,
qres_time_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_get_curr_budget  ,
qres_time_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_get_exec_time  ,
qres_time_iparams_t iparams 
)

Get the execution time of the server since its creation.

This is the total amount of time for which the tasks attached to the server have been scheduled by the system

Definition at line 133 of file qres_gw_ks.c.

References qres_time_iparams_t::abs_time, qres_time_iparams_t::exec_time, QOS_E_NOT_FOUND, qres_find_by_id(), qres_get_exec_abs_time(), and qres_time_iparams_t::server_id.

qos_func_define ( qos_rv  ,
qres_gw_get_params  ,
qres_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_set_params  ,
qres_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_detach_task  ,
qres_attach_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_attach_task  ,
qres_attach_iparams_t iparams 
)
qos_func_define ( qos_rv  ,
qres_gw_destroy_server  ,
qres_sid_t  sid 
)

Definition at line 81 of file qres_gw_ks.c.

References QOS_E_NOT_FOUND, qres_destroy_server(), and qres_find_by_id().

Generated on Mon Aug 2 22:39:17 2010 for qosres by  doxygen 1.6.3