CPU scheduler commands


Data Structures

struct  _vx_sched
 Scheduler values. More...
struct  _vx_sched_info
 Scheduler information. More...

Defines

#define VXSM_FILL_RATE   0x0001
#define VXSM_INTERVAL   0x0002
#define VXSM_FILL_RATE2   0x0004
#define VXSM_INTERVAL2   0x0008
#define VXSM_TOKENS   0x0010
#define VXSM_TOKENS_MIN   0x0020
#define VXSM_TOKENS_MAX   0x0040
#define VXSM_PRIO_BIAS   0x0100
#define VXSM_IDLE_TIME   0x0200
#define VXSM_FORCE   0x0400
#define VXSM_CPU_ID   0x1000
#define VXSM_BUCKET_ID   0x2000
#define VXSM_MSEC   0x4000
#define VXSM_V3_MASK   0x0173
#define VXSM_SET_MASK   0x01FF

Typedefs

typedef _vx_sched vx_sched_t
 Scheduler values.
typedef _vx_sched_info vx_sched_info_t
 Scheduler information.

Functions

int vx_sched_set (xid_t xid, vx_sched_t *data)
 Set scheduler values.
int vx_sched_get (xid_t xid, vx_sched_t *data)
 Get scheduler values.
int vx_sched_info (xid_t xid, vx_sched_info_t *data)
 Get scheduler information.


Define Documentation

#define VXSM_FILL_RATE   0x0001

Fill Rate

Definition at line 353 of file vserver.h.

#define VXSM_INTERVAL   0x0002

Interval

Definition at line 354 of file vserver.h.

#define VXSM_FILL_RATE2   0x0004

IDLE Fill Rate

Definition at line 355 of file vserver.h.

#define VXSM_INTERVAL2   0x0008

IDLE Interval

Definition at line 356 of file vserver.h.

#define VXSM_TOKENS   0x0010

Amount of tokens

Definition at line 357 of file vserver.h.

#define VXSM_TOKENS_MIN   0x0020

Minimum amount of tokens

Definition at line 358 of file vserver.h.

#define VXSM_TOKENS_MAX   0x0040

Maximum amount of tokens

Definition at line 359 of file vserver.h.

#define VXSM_PRIO_BIAS   0x0100

Priority bias

Definition at line 360 of file vserver.h.

#define VXSM_IDLE_TIME   0x0200

Use IDLE time settings

Definition at line 362 of file vserver.h.

#define VXSM_FORCE   0x0400

Force scheduler reload (SMP only)

Definition at line 363 of file vserver.h.

#define VXSM_CPU_ID   0x1000

CPU ID (SMP only)

Definition at line 364 of file vserver.h.

#define VXSM_BUCKET_ID   0x2000

Bucket ID

Definition at line 365 of file vserver.h.

#define VXSM_MSEC   0x4000

??

Definition at line 366 of file vserver.h.

#define VXSM_V3_MASK   0x0173

Mask all fields for scheduler v3

Definition at line 368 of file vserver.h.

#define VXSM_SET_MASK   0x01FF

Mask all fields for set_sched

Definition at line 369 of file vserver.h.


Typedef Documentation

typedef struct _vx_sched vx_sched_t

Scheduler values.

typedef struct _vx_sched_info vx_sched_info_t

Scheduler information.


Function Documentation

int vx_sched_set ( xid_t  xid,
vx_sched_t data 
)

Set scheduler values.

Parameters:
xid Context ID
data Scheduler values

Definition at line 53 of file sched.c.

References _vx_sched::cpu_id, _vx_sched::fill_rate, _vx_sched::interval, _vx_sched::mask, _vx_sched::prio_bias, _vx_sched::tokens, _vx_sched::tokens_max, _vx_sched::tokens_min, and vserver().

00054 {
00055         struct vcmd_sched_v5 kdata;
00056 
00057         if (!data)
00058                 return errno = EINVAL, -1;
00059 
00060         kdata.mask         = data->mask;
00061         kdata.cpu_id       = data->cpu_id;
00062         kdata.fill_rate[0] = data->fill_rate[0];
00063         kdata.fill_rate[1] = data->fill_rate[1];
00064         kdata.interval[0]  = data->interval[0];
00065         kdata.interval[1]  = data->interval[1];
00066         kdata.tokens       = data->tokens;
00067         kdata.tokens_min   = data->tokens_min;
00068         kdata.tokens_max   = data->tokens_max;
00069         kdata.prio_bias    = data->prio_bias;
00070 
00071         return vserver(VCMD_set_sched, xid, &kdata);
00072 }

int vx_sched_get ( xid_t  xid,
vx_sched_t data 
)

Get scheduler values.

Parameters:
xid Context ID
data Scheduler values

Definition at line 25 of file sched.c.

References _vx_sched::bucket_id, _vx_sched::cpu_id, _vx_sched::fill_rate, _vx_sched::interval, _vx_sched::mask, _vx_sched::prio_bias, _vx_sched::tokens, _vx_sched::tokens_max, _vx_sched::tokens_min, and vserver().

00026 {
00027         struct vcmd_sched_v5 kdata;
00028 
00029         if (!data)
00030                 return errno = EINVAL, -1;
00031 
00032         kdata.cpu_id    = data->cpu_id;
00033         kdata.bucket_id = data->bucket_id;
00034         kdata.mask      = data->mask;
00035 
00036         int rc = vserver(VCMD_get_sched, xid, &kdata);
00037 
00038         if (rc == -1)
00039                 return -1;
00040 
00041         data->fill_rate[0] = kdata.fill_rate[0];
00042         data->fill_rate[1] = kdata.fill_rate[1];
00043         data->interval[0]  = kdata.interval[0];
00044         data->interval[1]  = kdata.interval[1];
00045         data->tokens       = kdata.tokens;
00046         data->tokens_min   = kdata.tokens_min;
00047         data->tokens_max   = kdata.tokens_max;
00048         data->prio_bias    = kdata.prio_bias;
00049 
00050         return rc;
00051 }

int vx_sched_info ( xid_t  xid,
vx_sched_info_t data 
)

Get scheduler information.

Parameters:
xid Context ID
data Scheduler information

Definition at line 74 of file sched.c.

References _vx_sched_info::bucket_id, _vx_sched_info::cpu_id, _vx_sched_info::hold_msec, _vx_sched_info::sys_msec, _vx_sched_info::token_usec, _vx_sched_info::user_msec, _vx_sched_info::vavavoom, and vserver().

00075 {
00076         struct vcmd_sched_info kdata;
00077 
00078         if (!data)
00079                 return errno = EINVAL, -1;
00080 
00081         kdata.cpu_id = data->cpu_id;
00082         kdata.bucket_id = data->bucket_id;
00083 
00084         int rc = vserver(VCMD_sched_info, xid, &kdata);
00085 
00086         if (rc == -1)
00087                 return -1;
00088 
00089         data->user_msec  = kdata.user_msec;
00090         data->sys_msec   = kdata.sys_msec;
00091         data->hold_msec  = kdata.hold_msec;
00092         data->token_usec = kdata.token_usec;
00093         data->vavavoom   = kdata.vavavoom;
00094 
00095         return rc;
00096 }


Generated on Wed Jun 20 19:50:09 2007 for libvserver by  doxygen 1.5.2