From: Rik van Riel <riel@redhat.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Ying Han <yinghan@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, Mel Gorman <mel@csn.ul.ie>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Hillf Danton <dhillf@gmail.com>, Hugh Dickins <hughd@google.com>,
KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [PATCH V8 1/2] mm: memcg softlimit reclaim rework
Date: Fri, 03 Aug 2012 12:16:18 -0400 [thread overview]
Message-ID: <501BF952.7070202@redhat.com> (raw)
In-Reply-To: <20120803152234.GE8434@dhcp22.suse.cz>
On 08/03/2012 11:22 AM, Michal Hocko wrote:
> On Thu 02-08-12 14:24:18, Ying Han wrote:
> [...]
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 3e0d0cd..88487b3 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -1866,7 +1866,22 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc)
>> do {
>> struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, memcg);
>>
>> - shrink_lruvec(lruvec, sc);
>> + /*
>> + * Reclaim from mem_cgroup if any of these conditions are met:
>> + * - this is a targetted reclaim ( not global reclaim)
>> + * - reclaim priority is less than DEF_PRIORITY
>> + * - mem_cgroup or its ancestor ( not including root cgroup)
>> + * exceeds its soft limit
>> + *
>> + * Note: The priority check is a balance of how hard to
>> + * preserve the pages under softlimit. If the memcgs of the
>> + * zone having trouble to reclaim pages above their softlimit,
>> + * we have to reclaim under softlimit instead of burning more
>> + * cpu cycles.
>> + */
>> + if (!global_reclaim(sc) || sc->priority< DEF_PRIORITY ||
>> + mem_cgroup_over_soft_limit(memcg))
>> + shrink_lruvec(lruvec, sc);
>>
>> /*
>> * Limit reclaim has historically picked one memcg and
>
> I am thinking that we could add a constant for the priority
> limit. Something like
> #define MEMCG_LOW_SOFTLIMIT_PRIORITY DEF_PRIORITY
>
> Although it doesn't seem necessary at the moment, because there is just
> one location where it matters but it could help in the future.
> What do you think?
I am working on changing the code to find the "highest priority"
LRU and reclaim from that list first. That will obviate the need
for such a change. However, the other cleanups and simplifications
made by Ying's patch are good to have...
--
All rights reversed
--
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 prev parent reply other threads:[~2012-08-03 16:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 21:24 [PATCH V8 1/2] mm: memcg softlimit reclaim rework Ying Han
2012-08-03 15:22 ` Michal Hocko
2012-08-03 16:16 ` Rik van Riel [this message]
2012-08-03 16:34 ` Ying Han
2012-08-06 13:33 ` Michal Hocko
2012-08-17 22:03 ` Ying Han
2012-08-20 8:03 ` Glauber Costa
2012-08-20 18:30 ` Ying Han
2012-08-21 9:29 ` Glauber Costa
2012-08-22 22:27 ` Ying Han
2012-08-23 7:49 ` Glauber Costa
2012-08-20 13:19 ` Kamezawa Hiroyuki
2012-08-20 18:12 ` Ying Han
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=501BF952.7070202@redhat.com \
--to=riel@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dhillf@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mhocko@suse.cz \
--cc=yinghan@google.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: link
Be 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.