[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1467025335-6748-1-git-send-email-puck.chen@hisilicon.com>
Date: Mon, 27 Jun 2016 19:02:15 +0800
From: Chen Feng <puck.chen@...ilicon.com>
To: <puck.chen@...ilicon.com>, <akpm@...ux-foundation.org>,
<hannes@...xchg.org>, <vdavydov@...tuozzo.com>, <mhocko@...e.com>,
<vbabka@...e.cz>, <mgorman@...hsingularity.net>, <riel@...hat.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<labbott@...hat.com>
CC: <suzhuangluan@...ilicon.com>, <oliver.fu@...ilicon.com>,
<puck.chen@...mail.com>, <dan.zhao@...ilicon.com>,
<saberlily.xia@...ilicon.com>, <xuyiping@...ilicon.com>
Subject: [PATCH] mm, vmscan: set shrinker to the left page count
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 <puck.chen@...ilicon.com>
---
mm/vmscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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]);
--
1.9.1
Powered by blists - more mailing lists