Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bebf1784 authored by Yogesh Lal's avatar Yogesh Lal Committed by Gerrit - the friendly Code Review server
Browse files

lowmemorykiller: add a knob to turn on/off the feature



Add an option to turn on/off lowmemorykiller  so that
userspace can enable or disable lowmemorykiller as per requirement.

Change-Id: I539f7e23cdf5540e536569f0a582c9e7fe79c3c4
Signed-off-by: default avatarYogesh Lal <ylal@codeaurora.org>
parent 8508a88f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -60,6 +60,11 @@
#define CREATE_TRACE_POINTS
#include "trace/lowmemorykiller.h"

/* to enable lowmemorykiller */
static int enable_lmk = 1;
module_param_named(enable_lmk, enable_lmk, int,
	S_IRUGO | S_IWUSR);

static uint32_t lowmem_debug_level = 1;
static short lowmem_adj[6] = {
	0,
@@ -88,6 +93,9 @@ static unsigned long lowmem_deathpending_timeout;
static unsigned long lowmem_count(struct shrinker *s,
				  struct shrink_control *sc)
{
	if (!enable_lmk)
		return 0;

	return global_page_state(NR_ACTIVE_ANON) +
		global_page_state(NR_ACTIVE_FILE) +
		global_page_state(NR_INACTIVE_ANON) +