This stack check implementation leverages the compiler's profiling (gcc -p)
[linux-2.6.git] / Documentation / ckrm / rbce_usage
1 Usage of CKRM with RBCE
2 --------------------------
3
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.
8
9 1. Change ckrm/rbce/Makefile's KDIR to point to this compiled kernel's source
10    tree and call make
11
12 2. Load rbce module.
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
17    rules.
18
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)
21
22 3. Defining a rule
23    Rules are defined by creating(by writing) to a file under the
24    /rcfs/ce/rules directory by concatinating multiple attribute value
25    pairs.
26
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
31    /rcfs/taskclass/c1
32
33 4. Viewing a rule
34    read the corresponding file.
35    to read rule r1, issue the command:
36       # cat /rcfs/ce/rules/r1
37
38 5. Changing a rule
39
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)
45
46    the command:
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
50
51    the command:
52      # echo uid=1005 > /rcfs/ce/rules/r1
53    will change the rule to
54      r1: uid=1005,class=/rcfs/taskclass/c1
55
56    the command:
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
60    
61    the command:
62      # echo depend=r4 > /rcfs/ce/rules/r1
63    will change the rule to
64      r1: uid=1004,depend=r4,class=/rcfs/taskclass/c2
65    
66    the command:
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
70    
71    the command:
72      # echo -depend=r1 > /rcfs/ce/rules/r1
73    will change the rule to
74      r1: uid=1004,class=/rcfs/taskclass/c2
75
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
81
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
85
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
89
90 9. Changing the state of a rule
91
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,
95    issue the command 
96    # echo "state=0" > /rcfs/ce/rules/r1
97
98