4 1. Configure "Class based physical memory controller" under CKRM (see
5 Documentation/ckrm/installation)
7 2. Reboot the system with the new kernel.
9 3. Verify that the memory controller is present by reading the file
10 /rcfs/taskclass/config (should show a line with res=mem)
15 For brevity, unless otherwise specified all the following commands are
16 executed in the default class (/rcfs/taskclass).
18 Initially, the systemwide default class gets 100% of the LRU pages, and the
19 stats file at the /rcfs/taskclass level displays the total number of
24 System: tot_pages=239778,active=60473,inactive=135285,free=44555
26 res=mem,guarantee=-2,limit=-2,total_guarantee=100,max_limit=100
28 tot_pages - total number of pages
29 active - number of pages in the active list ( sum of all zones)
30 inactive - number of pages in the inactive list ( sum of all zones)
31 free - number of free pages (sum of all zones)
33 By making total_guarantee and max_limit to be same as tot_pages, one can
34 make the numbers in shares file be same as the number of pages for a
37 # echo 'res=mem,total_guarantee=239778,max_limit=239778' > shares
39 res=mem,guarantee=-2,limit=-2,total_guarantee=239778,max_limit=239778
41 Changing configuration parameters:
42 ----------------------------------
43 For description of the paramters read the file mem_rc.design in this same directory.
45 Following is the default values for the configuration parameters:
47 localhost:~ # cd /rcfs/taskclass
48 localhost:/rcfs/taskclass # cat config
49 res=mem,fail_over=110,shrink_at=90,shrink_to=80,num_shrinks=10,shrink_interval=10
51 Here is how to change a specific configuration parameter. Note that more than one
52 configuration parameter can be changed in a single echo command though for simplicity
55 ex: Changing fail_over:
56 localhost:/rcfs/taskclass # echo "res=mem,fail_over=120" > config
57 localhost:/rcfs/taskclass # cat config
58 res=mem,fail_over=120,shrink_at=90,shrink_to=80,num_shrinks=10,shrink_interval=10
60 ex: Changing shrink_at:
61 localhost:/rcfs/taskclass # echo "res=mem,shrink_at=85" > config
62 localhost:/rcfs/taskclass # cat config
63 res=mem,fail_over=120,shrink_at=85,shrink_to=80,num_shrinks=10,shrink_interval=10
65 ex: Changing shrink_to:
66 localhost:/rcfs/taskclass # echo "res=mem,shrink_to=75" > config
67 localhost:/rcfs/taskclass # cat config
68 res=mem,fail_over=120,shrink_at=85,shrink_to=75,num_shrinks=10,shrink_interval=10
70 ex: Changing num_shrinks:
71 localhost:/rcfs/taskclass # echo "res=mem,num_shrinks=20" > config
72 localhost:/rcfs/taskclass # cat config
73 res=mem,fail_over=120,shrink_at=85,shrink_to=75,num_shrinks=20,shrink_interval=10
75 ex: Changing shrink_interval:
76 localhost:/rcfs/taskclass # echo "res=mem,shrink_interval=15" > config
77 localhost:/rcfs/taskclass # cat config
78 res=mem,fail_over=120,shrink_at=85,shrink_to=75,num_shrinks=20,shrink_interval=15
85 Its initial share is DONT_CARE. The parent's share values will be unchanged.
87 Setting a new class share
88 -------------------------
90 # echo 'res=mem,guarantee=25000,limit=50000' > c1/shares
93 res=mem,guarantee=25000,limit=50000,total_guarantee=100,max_limit=100
95 'guarantee' specifies the number of pages this class entitled to get
96 'limit' is the maximum number of pages this class can get.
101 stats file shows statistics of the page usage of a class
103 ----------- Memory Resource stats start -----------
104 System: tot_pages=239778,active=60473,inactive=135285,free=44555
105 Number of pages used(including pages lent to children): 196654
106 Number of pages guaranteed: 239778
107 Maximum limit of pages: 239778
108 Total number of pages available(after serving guarantees to children): 214778
109 Number of pages lent to children: 0
110 Number of pages borrowed from the parent: 0
111 ----------- Memory Resource stats end -----------