Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbaBZSKx (ORCPT ); Wed, 26 Feb 2014 13:10:53 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:56414 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621AbaBZSKv (ORCPT ); Wed, 26 Feb 2014 13:10:51 -0500 From: vinayakm.list@gmail.com To: gregkh@linuxfoundation.org, arve@android.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Vinayak Menon Subject: [PATCH] staging: android: lowmemorykiller: neglect swap cached pages in other_file Date: Wed, 26 Feb 2014 23:40:33 +0530 Message-Id: <1393438233-2759-1-git-send-email-vinayakm.list@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinayak Menon With ZRAM enabled it is observed that lowmemory killer doesn't trigger properly. swap cached pages are accounted in NR_FILE, and lowmemorykiller considers this as reclaimable and adds to other_file. But these pages can't be reclaimed unless lowmemorykiller triggers. So subtract swap pages from other_file. Signed-off-by: Vinayak Menon --- 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 6f094b3..92b1c93 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -88,7 +88,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc) int array_size = ARRAY_SIZE(lowmem_adj); 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); + global_page_state(NR_SHMEM) + total_swapcache_pages(); if (lowmem_adj_size < array_size) array_size = lowmem_adj_size; -- 1.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/