conf: Add LmkThresholdLeave to set stop condition of LMK
[platform/core/system/resourced.git] / conf / README
1 Resourced Configurations
2 ========================
3
4 Index
5 =====
6 1. limiter.conf            : configurations to limit resources
7 2. optimizer.conf          : configurations to optimize resources
8 3. monitor.conf            : configurations to monitor resources
9 4. process.conf            : configurations to manage process
10 5. proc.conf               : configurations to specify the oom_score_adj for each app
11 6. limiter.conf.d/*.conf   : configurations to limit resources, for each app
12 7. optimizer.conf.d/*.conf : configurations to optimize resources, for each app
13 8. process.conf.d/*.conf   : configurations to manage process, for each app
14 9. vip-process.d/*.conf    : configurations to manage vip-process, for each app
15
16 File Format
17 ===========
18 Config file consists of two parts: section names and key-value pairs.
19 Section name should be located between '[' and ']'. (ex: [MemoryLevelThreshold])
20 The range of a section is: From the first appearance of section name to the EOF or the line before the next section starts
21 Example: [MemoryBackgroundLru]
22          BackgroundLruLimit=80%
23 Lines beginning with '#' are ignored.
24
25 Value Format
26 ============
27 Value format will be described as regular expression form.
28 Names enclosed with clamps(<...>) can be replaced with some value which described inside clamps.
29
30 1. limiter.conf
31 ===============
32
33 1.1 Section: MemoryBackgroundLru
34 =============================
35 Key: BackgroundLruLimit
36 Value: <limit ratio in percentage>%
37 Comment: Specify the memory cgroup BackgroundLru limit ratio in percentage.
38 Example: BackgroundLruLimit=80%
39
40 1.2 Section: MemoryLevelThreshold
41 =================================
42 Key: OomPopup
43 Value: (yes|1|ok|on|no|0|off)
44 Comment: Specify whether a popup is needed or not when the process is killed by LMK or proactive killer.
45          If (yes|1|ok|on), resoruced will request system popup when OOM occurred.
46          If (no|0|off), resoruced will not request system popup when OOM occurred.
47 Example: OomPopup=no
48
49 Key: MediumLevel
50 Value: <threshold>[GMK]B
51         or
52        <ratio>%
53 Comment: Specify the threshold or ratio for memory level medium.
54 Example: MediumLevel=400MB
55
56 Key: LowLevel
57 Value: <threshold>[GMK]B
58         or
59        <ratio>%
60 Comment: Specify the threshold or ratio for memory level low.
61 Example: LowLevel=300MB
62
63 Key: CriticalLevel
64 Value: <threshold>[GMK]B
65         or
66        <ratio>%
67 Comment: Specify the threshold or ratio for memory level critical.
68 Example: LowLevel=200MB
69
70 Key: OomLevel
71 Value: <threshold>[GMK]B
72         or
73        <ratio>%
74 Comment: Specify the threshold or ratio for memory level oom(out of memory).
75 Example: OomLevel=160MB
76
77 Key: LmkThresholdLeave
78 Value: <threshold>[GMK]B
79         or
80        <ratio>%
81 Comment: Specify the threshold or ratio for LMK stop.
82 Example: LmkThresholdLeave=160MB
83
84 1.3 Section: MemoryAppTypeLimit
85 ===============================
86 Key: ServicePerAppLimitAction
87 Value: <limit>[GMK]B,<action>
88 Comment: Specify the memory limitation of services.
89          <action> specifies an action to be performed when the limit is crossed.
90          <action> can be: broadcast, reclaim, kill, ignore
91 Example: ServicePerAppLimitAction=128MB,kill
92
93 Key: WidgetPerAppLimitAction
94 Value: <limit>[GMK]B,<action>
95 Comment: Specify the memory limitation of widgets.
96          <action> specifies an action to be performed when the limit is crossed.
97          <action> can be: broadcast, reclaim, kill, ignore
98 Example: WidgetPerAppLimitAction=160MB,kill
99
100 Key: GUIPerAppLimitAction
101 Value: <limit>[GMK]B,<action>
102 Comment: Specify the memory limitation of GUIs.
103          <action> specifies an action to be performed when the limit is crossed.
104          <action> can be: broadcast, reclaim, kill, ignore
105 Example: GUIPerAppLimitAction=160MB,kill
106
107 1.4 Section: MemoryAppStatusLimit
108 =================================
109 Key: BackgroundPerAppLimitAction
110 Value: <limit>[GMK]B,<action>
111 Comment: Specify the memory limitation of background apps.
112          <action> specifies an action to be performed when the limit is crossed.
113          <action> can be: broadcast, reclaim, kill, ignore
114 Example: BackgroundPerAppLimitAction=768MB,kill
115
116 1.5 Section: MemoryLimitTrigger
117 ===============================
118 Key: MemoryLimitTrigger
119 Value: oom or threshold or others
120 Comment: Specify the type of memory limit trigger type.
121          oom: If memory usage reaches limit, then cgroup oom will handle the situation.
122          threshold: If memory usage reaches limit, then resourced will kill the target without page reclaim.
123          others: If 'MemLimit(Action)' is turned on, just set memory limit.
124 Example: MemoryLimitTrigger=oom
125
126 1.6 Section: CpuThrottling
127 ==========================
128 Key: CpuSched
129 Value: <schedule scheme>
130 Comment: Specify the schedule scheme.
131          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
132 Example: CpuSched=idle
133
134 Key: CpuNice
135 Value: <nice value>
136 Comment: Specify the nice value.
137          <nice value> is an decimal integer value. (-20 ~ 19)
138 Example: CpuNice=-20
139
140 Key: CpuShare
141 Value: <share amount>
142 Comment: Specify ratio(%) of quota cpu share(= Lowest cgroup/root cgroup * 100)
143          <share amount> is an decimal unsigned integer value.
144 Example: CpuShare=2
145
146 Key: CpuCFSRuntime
147 Value: <cpu runtime>[ mu]?s
148 Comment: Specifies cfs_quota in milliseconds(m), microseconds(u) or seconds.
149          <cpu runtime> is an decimal unsigned integer value.
150 Example: CpuCFSRuntime=50000
151
152 Key: CpuCFSPeriod
153 Value: <cpu period>[ mu]?s
154 Comment: Specifies cfs_period in milliseconds(m), microseconds(u) or seconds.
155          <cpu period> is an decimal unsigned integer value.
156 Example: CpuCFSRuntime=50000
157
158 2. optimizer.conf
159 =================
160
161 2.1 Section: MemorySwap
162 =======================
163 Key: ReclaimAtBoot
164 Value: (yes|1|ok|on|no|0|off)
165 Comment: Specify whether reclaim is needed at boot time.
166          If (yes|1|ok|on), resourced reclaims the swap at booting time.
167          If (no|0|off), no raclaim.
168 Example: ReclaimAtBoot=yes
169
170 Key: SwapType
171 Value: <swapping type>([+|]+<swapping type>)*
172 Comment: Specify the type of memory swapping.
173          <swapping type> can be: zram, file, zswap
174 Example: SwapType=zram|file
175           or
176          SwapType=zram+file
177
178 Key: BackgroundLruSwappiness=80
179 Value: <swappiness>
180 Comment: Specify memory swappiness value.
181          <swappiness> is an decimal integer value.
182          Default swappiness is 60.
183          If <swappiness> < 60, the tendency of the kernel of swapping process memory will be decreased.
184          (But 0 does not mean no swapping)
185          If <swappiness> > 60, the tendency of the kernel of swapping process memory will be increased.
186          If <swappiness> > 100, then the kernel can swap out a part of the pages in the address space in this cgroup.
187 Example: BackgroundLruSwappiness=80
188
189 2.2 Section: MemoryZram
190 =======================
191 Key: CompAlgorithm
192 Value: <algorithm>
193 Comment: Specify an algorithm for zram swap comparing algorithm.
194          <algorithm> string value will be written to "/sys/block/zram0/comp_algorithm"
195          The value for <algorithm> can be found by `cat /sys/block/zram0/comp_algorithm`, please choose one of them.
196 Example: CompAlgorithm=zstd
197
198 Key: ZramRatio
199 Value: <ratio>
200 Comment: Specify the ratio of zram swap size. (ratio in total ram)
201          <ratio> is an float value, 0 to 1.
202 Example: ZramRatio=0.4
203
204 2.3 Section: MemoryZswap
205 ========================
206 Key: PoolRatio
207 Value: <ratio>
208 Comment: Specify the max ratio which the zswap pool can use. (/sys/module/zswap/parameters/max_pool_percent)
209          <ratio> is a percentage value.
210 Example: PoolRatio=25
211
212 Key: PoolType
213 Value: <type>
214 Comment: Specify the type of zswap pool. (/sys/module/zswap/parameters/zpool)
215          <type> is a string value of zswap pool type name.
216          (zbud, z3fold ...)
217
218 Example: PoolType=z3fold
219
220 2.4 Section: MemoryDedup
221 ========================
222 Key: DedupAtBoot
223 Value: (yes|1|ok|on|no|0|off)
224 Comment: Dedup removes duplication on memory.
225          Specify whether dedup is needed at boot time
226          If (yes|1|ok|on), dedup will be activated at boot time.
227          If (no|0|off), no dedup at boot time.
228 Example: DedupAtBoot=yes
229
230 Key: ScanOnLowmem
231 Value: (yes|1|ok|on|no|0|off)
232 Comment: Specify whether scanning for dedup is invoked by low memory event or periodic timer.
233          If (yes|1|ok|on), dedup is on.
234          If (no|0|off), no dedup.
235 Example: ScanOnLowmem=yes
236
237 2.5 Section: MemoryKsm
238 ======================
239 Key: KsmMode
240 Value: <mode>
241 Comment: Specify KSM(Kernsl Same-page Merging, dedup) mode.
242          <mode> can be: oneshot, periodic
243          oneshot: The KSM daemon only performs deduplication.
244          periodic: The kernel manages all behaviors of deduplication.
245 Example: KsmMode=periodic
246
247 Key: PagesToScan
248 Value: <pages>
249 Comment: Specify the number of pages to scan for deduplication.
250          <pages> is an decimal integer value.
251 Example: PagesToScan=100
252
253 Key: PagesToScanWithBoost
254 Value: <pages>
255 Comment: Specify the number of pages to scan for boosting partial scan.
256          This value is normally larger than "PagesToScan" value.
257          <pages> is an decimal integer value.
258 Example: PagesToScanWithBoost=1000
259
260 2.6 Section: MemoryCompaction
261 =============================
262 Key: FragLevel
263 Value: <level>
264 Comment: Specify external fragmentation size of the kernel zone.
265          It determines when to trigger compaction.
266          <level> is an decimal integer value.
267          800 means 80%.
268 Example: FragLevel=800
269
270 2.7 Section: MemoryBackgroundReclaim
271 =============================
272 Key: AfterScreenDim
273 Value: (yes|1|ok|on|no|0|off)
274 Comment: Specify whether memory is reclaimed
275          from most recently used background app.
276          If value is (yes|1|ok|on), background reclaim on.
277          If value is (no|0|off), background reclaim off.
278 Example: AfterScreenDim=yes
279
280 2.8 Section: CpuSched
281 =====================
282 Key: CpuSchedFeature
283 Value: <feature>([,]+<feature>)*
284 Comment: Specify cpu scheduling features.
285          <feature> can be: rt_runtime_share, no_rt_runtime_share
286          Multiple values can be used by separating them into ','.
287 Example: CpuSchedFeature=no_rt_runtime_share
288
289 Key: CpuRTRuntime
290 Value: <cpu rt runtime>[ mu]?s
291 Comment: Specify cpu rt runtime in milliseconds(m), microseconds(u) or seconds.
292          <cpu rt runtime> is an decimal integer value.
293 Example: CpuRTRuntime=900ms
294
295 Key: CpuRTPeriod
296 Value: <cpu rt period>[ mu]?s
297 Comment: Specify cpu rt period in milliseconds(m), microseconds(u) or seconds.
298          <cpu rt period> is an decimal integer value.
299 Example: CpuRTRuntime=900ms
300
301 2.9 Section: CpuAffinity
302 ========================
303 Key: ForegroundApps
304 Value: (<core num>|<core range>)(,(<core num>|<core range>))*
305 Comment: Specify the cpu affinity of each core
306          <core num> is an decimal integer
307          <core range> is: <core num>-<core num>
308 Example: ForegroundApps=1,2,3-5
309
310 2.10 Section: CpuBoostingLevelStrong
311 ===================================
312 Key: CpuSched
313 Value: <schedule scheme>
314 Comment: Specify the schedule scheme when the cpu boosting level is "strong".
315          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
316 Example: CpuSched=rr
317
318 Key: CpuNice
319 Value: <nice value>
320 Comment: Specify the nice value when the cpu boosting level is "strong".
321          <nice value> is an decimal integer value. (-20 ~ 19)
322 Example: CpuNice=-20
323
324 Key: CpuRTPriority
325 Value: <priority>
326 Comment: Specify the cpu rt priority when the cpu boosting level is "strong".
327          <priority> is an decimal integer value.
328 Example: CpuRTPriority=50
329
330 2.11 Section: CpuBoostingLevelMedium
331 ====================================
332 Key: CpuSched
333 Value: <schedule scheme>
334 Comment: Specify the schedule scheme when the cpu boosting level is "medium".
335          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
336 Example: CpuSched=rr
337
338 Key: CpuNice
339 Value: <nice value>
340 Comment: Specify the nice value when the cpu boosting level is "medium".
341          <nice value> is an decimal integer value. (-20 ~ 19)
342 Example: CpuNice=-20
343
344 Key: CpuRTPriority
345 Value: <priority>
346 Comment: Specify the cpu rt priority when the cpu boosting level is "medium".
347          <priority> is an decimal integer value.
348 Example: CpuRTPriority=50
349
350 2.12 Section: CpuBoostingLevelWeak
351 ==================================
352 Key: CpuSched
353 Value: <schedule scheme>
354 Comment: Specify the schedule scheme when the cpu boosting level is "weak".
355          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
356 Example: CpuSched=rr
357
358 Key: CpuNice
359 Value: <nice value>
360 Comment: Specify the nice value when the cpu boosting level is "weak".
361          <nice value> is an decimal integer value. (-20 ~ 19)
362 Example: CpuNice=-20
363
364 Key: CpuRTPriority
365 Value: <priority>
366 Comment: Specify the cpu rt priority when the cpu boosting level is "weak".
367          <priority> is an decimal integer value.
368 Example: CpuRTPriority=50
369
370 3. monitor.conf
371 ===============
372
373 3.1 HEART
374 =========
375 Key: <device module name>
376 Value: (ON|OFF)
377 Comment: Specify logging is ON or OFF.
378          <device module name> can be: ABNORMAL, BATTERY, CPU, MEMORY, STORAGE
379          If value is ON, then logging for <device module name> is on.
380          else no logging for this module.
381 Example: BATTERY=ON
382
383 3.2 BATTERY_POWER_MODE
384 ======================
385 Key: POWER_NORMAL_MODE
386 Value: <power>
387 Comment: Specify power for normal mode.
388          <power> is an integer value.
389 Example: POWER_NORMAL_MODE=676
390
391 Key: POWER_SAVING_MODE
392 Value: <power>
393 Comment: Specify power for saving mode.
394          <power> is an integer value.
395 Example: POWER_SAVING_MODE=750
396
397 Key: ULTRA_SAVING_MODE
398 Value: <power>
399 Comment: Specify power for ultra saving mode.
400          <power> is an integer value.
401 Example: ULTRA_SAVING_MODE=1947
402
403 3.3 BATTERY_<capacity>
404 ======================
405 Key: LOGIC_V2
406 Value: (0|1)
407 Comment: Specify whether logic_v2 is suppoted or not.
408 Example: LOGIC_V2=1
409
410 Key: LOGIC_RUL
411 Value: (0|1)
412 Comment: Specify whether remaining usefull life (RUL) prediction logic is supported or not.
413 Example: LOGIC_RUL=1
414
415 Key: BATTERY_CAPACITY
416 Value: <capacity>
417 Comment: Specify the capacity of the battery.
418 Example: BATTERY_CAPACITY=12000
419
420 Key: DISCHARGE_FAST
421 Value: <time>
422 Comment: Specify the total time(min) taken when the device is discharging at fastest rate.
423          <time> is an integer value.
424 Example: DISCHARGE_FAST=700
425
426 Key: DISCHARGE_SLOW
427 Value: <time>
428 Comment: Specify the total time(min) taken when the device is discharging at slowest rate.
429          <time> is an integer value.
430 Example: DISCHARGE_SLOW=12000
431
432 Key: AVERAGE_PWR
433 Value: <avg_pwr>
434 Comment: Specify the avarage power consumed in UPS mode.
435          <avg_pwr> is a float value.
436 Example: AVERAGE_PWR=35.0
437
438 Key: OCV_SOC_POLY_COEF
439 Value: <ocv degree(n)> <coef 1> ... <coef n>
440 Comment: Specify coefficients of polynomial expression for OCV, SOC.
441 Example: OCV_SOC_POLY_COEF=6 3402.664 42.031 -1.76745 0.034798 -0.00030516 0.0000010116
442
443 4. process.conf
444 ===============
445
446 4.1 APPUSAGE
447 ============
448 Key: APPUSAGE
449 Value: (ON|OFF)
450 Comment: Specify whether favorite apps table is required or not.
451          Favorite apps will be specified in "PREDEFINED" (see below)
452 Example: APPUSAGE=ON
453
454 Key: PREDEFINED
455 Value: <app name>
456 Comment: Specify favorite apps.
457          <app name> will be added to favorite apps table.
458 Example: PREDEFINED=app1
459
460 4.2 BLOCK
461 =========
462 Key: activate
463 Value: (TRUE|FALSE)
464 Comment: Specify whether the monitoring for home directory of users is required or not
465          If TRUE, monitoring on.
466          else, no monitoring.
467 Example: activate=TRUE
468
469 Key: mode
470 Value: (ACCESS|READ|WRITE|DISABLE)
471 Comment: Specify monitoring mode.
472 Example: mode=WRITE
473
474 Key: include
475 Value: <pkgname>
476 Comment: Specify included package name.
477 Example: include=DOWNLOADABLE
478
479 Key: exclude
480 Value: <pkgname>
481 Comment: Specify excluded package name.
482 Example: excluded=SLP_debug
483
484 Key: logging
485 Value: <type>
486 Comment: Specify logging type.
487          <type> is a flag value, including: DLOG(0x1), FILE(0x2), DB(0x4).
488          If DLOG and DB type, then <type> is 5 (0x01 | 0x04).
489 Example: logging=5
490
491 5. limiter.conf.d/*.conf
492 ========================
493
494 5.1 Section: Private
495 ====================
496 Key: App|Service|SERVICE|Process|PROCESS
497 Value: <name>
498 Comment: Specify the name of app/service/process.
499          One per one Private section.
500 Example: Service=dbus.service
501 Example: App=org.tizen.<app>
502
503 Key: MemLimitAction
504 Value: <limit>[GMK]B,<action>
505 Comment: Specify the memory limitation of this app/service/process.
506          <action> specifies an action to be performed when the limit is crossed.
507          <action> can be: broadcast, reclaim, kill, ignore
508 Example: MemLimitAction=4096KB,kill
509
510 Key: MemoryBackgroundLru
511 Value: (yes|1|ok|on|no|0|off)
512 Comment: Specify whether put the process or service
513          in BackgroundLru memory cgroup.
514          If (yes|1|ok|on), put the process or service in BackgroundLru.
515          If (no|0|off), do not put the process or service in BackgroundLru.
516 Example: MemoryBackgroundLru=yes
517
518 Key: CpuThrottling
519 Value: (yes|1|ok|on|no|0|off)
520 Comment: Specify whether the cpu throttling is enabled.
521          If (yes|1|ok|on), enable cpu throttling.
522          If (no|0|off), disable cpu throttling.
523 Example: CpuThrottling=yes
524
525 Key: LmkKillException
526 Value: (yes|1|ok|on|no|0|off)
527 Comment: Specify whether the corresponding process is excluded from LMK victim list.
528          If (yes|1|ok|on), the process is removed from the list.
529          If (no|0|off), the process is not removed from the list.
530          Only app is supported, but service and process are not supported.
531          (system services with System, System::Privileged, and User attrs are
532          already removed from the list in LMK)
533 Example: LmkKillException=yes
534
535 6. optimizer.conf.d/*.conf
536 ==========================
537
538 6.1 Section: Private
539 ====================
540 Key: App|Service|SERVICE|Process|PROCESS
541 Value: <name>
542 Comment: Specify the name of app/service/process.
543          One per one Private section.
544 Example: Service=dbus.service
545 Example: App=org.tizen.<app>
546
547 Key: CpuSched
548 Value: <schedule scheme>
549 Comment: Specify the schedule scheme.
550          <schedule schedule> can be: idle, other, batch, fifo, rr, deadline
551 Example: CpuSched=idle
552
553 Key: CpuNice
554 Value: <nice value>
555 Comment: Specify the nice value.
556          <nice value> is an decimal integer value. (-20 ~ 19)
557 Example: CpuNice=-20
558
559 Key: CpuRTPriority
560 Value: <priority>
561 Comment: Specify the cpu rt priority.
562          <priority> is an decimal integer value.
563 Example: CpuRTPriority=50
564
565 Key: CpuBoostingLevel
566 Value: (strong|medium|weak)
567 Comment: Specify the boosting level of this app/service/process.
568 Example: CpuBoostingLevel=medium
569
570 Key: CpuAffinity
571 Value: (cpu id|min cpu id-max cpu id|cpu_id,cpu_id)
572 Comment: Specify the cpu affinity of this app
573 Example: CpuAffinity=1,3-5,8
574
575 7. process.conf.d/*.conf
576 ========================
577
578 7.1 Section: Private
579 ====================
580 Key: App|Service|SERVICE|Process|PROCESS
581 Value: <name>
582 Comment: Specify the name of app/service/process.
583          One per one Private section.
584 Example: Service=dbus.service
585 Example: App=org.tizen.<app>
586
587 Key: ActionOnFailure
588 Value: <action>
589 Comment: Specify an action on failure.
590          <action> can be: reboot
591 Example: ActionOnFailure=reboot
592
593 Key: WatchdogAction
594 Value: <action>
595 Comment: Specify an action for watchdog.
596          <action> can be: ignore, kill
597 Example: WatchdogAction=ignore
598
599 Key: OomScore
600 Value: <oom_score_adj>
601 Comment: Specify the oom_score_adj.
602          oom_score_adj is an integer value between -900 to 250.
603          Predefined values cannot be used.
604          Predefined values are: -900, 0, 100, 150, 200, 230, 250
605          (Please refer to procfs.h)
606 Example: OomScore=125
607
608 8. vip-process.d/*.conf
609 =======================
610
611 8.1 Section: Private|VIP_GROUP
612 ==============================
613 Key: App|Service|SERVICE|Process|PROCESS
614 Value: <name>
615 Comment: Specify the name of app/service/process.
616          One per one Private section.
617 Example: Service=dbus.service
618 Example: App=org.tizen.<app>
619
620 Key: ACTION_ON_FAILURE
621 Value: <action>
622 Comment: Specify an action on failure.
623          <action> can be: reboot
624 Example: ACTION_ON_FAILURE=reboot