[Samsung Galaxy Nexus] bsmitty83:
It should be close , they both are from 3.4 kernel , not the same commits tho , I used those values as a base and just made it 2,5,10,15,20,ect

heres a diff i made of the 2 lmk files ,

--- /home/bsmitty83/Downloads/lowmemkiller.c

+++ /home/bsmitty83/android/DirtyV_tuna/drivers/staging/android/lowmemorykiller.c

@@ -29,6 +29,8 @@

* GNU General Public License for more details.

*

*/

+

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>

#include <linux/kernel.h>

@@ -40,6 +42,7 @@

#include <linux/mutex.h>

#include <linux/delay.h>

#include <linux/swap.h>

+#include <linux/fs.h>

#ifdef CONFIG_HIGHMEM

#define _ZONE ZONE_HIGHMEM

@@ -48,46 +51,77 @@

#endif

static uint32_t lowmem_debug_level = 1;

-static int lowmem_adj[6] = {

+static uint32_t lowmem_auto_oom = 1;

+static short lowmem_adj[6] = {

0,

1,

6,

12,

-};

-static int lowmem_adj_size = 4;

+	13,

+	15,

+};

+static int lowmem_adj_size = 6;

static int lowmem_minfree[6] = {

3 * 512,	/* 6MB */

2 * 1024,	/* 8MB */

4 * 1024,	/* 16MB */

16 * 1024,	/* 64MB */

-};

-static int lowmem_minfree_size = 4;

+	20 * 1024,	/* 80MB */

+	28 * 1024,	/* 112MB */

+};

+static int lowmem_minfree_screen_off[6] = {

+	3 * 512,	/* 6MB */

+	2 * 1024,	/* 8MB */

+	4 * 1024,	/* 16MB */

+	16 * 1024,	/* 64MB */

+	20 * 1024,	/* 80MB */

+	28 * 1024,	/* 112MB */

+};

+static int lowmem_minfree_size = 6;

static int lmk_fast_run = 1;

+static struct task_struct *lowmem_deathpending;

static unsigned long lowmem_deathpending_timeout;

#define lowmem_print(level, x...)	\

do {	\

if (lowmem_debug_level >= (level))	\

-	printk(x);	\

+	pr_info(x);	\

} while (0)

static int test_task_flag(struct task_struct *p, int flag)

{

-	struct task_struct *t = p;

-

-	do {

+	struct task_struct *t;

+

+	for_each_thread(p,t) {

task_lock(t);

if (test_tsk_thread_flag(t, flag)) {

task_unlock(t);

return 1;

}

task_unlock(t);

-	} while_each_thread(p, t);

+	}

return 0;

}

+static int

+task_notify_func(struct notifier_block *self, unsigned long val, void *data);

+

+static struct notifier_block task_nb = {

+	.notifier_call	= task_notify_func,

+};

+

+static int

+task_notify_func(struct notifier_block *self, unsigned long val, void *data)

+{

+	struct task_struct *task = data;

+

+	if (task == lowmem_deathpending)

+	lowmem_deathpending = NULL;

+

+	return NOTIFY_OK;

+}

static DEFINE_MUTEX(scan_mutex);

void tune_lmk_zone_param(struct zonelist *zonelist, int classzone_idx,

@@ -174,6 +208,7 @@

int tasksize;

int i;

int min_score_adj = OOM_SCORE_ADJ_MAX + 1;

+	int minfree = 0;

int selected_tasksize = 0;

int selected_oom_score_adj;

int array_size = ARRAY_SIZE(lowmem_adj);

@@ -187,8 +222,25 @@

}

other_free = global_page_state(NR_FREE_PAGES);

-	other_file = global_page_state(NR_FILE_PAGES) -

-	global_page_state(NR_SHMEM);

+

+	if (global_page_state(NR_SHMEM) + total_swapcache_pages <

+	global_page_state(NR_FILE_PAGES))

+	other_file = global_page_state(NR_FILE_PAGES) -

