From: Chen Feng <puck.chen@hisilicon.com> To: <puck.chen@hisilicon.com>, <akpm@linux-foundation.org>, <hannes@cmpxchg.org>, <vdavydov@virtuozzo.com>, <mhocko@suse.com>, <vbabka@suse.cz>, <mgorman@techsingularity.net>, <riel@redhat.com>, <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <labbott@redhat.com> Cc: <suzhuangluan@hisilicon.com>, <oliver.fu@hisilicon.com>, <puck.chen@foxmail.com>, <dan.zhao@hisilicon.com>, <saberlily.xia@hisilicon.com>, <xuyiping@hisilicon.com> Subject: [PATCH] mm, vmscan: set shrinker to the left page count Date: Mon, 27 Jun 2016 19:02:15 +0800 [thread overview] Message-ID: <1467025335-6748-1-git-send-email-puck.chen@hisilicon.com> (raw) 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@hisilicon.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
WARNING: multiple messages have this Message-ID (diff)
From: Chen Feng <puck.chen@hisilicon.com> To: puck.chen@hisilicon.com, akpm@linux-foundation.org, hannes@cmpxchg.org, vdavydov@virtuozzo.com, mhocko@suse.com, vbabka@suse.cz, mgorman@techsingularity.net, riel@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, labbott@redhat.com Cc: suzhuangluan@hisilicon.com, oliver.fu@hisilicon.com, puck.chen@foxmail.com, dan.zhao@hisilicon.com, saberlily.xia@hisilicon.com, xuyiping@hisilicon.com Subject: [PATCH] mm, vmscan: set shrinker to the left page count Date: Mon, 27 Jun 2016 19:02:15 +0800 [thread overview] Message-ID: <1467025335-6748-1-git-send-email-puck.chen@hisilicon.com> (raw) 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@hisilicon.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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2016-06-27 11:03 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-06-27 11:02 Chen Feng [this message] 2016-06-27 11:02 ` [PATCH] mm, vmscan: set shrinker to the left page count Chen Feng 2016-06-27 16:57 ` Vladimir Davydov 2016-06-27 16:57 ` Vladimir Davydov 2016-06-28 10:37 ` Chen Feng 2016-06-28 10:37 ` Chen Feng 2016-06-28 16:48 ` Vladimir Davydov 2016-06-28 16:48 ` Vladimir Davydov 2016-06-29 7:25 ` Minchan Kim 2016-06-29 7:25 ` Minchan Kim
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1467025335-6748-1-git-send-email-puck.chen@hisilicon.com \ --to=puck.chen@hisilicon.com \ --cc=akpm@linux-foundation.org \ --cc=dan.zhao@hisilicon.com \ --cc=hannes@cmpxchg.org \ --cc=labbott@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mgorman@techsingularity.net \ --cc=mhocko@suse.com \ --cc=oliver.fu@hisilicon.com \ --cc=puck.chen@foxmail.com \ --cc=riel@redhat.com \ --cc=saberlily.xia@hisilicon.com \ --cc=suzhuangluan@hisilicon.com \ --cc=vbabka@suse.cz \ --cc=vdavydov@virtuozzo.com \ --cc=xuyiping@hisilicon.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.