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

Commit c7d6dfe4 authored by Yogesh Lal's avatar Yogesh Lal Committed by Patrick Daly
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>
Signed-off-by: default avatarNaitik Bharadiya <bharad@codeaurora.org>
parent 94b145b7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@
#define CREATE_TRACE_POINTS
#include "trace/lowmemorykiller.h"

/* to enable lowmemorykiller */
static int enable_lmk = 1;
module_param_named(enable_lmk, enable_lmk, int, 0644);

static u32 lowmem_debug_level = 1;
static short lowmem_adj[6] = {
	0,
@@ -92,6 +96,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_node_page_state(NR_ACTIVE_ANON) +
		global_node_page_state(NR_ACTIVE_FILE) +
		global_node_page_state(NR_INACTIVE_ANON) +