diff options
author | Arve Hjønnevåg <arve@android.com> | 2012-09-26 18:01:17 -0700 |
---|---|---|
committer | Simon Shields <keepcalm444@gmail.com> | 2016-06-13 14:47:36 +1000 |
commit | 495686d879b1f543c401a7137059cb147f367c10 (patch) | |
tree | 225fee4a87eafbfdddecc0c6a378a8a04d4e0cd4 /drivers | |
parent | f749a76e69e403c0c29456e4c810fc86ebe2eed1 (diff) | |
download | kernel_samsung_smdk4412-495686d879b1f543c401a7137059cb147f367c10.tar.gz kernel_samsung_smdk4412-495686d879b1f543c401a7137059cb147f367c10.tar.bz2 kernel_samsung_smdk4412-495686d879b1f543c401a7137059cb147f367c10.zip |
staging: android: lowmemorykiller: Don't count reserved free memory
The amount of reserved memory varies between devices. Subtract it
here to reduce the amount of devices specific tuning needed for the
minfree values.
Change-Id: I466ae8b18f5972f6f6d8b5a7d8c4ae69660de53a
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Conflicts:
drivers/staging/android/lowmemorykiller.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/lowmemorykiller.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index c6594f8c521..184bc2744cc 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -35,6 +35,7 @@ #include <linux/mm.h> #include <linux/oom.h> #include <linux/sched.h> +#include <linux/swap.h> #include <linux/rcupdate.h> #include <linux/notifier.h> #define ENHANCED_LMK_ROUTINE @@ -121,7 +122,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) #endif int array_size = ARRAY_SIZE(lowmem_adj); #ifndef CONFIG_DMA_CMA - int other_free = global_page_state(NR_FREE_PAGES); + int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages; #else int other_free = global_page_state(NR_FREE_PAGES) - global_page_state(NR_FREE_CMA_PAGES); |