Add LmkMaxVictimPerOom to set max victim per oom level during LMK.
It is restoration of 'NumMaxVictims' in tizen 6.0.
Change-Id: I3771d00e1d3f847072039e553d9f8ce3aae1146a
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Comment: Specify the threshold or ratio for LMK stop.
Example: LmkThresholdLeave=160MB
+Key: LmkMaxVictimPerOom
+Value: <the number of max victims>
+Comment: Specify the max victims per oom level during LMK.
+Example: LmkMaxVictimPerOom=10
+
1.3 Section: MemoryAppTypeLimit
===============================
Key: ServicePerAppLimitAction
CriticalLevel= 10%
OomLevel= 7%
LmkThresholdLeave= 14%
+LmkMaxVictimPerOom= 10
OomPopup= no
[MemoryAppTypeLimit]
bool oom_popup;
enum memcg_limit_trigger limit_trigger;
struct mem_threshold threshold_leave;
+ int lmk_max_victim_per_oom;
};
struct memcg_info {
if (!strncmp(result->name, OOM_POPUP_NAME_CONF,
strlen(OOM_POPUP_NAME_CONF) + 1)) {
memcg_conf->oom_popup = config_parse_bool(result->value);
- }
- else {
+ } else if (!strncmp(result->name, MEMORY_LMK_MAX_VICTIM_PER_OOM_NAME_CONF,
+ strlen(MEMORY_LMK_MAX_VICTIM_PER_OOM_NAME_CONF) + 1)) {
+ memcg_conf->lmk_max_victim_per_oom = atoi(result->value);
+ } else {
char temp = '\0';
int error = RESOURCED_ERROR_NONE;
bool percent;
#define MEMORY_LIMIT_TRIGGER_NAME_CONF "MemoryLimitTrigger"
#define MEMORY_LMK_KILL_EXCEPTION_NAME_CONF "LmkKillException"
#define MEMORY_LMK_THRESHOLD_LEAVE_NAME_CONF "LmkThresholdLeave"
+#define MEMORY_LMK_MAX_VICTIM_PER_OOM_NAME_CONF "LmkMaxVictimPerOom"
/* CPU specific configuration name */
#define CPU_SCHED_NAME_CONF "CpuSched"
memcg_conf->threshold_leave.threshold);
}
+ if (memcg_conf->lmk_max_victim_per_oom > 0)
+ num_max_victims = memcg_conf->lmk_max_victim_per_oom;
+
oom_popup_enable = memcg_conf->oom_popup;
set_memcg_limit_trigger(memcg_conf->limit_trigger);