+	global_page_state(NR_SHMEM) -

+	total_swapcache_pages;

+	else

+	other_file = 0;

+

+	/*

+	* If we already have a death outstanding, then

+	* bail out right away; indicating to vmscan

+	* that we have nothing further to offer on

+	* this pass.

+	*

+	*/

+	if (lowmem_deathpending &&

+	time_before_eq(jiffies, lowmem_deathpending_timeout))

+	return 0;

tune_lmk_param(&other_free, &other_file, sc);

@@ -197,8 +249,8 @@

if (lowmem_minfree_size < array_size)

array_size = lowmem_minfree_size;

for (i = 0; i < array_size; i++) {

-	if (other_free < lowmem_minfree &&

-	other_file < lowmem_minfree) {

+	minfree = lowmem_minfree;

+	if (other_free < minfree && other_file < minfree) {

min_score_adj = lowmem_adj;

break;

}

@@ -244,6 +296,7 @@

}

}

+

p = find_lock_task_mm(tsk);

if (!p)

continue;

@@ -267,16 +320,25 @@

selected = p;

selected_tasksize = tasksize;

selected_oom_score_adj = oom_score_adj;

-	lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n",

-	p->pid, p->comm, oom_score_adj, tasksize);

+	lowmem_print(2, "select '%s' (%d), adj %d, size %d, to kill\n",

+	p->comm, p->pid, oom_score_adj, tasksize);

}

if (selected) {

-	lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",

-	selected->pid, selected->comm,

-	selected_oom_score_adj, selected_tasksize);

+	lowmem_print(1, "Killing '%s' (%d), adj %d,\n" \

+	" to free %ldkB on behalf of '%s' (%d) because\n" \

+	" cache %ldkB is below limit %ldkB for oom_score_adj %d\n" \

+	" Free memory is %ldkB above reserved\n",

+	selected->comm, selected->pid,

+	selected_oom_score_adj,

+	selected_tasksize * (long)(PAGE_SIZE / 1024),

+	current->comm, current->pid,

+	other_file * (long)(PAGE_SIZE / 1024),

+	minfree * (long)(PAGE_SIZE / 1024),

+	min_score_adj,

+	other_free * (long)(PAGE_SIZE / 1024));

+	lowmem_deathpending = selected;

lowmem_deathpending_timeout = jiffies + HZ;

send_sig(SIGKILL, selected, 0);

-	set_tsk_thread_flag(selected, TIF_MEMDIE);

rem -= selected_tasksize;

rcu_read_unlock();

/* give the system time to free up the memory */

@@ -297,6 +359,7 @@

static int __init lowmem_init(void)

{

+	task_free_register(&task_nb);

register_shrinker(&lowmem_shrinker);

return 0;

}

@@ -304,6 +367,7 @@

static void __exit lowmem_exit(void)

{

unregister_shrinker(&lowmem_shrinker);

+	task_free_unregister(&task_nb);

}

#ifdef CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES

@@ -388,7 +452,7 @@

__module_param_call(MODULE_PARAM_PREFIX, adj,

&lowmem_adj_array_ops,

.arr = &__param_arr_adj,

-	-1, S_IRUGO | S_IWUSR);

+	S_IRUGO | S_IWUSR, 0664);

__MODULE_PARM_TYPE(adj, "array of int");

#else

module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,

@@ -396,7 +460,10 @@

#endif

module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,

S_IRUGO | S_IWUSR);

+module_param_array_named(minfree_screen_off, lowmem_minfree_screen_off, uint, &lowmem_minfree_size,

+	S_IRUGO | S_IWUSR);

module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);

+module_param_named(auto_oom, lowmem_auto_oom, uint, S_IRUGO | S_IWUSR);

module_param_named(lmk_fast_run, lmk_fast_run, int, S_IRUGO | S_IWUSR);

module_init(lowmem_init);

@@ -404,4 +471,3 @@

MODULE_LICENSE("GPL");

-