enable kexec
[linux-2.6.git] / Documentation / ckrm / core_usage
1 Usage of CKRM without a classification engine
2 -----------------------------------------------
3
4 1. Create a class
5
6    # mkdir /rcfs/taskclass/c1
7    creates a taskclass named c1 , while
8    # mkdir /rcfs/socket_class/s1
9    creates a socketclass named s1 
10
11 The newly created class directory is automatically populated by magic files
12 shares, stats, members, target and config.
13
14 2. View default shares 
15
16    # cat /rcfs/taskclass/c1/shares
17
18    "guarantee=-2,limit=-2,total_guarantee=100,max_limit=100" is the default
19    value set for resources that have controllers registered with CKRM.
20
21 3. change shares of a <class>
22
23    One or more of the following fields can/must be specified
24        res=<res_name> #mandatory
25        guarantee=<number>
26        limit=<number>
27        total_guarantee=<number>
28        max_limit=<number>
29    e.g.
30         # echo "res=numtasks,limit=20" > /rcfs/taskclass/c1
31
32    If any of these parameters are not specified, the current value will be
33    retained. 
34
35 4. Reclassify a task (listening socket)
36
37    write the pid of the process to the destination class' target file
38    # echo 1004 > /rcfs/taskclass/c1/target      
39
40    write the "<ipaddress>\<port>" string to the destination class' target file 
41    # echo "0.0.0.0\32770"  > /rcfs/taskclass/c1/target
42
43 5. Get a list of tasks (sockets) assigned to a taskclass (socketclass)
44
45    # cat /rcfs/taskclass/c1/members
46    lists pids of tasks belonging to c1
47
48    # cat /rcfs/socket_class/s1/members
49    lists the ipaddress\port of all listening sockets in s1 
50
51 6. Get the statictics of different resources of a class
52
53    # cat /rcfs/tasksclass/c1/stats
54    shows c1's statistics for each resource with a registered resource
55    controller.
56
57    # cat /rcfs/socket_class/s1/stats
58    show's s1's stats for the listenaq controller.       
59
60 7. View the configuration values of the resources associated with a class
61
62    # cat /rcfs/taskclass/c1/config
63    shows per-controller config values for c1.
64
65 8. Change the configuration values of resources associated with a class
66    Configuration values are different for different resources. the comman
67    field "res=<resname>" must always be specified.
68
69    # echo "res=numtasks,parameter=value" > /rcfs/taskclass/c1/config
70    to change (without any effect), the value associated with <parameter>.
71
72