fi
%post config-iot-headless
+%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-iot-headless.conf 150
%{_sbindir}/update-alternatives --install %{confdir}/vip-process.conf resourced-config-vip-process %{confdir}/configs/config-vip-process-iot-headless.conf 150
%preun config-iot-headless
if [ $1 -eq 0 ]; then
+ %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-iot-headless.conf
%{_sbindir}/update-alternatives --remove resourced-config-vip-process %{confdir}/configs/config-vip-process-iot-headless.conf
fi
%files config-iot-headless
%manifest resourced.manifest
+%{confdir}/configs/config-memory-iot-headless.conf
%{confdir}/configs/config-vip-process-iot-headless.conf
%if %{?mem_stress} == ON
IF("${MEMORY_MODULE}" STREQUAL "ON")
INSTALL(FILES ${MEMORY_SOURCE_DIR}/memory.conf DESTINATION ${RD_CONFIG_PATH})
INSTALL(FILES ${MEMORY_SOURCE_DIR}/memory-tv.conf DESTINATION ${RD_CONFIG_PATH})
+ INSTALL(FILES ${MEMORY_SOURCE_DIR}/memory-iot-headless.conf DESTINATION ${RD_CONFIG_PATH})
ENDIF()
IF("${CPU_MODULE}" STREQUAL "ON")
--- /dev/null
+[VIP_PROCESS]
+# predefined process list
+PREDEFINE=enlightenment
+PREDEFINE=dbus-daemon
+PREDEFINE=amd
+PREDEFINE=launchpad_preloading_preinitializing_daemon
+PREDEFINE=process_pool_launchpad_preloading_preinitializing_daemon
+
+# Use the ratio of the available memory to the total memory as vmpressure threshold.
+# If used with [Memory#] section, the last threshold will be applied.
+#[MemoryRatio]
+#ThresholdRatioDedup=30 # %
+#ThresholdRatioSwap=24 # %
+#ThresholdRatioLow=12 # %
+#ThresholdRatioMedium=10 # %
+#ThresholdRatioLeave=15 # %
+#NumMaxVictims=1
+
+[Memory64]
+# Threshold to start dedup
+ThresholdDedup=16 # MB
+
+# Threshold to start swap
+ThresholdSwap=15 # MB
+
+# Threshold to start reclaim
+ThresholdLow=8 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=5 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=8 # MB
+
+# Number of max victims
+NumMaxVictims=1
+
+[Memory256]
+# Threshold to start dedup
+ThresholdDedup=60 # MB
+
+# Threshold to start swap
+ThresholdSwap=40 # MB
+
+# Threshold to start reclaim
+ThresholdLow=20 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=10 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=20 # MB
+
+# Number of max victims
+NumMaxVictims=2
+
+[Memory448]
+# Threshold to start dedup
+ThresholdDedup=120 # MB
+
+# Threshold to start swap
+ThresholdSwap=100 # MB
+
+# Threshold to start reclaim
+ThresholdLow=60 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=50 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=70 # MB
+
+# Threshold for proactive memory killer
+ProactiveThreshold=80 # MB
+
+# Leave Threshold for proactive memory killer
+ProactiveLeave=100 # MB
+
+# Number of max victims
+NumMaxVictims=5
+
+[Memory512]
+# Threshold to start dedup
+ThresholdDedup=140 # MB
+
+# Threshold to start swap
+ThresholdSwap=100 # MB
+
+# Threshold to start reclaim
+ThresholdLow=70 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=60 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=80 # MB
+
+# Threshold for proactive memory killer
+ProactiveThreshold=80 # MB
+
+# Leave Threshold for proactive memory killer
+ProactiveLeave=100 # MB
+
+# Number of max victims
+NumMaxVictims=5
+
+[Memory768]
+# Threshold to start dedup
+ThresholdDedup=180 # MB
+
+# Threshold to start swap
+ThresholdSwap=150 # MB
+
+# Threshold to start reclaim
+ThresholdLow=90 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=80 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=100 # MB
+
+# Threshold for proactive memory killer
+ProactiveThreshold=100 # MB
+
+# Leave Threshold for proactive memory killer
+ProactiveLeave=130 # MB
+
+# Number of max victims
+NumMaxVictims=5
+
+[Memory1024]
+# Threshold to start dedup
+ThresholdDedup=400 # MB
+
+# Threshold to start swap
+ThresholdSwap=300 # MB
+
+# Threshold to start reclaim
+ThresholdLow=120 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=100 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=150 # MB
+
+# Threshold for proactive memory killer
+ProactiveThreshold=150 # MB
+
+# Leave Threshold for proactive memory killer
+ProactiveLeave=230 # MB
+
+# Number of max victims
+NumMaxVictims=5
+
+[Memory2048]
+# Threshold to start dedup
+ThresholdDedup=400 # MB
+
+# Threshold to start swap
+ThresholdSwap=300 # MB
+
+# Threshold to start reclaim
+ThresholdLow=200 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=160 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=300 # MB
+
+# Number of max victims
+NumMaxVictims=10
+
+[Memory3072]
+# Threshold to start dedup
+ThresholdDedup=600 # MB
+
+# Threshold to start swap
+ThresholdSwap=500 # MB
+
+# Threshold to start reclaim
+ThresholdLow=400 # MB
+
+# Threshold to start low memory killer
+ThresholdMedium=250 # MB
+
+# Threshold to stop low memory killer
+ThresholdLeave=500 # MB
+
+# Number of max victims
+NumMaxVictims=10
+
+[POPUP]
+oom_popup=no
+
+[BackgroundReclaim]
+# Unset this option if it causes any unexepcted issue (e.g. jerky animation).
+AfterScreenDim=yes
+
+[Compaction]
+CompactEnable=1
+# External fragmentation level
+# The higher the level the less restrictive
+# conditions for triggering compaction.
+Fraglevel=800
+
+[MemLimit]
+# Control memory limit
+# values for MemLimitTrigger :
+# 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)
+MemLimitTrigger=oom
+
+# Memory limits for each supported application types. Effective only when MemLimitTrigger
+# is set to oom or threshold.
+MemLimitService=128 # MB
+# MemLimitWidget=160 # MB
+# MemLimitGUIApp=1024 # MB
+
+# Following configuration option sets memory limit for background GUI
+# and Widget applications. It's valid to set this option only if
+# both MemLimitWidget and MemLimitGUIApp are set.
+# MemLimitBgApp=768 # MB
+
+[Logging]
+Enable=1
+# memps logpath
+# memps: OOM log
+# memps_memlimit: lowmem limit log
+MaxNumLogfile=50 # default: 50
+LogPath=/var/log # default: /var/log
+# logfile prefix
+PrefixMemps=memps
+PrefixMempsMemLimit=memps_memlimit
PREDEFINE=launchpad_preloading_preinitializing_daemon
PREDEFINE=process_pool_launchpad_preloading_preinitializing_daemon
+# Use the ratio of the available memory to the total memory as vmpressure threshold.
+# If used with [Memory#] section, the last threshold will be applied.
+#[MemoryRatio]
+#ThresholdRatioDedup=30 # %
+#ThresholdRatioSwap=24 # %
+#ThresholdRatioLow=12 # %
+#ThresholdRatioMedium=10 # %
+#ThresholdRatioLeave=15 # %
+#NumMaxVictims=1
+
[Memory64]
# Threshold to start dedup
-ThresholdDedup=16 # MB
+ThresholdDedup=16 # MB
# Threshold to start swap
ThresholdSwap=15 # MB
[Memory256]
# Threshold to start dedup
-ThresholdDedup=60 # MB
+ThresholdDedup=60 # MB
# Threshold to start swap
ThresholdSwap=40 # MB
[Memory448]
# Threshold to start dedup
-ThresholdDedup=120 # MB
+ThresholdDedup=120 # MB
# Threshold to start swap
ThresholdSwap=100 # MB
[Memory512]
# Threshold to start dedup
-ThresholdDedup=140 # MB
+ThresholdDedup=140 # MB
# Threshold to start swap
ThresholdSwap=100 # MB
[Memory768]
# Threshold to start dedup
-ThresholdDedup=180 # MB
+ThresholdDedup=180 # MB
# Threshold to start swap
ThresholdSwap=150 # MB
[Memory1024]
# Threshold to start dedup
-ThresholdDedup=400 # MB
+ThresholdDedup=400 # MB
# Threshold to start swap
ThresholdSwap=300 # MB
[Memory2048]
# Threshold to start dedup
-ThresholdDedup=400 # MB
+ThresholdDedup=400 # MB
# Threshold to start swap
ThresholdSwap=300 # MB
if (!result || !section_name)
return -EINVAL;
- if (strncmp(result->section, section_name, strlen(section_name)+1))
+ if (strncmp(result->section, "MemoryRatio", strlen("MemoryRatio")+1)
+ && strncmp(result->section, section_name, strlen(section_name)+1))
return RESOURCED_ERROR_NONE;
if (!strncmp(result->name, "ThresholdDedup", strlen("ThresholdDedup")+1)) {
} else if (!strncmp(result->name, "ThresholdLeave", strlen("ThresholdLeave")+1)) {
int value = atoi(result->value);
lowmem_memcg_set_leave_threshold(MEMCG_MEMORY, value);
+ } else if (!strncmp(result->name, "ThresholdRatioDedup", strlen("ThresholdRatioDedup")+1)) {
+ double ratio = atoi(result->value);
+ int value = (double)totalram * ratio / 100.0;
+ lowmem_memcg_set_threshold(MEMCG_MEMORY, LOWMEM_DEDUP, BYTE_TO_MBYTE(value));
+ } else if (!strncmp(result->name, "ThresholdRatioSwap", strlen("ThresholdRatioSwap")+1)) {
+ double ratio = atoi(result->value);
+ int value = (double)totalram * ratio / 100.0;
+ lowmem_memcg_set_threshold(MEMCG_MEMORY, LOWMEM_SWAP, BYTE_TO_MBYTE(value));
+ } else if (!strncmp(result->name, "ThresholdRatioLow", strlen("ThresholdRatioLow")+1)) {
+ double ratio = atoi(result->value);
+ int value = (double)totalram * ratio / 100.0;
+ lowmem_memcg_set_threshold(MEMCG_MEMORY, LOWMEM_LOW, BYTE_TO_MBYTE(value));
+ } else if (!strncmp(result->name, "ThresholdRatioMedium", strlen("ThresholdRatioMedium")+1)) {
+ double ratio = atoi(result->value);
+ int value = (double)totalram * ratio / 100.0;
+ lowmem_memcg_set_threshold(MEMCG_MEMORY, LOWMEM_MEDIUM, BYTE_TO_MBYTE(value));
+ } else if (!strncmp(result->name, "ThresholdRatioLeave", strlen("ThresholdRatioLeave")+1)) {
+ double ratio = atoi(result->value);
+ int value = (double)totalram * ratio / 100.0;
+ lowmem_memcg_set_leave_threshold(MEMCG_MEMORY, BYTE_TO_MBYTE(value));
} else if (!strncmp(result->name, "ForegroundRatio", strlen("ForegroundRatio")+1)) {
float ratio = atof(result->value);
memcg_info_set_limit(memcg_tree[MEMCG_APPS]->info, ratio, totalram);