1 Usage of CKRM with RBCE
2 --------------------------
4 0. Ensure that a CKRM-enabled kernel with following options configured
5 has been compiled. At a minimum, core, rcfs and atleast one
6 classtype. For testing, it is recommended all classtypes and
7 resource controllers be compiled as modules.
9 1. Change ckrm/rbce/Makefile's KDIR to point to this compiled kernel's source
13 # insmod ckrm/rbce/rbce.ko
14 Note that /rcfs has to be mounted before this.
15 Note: this command should populate the directory /rcfs/ce with files
16 rbce_reclassify, rbce_tag, rbce_info, rbce_state and a directory
19 Note2: If these are not created automatically, just create them by
20 using the commands touch and mkdir.(bug that needs to be fixed)
23 Rules are defined by creating(by writing) to a file under the
24 /rcfs/ce/rules directory by concatinating multiple attribute value
27 Note that the classes must be defined before defining rules that
28 uses the classes. eg: the command # echo
29 "uid=1004,class=/rcfs/taskclass/c1" > /rcfs/ce/rules/r1 will define
30 a rule r1 that classifies all tasks belong to user id 1004 to class
34 read the corresponding file.
35 to read rule r1, issue the command:
36 # cat /rcfs/ce/rules/r1
40 Changing a rule is done the same way as defining a rule, the new
41 rule will include the old set of attr-value pairs slapped with new
42 attr-value pairs. eg: if the current r2 is
43 uid=1004,depend=r1,class=/rcfs/taskclass/c1
44 (r1 as defined in step 3)
47 # echo gid=502 > /rcfs/ce/rules/r1
48 will change the rule to
49 r1: uid=1004,gid=502,depend=r1,class=/rcfs/taskclass/c1
52 # echo uid=1005 > /rcfs/ce/rules/r1
53 will change the rule to
54 r1: uid=1005,class=/rcfs/taskclass/c1
57 # echo class=/rcfs/taskclass/c2 > /rcfs/ce/rules/r1
58 will change the rule to
59 r1: uid=1004,depend=r1,class=/rcfs/taskclass/c2
62 # echo depend=r4 > /rcfs/ce/rules/r1
63 will change the rule to
64 r1: uid=1004,depend=r4,class=/rcfs/taskclass/c2
67 # echo +depend=r4 > /rcfs/ce/rules/r1
68 will change the rule to
69 r1: uid=1004,depend=r1,depend=r4,class=/rcfs/taskclass/c2
72 # echo -depend=r1 > /rcfs/ce/rules/r1
73 will change the rule to
74 r1: uid=1004,class=/rcfs/taskclass/c2
76 6. Checking the state of RBCE
77 State(enabled/disabled) of RBCE can be checked by reading the file
78 /rcfs/ce/rbce_state, it will show 1(enabled) or 0(disabled).
79 By default, RBCE is enabled(1).
80 ex: # cat /rcfs/ce/rbce_state
82 7. Changing the state of RBCE
83 State of RBCE can be changed by writing 1(enable) or 0(disable).
84 ex: # echo 1 > cat /rcfs/ce/rbce_state
86 8. Checking the state of a rule
87 State of a rule is displayed in the rule. Rule can be viewed by
88 reading the rule file. ex: # cat /rcfs/ce/rules/r1
90 9. Changing the state of a rule
92 State of a rule can be changed by writing "state=1"(enable) or
93 "state=0"(disable) to the corresponding rule file. By defeault, the
94 rule is enabled when defined. ex: to disable an existing rule r1,
96 # echo "state=0" > /rcfs/ce/rules/r1