From patchwork Sat Dec 14 03:26:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22472 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BB90223908 for ; Sat, 14 Dec 2013 03:27:02 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id o6sf9939200oag.11 for ; Fri, 13 Dec 2013 19:27:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=JfaMwcy5sEAoOiMZV8O5/Jez4TN//paDnQl9wxecyAQ=; b=A0anBbQZ0T5oTtgnBxXEBV/E6d47UUVpr9Zwc7iUbiP6ptqSiOKR/DxfsoxzHsBL4T RHJU//VnZabfO1/MIaKZr7AUV8ouMWuyToZQyFML3lKkMMmqrNkR5Nez3WfhB+Dq2AFR p3/cwWBf7DfHklJ5OBESSOswu5lVJTuMB+i1vd5gUguJ43rwTbvhUNF3tWndjNxMl5Gu rUw24wNizR06WcFqxaofMgeO3wCnOXbgoAXU6OsFR9B7qPoXP0cHnlL3nj3g2lNouZ4Z 1s2am+4B9jPDUb+R+5sDrO0xW3ozphgLSnlw8TbaV3wcMTM5xqkdPWfYmoxg04oHsfC2 HFfw== X-Gm-Message-State: ALoCoQkb5oVD/1+hZC2OtOhfn6ljuJP8Hcy1Uy5tvL8DHVN+kWOBteY/Q67/gLQOvTDNCeGzkyl9 X-Received: by 10.182.236.74 with SMTP id us10mr2255319obc.36.1386991622308; Fri, 13 Dec 2013 19:27:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.88.68 with SMTP id be4ls1272102qeb.46.gmail; Fri, 13 Dec 2013 19:27:02 -0800 (PST) X-Received: by 10.58.100.244 with SMTP id fb20mr2590572veb.6.1386991622190; Fri, 13 Dec 2013 19:27:02 -0800 (PST) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id ti3si1415749vdc.132.2013.12.13.19.27.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:27:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id ia6so1845701vcb.4 for ; Fri, 13 Dec 2013 19:27:02 -0800 (PST) X-Received: by 10.58.228.231 with SMTP id sl7mr2538579vec.49.1386991622120; Fri, 13 Dec 2013 19:27:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp86949vcz; Fri, 13 Dec 2013 19:27:01 -0800 (PST) X-Received: by 10.68.129.201 with SMTP id ny9mr7307753pbb.70.1386991620983; Fri, 13 Dec 2013 19:27:00 -0800 (PST) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id uj8si2985251pac.61.2013.12.13.19.27.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:27:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id rr13so3366857pbb.9 for ; Fri, 13 Dec 2013 19:27:00 -0800 (PST) X-Received: by 10.69.12.36 with SMTP id en4mr7349443pbd.54.1386991620609; Fri, 13 Dec 2013 19:27:00 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id nw11sm11680086pab.13.2013.12.13.19.26.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 19:26:59 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , John Stultz Subject: [PATCH 102/115] ion: free low memory from page pools first Date: Fri, 13 Dec 2013 19:26:22 -0800 Message-Id: <1386991595-6251-10-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386991595-6251-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> <1386991595-6251-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Colin Cross When the shrinkers are called with GFP_HIGH free low memory first, it is more important to have free than high memory. Signed-off-by: Colin Cross Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_page_pool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index 979d2e4..0ad0263 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -143,10 +143,10 @@ int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, struct page *page; mutex_lock(&pool->mutex); - if (high && pool->high_count) { - page = ion_page_pool_remove(pool, true); - } else if (pool->low_count) { + if (pool->low_count) { page = ion_page_pool_remove(pool, false); + } else if (high && pool->high_count) { + page = ion_page_pool_remove(pool, true); } else { mutex_unlock(&pool->mutex); break;