From: Arve Hjønnevåg Date: Wed, 27 Feb 2013 06:07:35 +0000 (-0800) Subject: staging: android: lowmemorykiller: Don't count reserved free memory X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eeb0f4f35fc1a4c0a5e30ec73e8e61916afa0399;p=linux-beck.git 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. Cc: Android Kernel Team Cc: Arve Hjønnevåg Signed-off-by: Arve Hjønnevåg Signed-off-by: John Stultz Acked-by: David Rientjes Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 3b91b0fd4de3..18423d28414b 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) int selected_tasksize = 0; short selected_oom_score_adj; int array_size = ARRAY_SIZE(lowmem_adj); - int other_free = global_page_state(NR_FREE_PAGES); + int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages; int other_file = global_page_state(NR_FILE_PAGES) - global_page_state(NR_SHMEM);