File: sched_cmd.h

package info (click to toggle)
util-vserver 0.30.216-pre3054-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,556 kB
  • ctags: 3,909
  • sloc: ansic: 23,121; sh: 16,905; xml: 1,972; makefile: 383; python: 301; perl: 85; awk: 4
file content (100 lines) | stat: -rw-r--r-- 1,944 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef _VX_SCHED_CMD_H
#define _VX_SCHED_CMD_H


/*  sched vserver commands */

#define VCMD_set_sched_v2	VC_CMD(SCHED, 1, 2)
#define VCMD_set_sched_v3	VC_CMD(SCHED, 1, 3)
#define VCMD_set_sched_v4	VC_CMD(SCHED, 1, 4)

struct	vcmd_set_sched_v2 {
	int32_t fill_rate;
	int32_t interval;
	int32_t tokens;
	int32_t tokens_min;
	int32_t tokens_max;
	uint64_t cpu_mask;
};

struct	vcmd_set_sched_v3 {
	uint32_t set_mask;
	int32_t fill_rate;
	int32_t interval;
	int32_t tokens;
	int32_t tokens_min;
	int32_t tokens_max;
	int32_t priority_bias;
};

struct	vcmd_set_sched_v4 {
	uint32_t set_mask;
	int32_t fill_rate;
	int32_t interval;
	int32_t tokens;
	int32_t tokens_min;
	int32_t tokens_max;
	int32_t prio_bias;
	int32_t cpu_id;
	int32_t bucket_id;
};

#define VCMD_set_sched		VC_CMD(SCHED, 1, 5)
#define VCMD_get_sched		VC_CMD(SCHED, 2, 5)

struct	vcmd_sched_v5 {
	uint32_t mask;
	int32_t cpu_id;
	int32_t bucket_id;
	int32_t fill_rate[2];
	int32_t interval[2];
	int32_t tokens;
	int32_t tokens_min;
	int32_t tokens_max;
	int32_t prio_bias;
};

#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_V3_MASK		0x0173
#define	VXSM_SET_MASK		0x01FF

#define VXSM_CPU_ID		0x1000
#define VXSM_BUCKET_ID		0x2000

#define VXSM_MSEC		0x4000

#define SCHED_KEEP		(-2)	/* only for v2 */


#define VCMD_sched_info		VC_CMD(SCHED, 3, 0)

struct	vcmd_sched_info {
	int32_t cpu_id;
	int32_t bucket_id;
	uint64_t user_msec;
	uint64_t sys_msec;
	uint64_t hold_msec;
	uint32_t token_usec;
	int32_t vavavoom;
};

struct	vcmd_prio_bias {
	int32_t cpu_id;
	int32_t prio_bias;
};

#define VCMD_set_prio_bias	VC_CMD(SCHED, 4, 0)
#define VCMD_get_prio_bias	VC_CMD(SCHED, 5, 0)

#endif	/* _VX_SCHED_CMD_H */