If swap devices are almost full, it can make sluggish issue.
So, it requries to trigger early LMK in swap modules.
And it is necessary to insert LMK type in order to decide
whether LMK will kill background applications or find out mallicious system daemons.
Change-Id: I6e215f41ec1b3282f15f67f8df81439f9f21fba8
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
void lowmem_dbus_init(void);
int lowmem_trigger_reclaim(int flags, int victims, enum lmk_type type, int threshold);
+void lowmem_trigger_swap_reclaim(enum lmk_type type, int swap_size);
void lowmem_change_memory_state(int state, int force);
void lowmem_memcg_set_threshold(int idx, int level, int value);
void lowmem_memcg_set_leave_threshold(int idx, int value);
return 0;
}
+void lowmem_trigger_swap_reclaim(enum lmk_type type, int swap_size)
+{
+ int size, victims;
+
+ victims = num_max_victims > MAX_PROACTIVE_HIGH_VICTIMS
+ ? MAX_PROACTIVE_HIGH_VICTIMS : num_max_victims;
+
+ size = memcg_root->threshold_leave + swap_size;
+ _I("reclaim from swap module, type : %d, size : %d, victims: %d", type, size, victims);
+ lowmem_trigger_reclaim(0, victims, type, size);
+}
+
static bool lowmem_fragmentated(void)
{
struct buddyinfo bi;