From patchwork Mon Jun 27 11:02:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Feng X-Patchwork-Id: 70917 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1009117qgy; Mon, 27 Jun 2016 04:03:44 -0700 (PDT) X-Received: by 10.66.253.70 with SMTP id zy6mr31493839pac.55.1467025424850; Mon, 27 Jun 2016 04:03:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si26129327pfj.35.2016.06.27.04.03.44; Mon, 27 Jun 2016 04:03:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbcF0LD3 (ORCPT + 30 others); Mon, 27 Jun 2016 07:03:29 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:63277 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbcF0LD1 (ORCPT ); Mon, 27 Jun 2016 07:03:27 -0400 Received: from 172.24.1.136 (EHLO szxeml426-hub.china.huawei.com) ([172.24.1.136]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CDZ13368; Mon, 27 Jun 2016 19:02:28 +0800 (CST) Received: from vm163-62.huawei.com (10.184.163.62) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.235.1; Mon, 27 Jun 2016 19:02:16 +0800 From: Chen Feng To: , , , , , , , , , , CC: , , , , , Subject: [PATCH] mm, vmscan: set shrinker to the left page count Date: Mon, 27 Jun 2016 19:02:15 +0800 Message-ID: <1467025335-6748-1-git-send-email-puck.chen@hisilicon.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.184.163.62] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0205.577107C6.01FE, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 64a8ea47b551e255de0b0d07d871cd95 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In my platform, there can be cache a lot of memory in ion page pool. When shrink memory the nr_to_scan to ion is always to little. to_scan: 395 ion_pool_cached: 27305 Currently, the shrinker nr_deferred is set to total_scan. But it's not the real left of the shrinker. Change it to the freeable - freed. Signed-off-by: Chen Feng --- mm/vmscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/mm/vmscan.c b/mm/vmscan.c index c4a2f45..1ce3fc4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -357,8 +357,8 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl, * manner that handles concurrent updates. If we exhausted the * scan, there is no need to do an update. */ - if (total_scan > 0) - new_nr = atomic_long_add_return(total_scan, + if (freeable - freed > 0) + new_nr = atomic_long_add_return(freeable - freed, &shrinker->nr_deferred[nid]); else new_nr = atomic_long_read(&shrinker->nr_deferred[nid]);