This stack check implementation leverages the compiler's profiling (gcc -p)
[linux-2.6.git] / Documentation / ckrm / mem_rc.usage
1 Installation
2 ------------
3
4 1. Configure "Class based physical memory controller" under CKRM (see
5       Documentation/ckrm/installation) 
6
7 2. Reboot the system with the new kernel.
8
9 3. Verify that the memory controller is present by reading the file
10    /rcfs/taskclass/config (should show a line with res=mem)
11
12 Usage
13 -----
14
15 For brevity, unless otherwise specified all the following commands are
16 executed in the default class (/rcfs/taskclass).
17
18 Initially, the systemwide default class gets 100% of the LRU pages, and the
19 config file displays the total number of physical pages.
20
21    # cd /rcfs/taskclass
22    # cat config
23    res=mem;tot_pages=239778,active=60473,inactive=135285,free=44555
24    # cat shares
25    res=mem,guarantee=-2,limit=-2,total_guarantee=100,max_limit=100
26
27    tot_pages - total number of pages
28    active    - number of pages in the active list ( sum of all zones)
29    inactive  - number of pages in the inactive list ( sum of all zones )
30    free      -  number of free pages (sum of all pages)
31
32    By making total_guarantee and max_limit to be same as tot_pages, one make 
33    make the numbers in shares file be same as the number of pages for a
34    class.
35
36    # echo 'res=mem,total_guarantee=239778,max_limit=239778' > shares
37    # cat shares
38    res=mem,guarantee=-2,limit=-2,total_guarantee=239778,max_limit=239778
39
40
41 Class creation 
42 --------------
43
44    # mkdir c1
45
46 Its initial share is don't care. The parent's share values will be unchanged.
47
48 Setting a new class share
49 -------------------------
50         
51    # echo 'res=mem,guarantee=25000,limit=50000' > c1/shares
52
53    # cat c1/shares      
54    res=mem,guarantee=25000,limit=50000,total_guarantee=100,max_limit=100
55         
56    'guarantee' specifies the number of pages this class entitled to get
57    'limit' is the maximum number of pages this class can get.
58
59 Monitoring
60 ----------
61
62 stats file shows statistics of the page usage of a class
63    # cat stats
64    ----------- Memory Resource stats start -----------
65    Number of pages used(including pages lent to children): 196654
66    Number of pages guaranteed: 239778
67    Maximum limit of pages: 239778
68    Total number of pages available(after serving guarantees to children): 214778
69    Number of pages lent to children: 0
70    Number of pages borrowed from the parent: 0
71    ----------- Memory Resource stats end -----------
72