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

Commit 2745993f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "android/lowmemorykiller: Account for total_swapcache_pages"

parents 921caec3 3a610c28
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/swap.h>
#include <linux/fs.h>

#ifdef CONFIG_HIGHMEM
#define _ZONE ZONE_HIGHMEM
@@ -250,8 +251,14 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
	}

	other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;

	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);
						global_page_state(NR_SHMEM) -
						total_swapcache_pages();
	else
		other_file = 0;

	tune_lmk_param(&other_free, &other_file, sc);