From patchwork Wed Feb 27 06:07:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 15113 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D2F0223DFE for ; Wed, 27 Feb 2013 06:08:05 +0000 (UTC) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by fiordland.canonical.com (Postfix) with ESMTP id 83DA3A19248 for ; Wed, 27 Feb 2013 06:08:05 +0000 (UTC) Received: by mail-ve0-f175.google.com with SMTP id cy12so179440veb.20 for ; Tue, 26 Feb 2013 22:08:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=bOin/7AEtaPSW3mkugbcepH0rn29zxiJp9lCDJGS2hw=; b=aiu4P3KNKAgKC/fZkrigijxeXW68TLxGVsDHFEz3U2gbdrz+O6Cz/wH79ADNy5yNTy fHRa/sKpwLTHXFmombvhV59h7fzqbx4hII7hj9Zsz/3sfG3E71MWTAIkWN/ebfQwimY9 0jsMqNMpBGWjShV9bqB5QntrG+yZo2vH4HCKVGVJLtL+pTEZq4OjSUnyEUTd4EkIbRKm KC8dv8JZceyRJlvWSuVMqyp6hiS1mpSd1N5VovxcmwnY5ikB6r7aoKh4F6FskQZsFpnJ YGSpm5OSjd64tmQERcPLlp9rzYolzD0v8EsRHlNqiLpDdmzVbgQieTPBUR4r+Y9MDGLP 4JQA== X-Received: by 10.58.188.48 with SMTP id fx16mr436881vec.22.1361945284757; Tue, 26 Feb 2013 22:08:04 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp150781veb; Tue, 26 Feb 2013 22:08:04 -0800 (PST) X-Received: by 10.66.13.136 with SMTP id h8mr5612642pac.204.1361945283767; Tue, 26 Feb 2013 22:08:03 -0800 (PST) Received: from mail-da0-f46.google.com (mail-da0-f46.google.com [209.85.210.46]) by mx.google.com with ESMTPS id rf10si3444709pbc.156.2013.02.26.22.08.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Feb 2013 22:08:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.46 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.210.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.46 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: by mail-da0-f46.google.com with SMTP id z8so128565dad.19 for ; Tue, 26 Feb 2013 22:08:03 -0800 (PST) X-Received: by 10.68.75.109 with SMTP id b13mr1704847pbw.25.1361945283308; Tue, 26 Feb 2013 22:08:03 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id tm1sm3499861pbc.11.2013.02.26.22.08.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Feb 2013 22:08:02 -0800 (PST) From: John Stultz To: lkml Cc: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Android Kernel Team , Greg Kroah-Hartman , John Stultz Subject: [PATCH 2/5] staging: android: lowmemorykiller: Don't count reserved free memory Date: Tue, 26 Feb 2013 22:07:35 -0800 Message-Id: <1361945258-24420-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361945258-24420-1-git-send-email-john.stultz@linaro.org> References: <1361945258-24420-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnKPGfuniOyNpyEkVtEZs4kFX9Ak83/271mIZdbF+tsA0E8raT3gJ+83Rt8rgGRoJgfOa9i From: Arve Hjønnevåg 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 Cc: Greg Kroah-Hartman Signed-off-by: Arve Hjønnevåg Signed-off-by: John Stultz --- drivers/staging/android/lowmemorykiller.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 7e00bdb..2f28763 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);