From be03af63cd1d1e1506c8350ce6cb82a2f5a6c48a Mon Sep 17 00:00:00 2001 From: SangYoun Kwak Date: Wed, 4 Jan 2023 18:21:26 +0900 Subject: [PATCH] Modify README of config files The README of config files was renewed because its content was out-dated. Below are the changes: 1. Format Now the key and value of the properties are described separately. For more accurate explanation, keys and values are described using regular expression. 2. Contents were renewed about files below(config for common): limiter.conf optimizer.conf monitor.conf process.conf 3. Contents were added(config for each app): limiter.conf.d/*.conf optimizer.conf.d/*.conf process.conf.d/*.conf vip-process.d/*.conf Change-Id: I585f6382b1ddff6d1458586a05b5fe92cf715b91 Signed-off-by: SangYoun Kwak --- conf/README | 958 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 537 insertions(+), 421 deletions(-) diff --git a/conf/README b/conf/README index 731aed5..6cd771c 100644 --- a/conf/README +++ b/conf/README @@ -1,455 +1,571 @@ -Old Version Resourced Configurations ======================== -File Names -========== -1. limiter.conf : configurations to limit resources -2. optimizer.conf : configurations to optimize resources -3. monitor.conf : configurations to monitor resources -4. process.conf : configurations to manage process - -Sections -======== -Section name should be located between '[' and ']'. -The order between sections does not matter and -the order of configurations within a section is also not important. +Index +===== +1. limiter.conf : configurations to limit resources +2. optimizer.conf : configurations to optimize resources +3. monitor.conf : configurations to monitor resources +4. process.conf : configurations to manage process +5. limiter.conf.d/*.conf : configurations to limit resources, for each app +6. optimizer.conf.d/*.conf : configurations to optimize resources, for each app +7. process.conf.d/*.conf : configurations to manage process, for each app +8. vip-process.d/*.conf : configurations to manage vip-process, for each app + +File Format +=========== +Config file consists of two parts: section names and key-value pairs. +Section name should be located between '[' and ']'. (ex: [MemoryLevelThreshold]) +The range of a section is: From the first appearance of section name to the EOF or the line before the next section starts +Example: [MemoryThrottling] + ThrottlingLimit=80% +Lines beginning with '#' are ignored. + +Value Format +============ +Value format will be described as regular expression form. +Names enclosed with clamps(<...>) can be replaced with some value which described inside clamps. 1. limiter.conf =============== -1.1 VIP_PROCESS -=============== -Format: PREDEFINE= -Comment: add vip processes in this section. - these processes will be located in the VIP cgroup (maximum cpu and memory) and - they won't be killed by a low memory killer(LMK). -ex)PREDEFINE=app1 - PREDEFINE=app2 - -1.2 OOM_FIXED_APPS -================== -Format: APP NAME= -Comment: add app names with their oom_score_adjs in this section. - do not set the score with the predefined scores described at the procfs.h. - the range of SCORE should be OOMADJ_SERVICE_MIN < SCORE < OOMADJ_BACKGRD_LOCKED -ex)app1=323 - app2=415 - -1.3 Memory -========== -Format: ThresholdDedup= -Comment: specify threshold(MB) of dedup level -ex)ThresholdDedup=30 - -Format: ThresholdSwap= -Comment: specify threshold(MB) of swap level -ex)ThresholdSwap=20 - -Format: ThresholdLow= -Comment: specify threshold(MB) of low level -ex)ThresholdLow=15 - -Format: ThresholdMedium= -Comment: specify threshold(MB) of medium level -ex)ThresholdMedium=10 - -Format: ThresholdLeave= -Comment: specify threshold leave of medium level -ex)ThresholdLeave=20 - -Format: ThresholdRatioDedup= -Comment: specify threshold ratio(%) of dedup level -ex)ThresholdRatioDedup=30 - -Format: ThresholdRatioSwap= -Comment: specify threshold ratio(%) of swap level -ex)ThresholdRatioSwap=25 - -Format: ThresholdRatioLow= -Comment: specify threshold ratio(%) of low level -ex)ThresholdRatioLow=20 - -Format: ThresholdRatioMedium= -Comment: specify threshold ratio(%) of medium level -ex)ThresholdRatioMedium=15 - -Format: ThresholdRatioLeave= -Comment: specify threshold leave ratio(%) of medium level -ex)ThresholdRatioLeave=30 - -Format: ForegroundRatio= -Comment: specify memory limit ratio(0.0<= ratio <=1.0) of foreground apps(High cgroup) -ex)ForegroundRatio=0.3 - -Format: BackgroundRatio= -Comment: specify memory limit ratio(0.0<= ratio <=1.0) of background apps(Medium cgroup). - Unset this option if it causes any unexepcted issue (e.g. jerky animation). -ex)BackgroundRatio=0.2 - -Format: LowRatio= -Comment: specify memory limit ratio(0.0<= ratio <=1.0) of old background apps(Lowest cgroup) -ex)LowRatio=0.1 - -Format: NumMaxVictims=<#victim> -Comment: specify the number of victims -ex)NumMaxVictims=10 - -Format: ProactiveThreshold= -Comment: specify threshold(MB) of proactive memory killer -ex)ProactiveThreshold=30 - -Format: ProactiveLeave= -Comment: specify threshold leave(MB) of proactive memory killer -ex)ProactiveLeave=50 - -Format: EventLevel= -Comment: specify the level of vmpressure among (low, medium, critical) -ex)EventLevel="low" - -Format: SWAPPINESS= -Comment: specify swappiness of the root cgroup -ex)SWAPPINESS=6 - -Format: FOREGROUND_SWAPPINESS= -Comment: specify swappiness of the High cgroup -ex)FOREGROUND_SWAPPINESS=6 - -Format: BACKGROUND_SWAPPINESS= -Comment: specify swappiness of the Medium cgroup -ex)BACKGROUND_SWAPPINESS=6 - -Format: LOW_SWAPPINESS= -Comment: specify swappiness of the Lowest cgroup -ex)LOW_SWAPPINESS=6 - -Format: NumFragSize= -Comment: specify external fragmentation size of "Normal" zone. - the fragmentation_size is the minimum count of order-2 pages in the kernel zone. - if #32K_PAGE + (#64K_PAGE * 2) + (#128K_PAGE * 4) + (#256K_PAGE * 8) < NumFragSize, - then compact memory in the kernel zone. -ex)NumFragSize=300 - -1.4 POPUP -========= -Format: oom_popup= -Comment: specify whether a popup is needed or not when the process is killed by LMK or - proactive killer -ex)oom_popup=no - -1.5 BackgroundReclaim -===================== -Format: AfterScreenDim= -Comment: specify whether background memory reclaim is needed when LCD_OFF signal is caught. - This will cause force reclaim or memory limit on Medium cgroup. -ex)AfterScreenDim=yes - -1.6 Logging -=========== -Format: Enable=<1 or 0> -Comment: specify whether logging is needed or not. - if "Enable" value is 1, then resourced makes a memps log during LMK. -ex)Enable=1 - -Format: LogPath= -Comment: specify logging path -ex)LogPath=/var/log - -Format: MaxNumLogfile= -Comment: specify maximum number of log files -ex)MaxNumLogfile=50 - -Format: PrefixMemps= -Comment: specify prefix of memps log file -ex)PrefixMemps=memps - -Format: PrefixMempsMemLimit= -Comment: specify prefix of memps log file for apps managed by independent cgroup -ex)PrefixMemps=memps_per_app - -1.7 MemLimit -============ -Format: MemLimitTrigger= -Comment: specify type (oom, threshold, others) of trigger for apps managed by independent cgroup - oom: regiter event using oom_control and kill process in kernel - threshold: regiter event using usage_in_bytes and kill process in resourced - others: don't register any event for memory limit -ex)MemLimitTrigger=oom - -Format: MemLimit= -Comment: specify meory limit(MB) for app -ex)MemLimitService=128 (service type app) - MemLimitWidget=128 (widget type app) - MemLimitGUIApp=128 (guiapp type app) - MemLimitBgApp=100 (background state app) - -1.8 CPU -======= -Format: PREDEFINE= -Comment: specify type and its app name. - it makes effect of cpu cgroup, cpu priority, and iopriority -ex)LAZY_PREDEFINE=app1 - PREDEFINE=app2 - BOOTING_PREDEFINE=app3 - WRT_PREDEFINE=app4 - -Format: BACKGROUND_CPU_SHARE= -Comment: specify ratio(%) of background cpu share(= Medium cgroup/root cgroup * 100) -ex)BACKGROUND_CPU_SHARE=50 - -Format: QUOTA_CPU_SHARE= -Comment: specify ratio(%) of quota cpu share(= Lowest cgroup/root cgroup * 100) -ex)QUOTA_CPU_SHARE=25 - -Format: QUOTA_MAX_BANDWIDTH= -Comment: specify ratio(%s) of quota cpu bandwidth - (cpu.cfs_quota_us = cpu.cfs_period_us * ratio/100) -ex)QUOTA_MAX_BANDWIDTH=100 - -1.9 CPU-SCHED -============= -Format: foreground=,- -Comment: specify cpu affinity of each core -ex)foreground=1,2,3-5 +1.1 Section: MemoryThrottling +============================= +Key: ThrottlingLimit +Value: % +Comment: Specify the throttling limit ratio in percentage. +Example: ThrottlingLimit=80% + +1.2 Section: MemoryLevelThreshold +================================= +Key: OomPopup +Value: (yes|1|ok|on|no|0|off) +Comment: Specify whether a popup is needed or not when the process is killed by LMK or proactive killer. + If (yes|1|ok|on), resoruced will request system popup when OOM occurred. + If (no|0|off), resoruced will not request system popup when OOM occurred. +Example: OomPopup=no + +Key: MediumLevel +Value: [GMK]B + or + % +Comment: Specify the threshold or ratio for memory level medium. +Example: MediumLevel=400MB + +Key: LowLevel +Value: [GMK]B + or + % +Comment: Specify the threshold or ratio for memory level low. +Example: LowLevel=300MB + +Key: CriticalLevel +Value: [GMK]B + or + % +Comment: Specify the threshold or ratio for memory level critical. +Example: LowLevel=200MB + +Key: OomLevel +Value: [GMK]B + or + % +Comment: Specify the threshold or ratio for memory level oom(out of memory). +Example: OomLevel=160MB + +1.3 Section: MemoryAppTypeLimit +=============================== +Key: ServicePerAppLimitAction +Value: [GMK]B, +Comment: Specify the memory limitation of services. + specifies an action to be performed when the limit is crossed. + can be: broadcast, reclaim, kill, ignore +Example: ServicePerAppLimitAction=128MB,kill + +Key: WidgetPerAppLimitAction +Value: [GMK]B, +Comment: Specify the memory limitation of widgets. + specifies an action to be performed when the limit is crossed. + can be: broadcast, reclaim, kill, ignore +Example: WidgetPerAppLimitAction=160MB,kill + +Key: GUIPerAppLimitAction +Value: [GMK]B, +Comment: Specify the memory limitation of GUIs. + specifies an action to be performed when the limit is crossed. + can be: broadcast, reclaim, kill, ignore +Example: GUIPerAppLimitAction=160MB,kill + +1.4 Section: MemoryAppStatusLimit +================================= +Key: BackgroundPerAppLimitAction +Value: [GMK]B, +Comment: Specify the memory limitation of background apps. + specifies an action to be performed when the limit is crossed. + can be: broadcast, reclaim, kill, ignore +Example: BackgroundPerAppLimitAction=768MB,kill + +1.5 Section: CpuThrottling +========================== +Key: CpuSched +Value: +Comment: Specify the schedule scheme. + can be: idle, other, batch, fifo, rr, deadline +Example: CpuSched=idle + +Key: CpuNice +Value: +Comment: Specify the nice value. + is an decimal integer value. (-20 ~ 19) +Example: CpuNice=-20 + +Key: CpuShare +Value: +Comment: Specify ratio(%) of quota cpu share(= Lowest cgroup/root cgroup * 100) + is an decimal unsigned integer value. +Example: CpuShare=2 + +Key: CpuCFSRuntime +Value: [ mu]?s +Comment: Specifies cfs_quota in milliseconds(m), microseconds(u) or seconds. + is an decimal unsigned integer value. +Example: CpuCFSRuntime=50000 + +Key: CpuCFSPeriod +Value: [ mu]?s +Comment: Specifies cfs_period in milliseconds(m), microseconds(u) or seconds. + is an decimal unsigned integer value. +Example: CpuCFSRuntime=50000 2. optimizer.conf ================= -2.1 SWAP -======== -Format: Enable=<1 or 0> -Comment: specify whether swap is needed or not. - Enable=yes or 1 or true / Disalbe=no or 0 or false. - to prevent thrashing, do not set "ReclaimAtBootThreshold" too low. -ex)Enable=1 - -Format: Type= -Comment: specify swap type among (zram, file, zswap). - multiple swap devices are specified with '+'. - for example, both zram and file are enable by zram+file (default is zram). -ex)Type=zram - -Format: ReclaimAtBoot= -Comment: specify whether reclaim is needed at boot time -ex)ReclaimAtBoot=yes - -Format: TimerReclaimAtBoot=