From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Ying Han <yinghan@google.com>
Cc: Pavel Emelyanov <xemul@openvz.org>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Li Zefan <lizf@cn.fujitsu.com>, Mel Gorman <mel@csn.ul.ie>,
Christoph Lameter <cl@linux.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Tejun Heo <tj@kernel.org>, Michal Hocko <mhocko@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Hansen <dave@linux.vnet.ibm.com>,
linux-mm@kvack.org
Subject: Re: [PATCH V3 2/7] Add per memcg reclaim watermarks
Date: Thu, 14 Apr 2011 09:27:56 +0900 [thread overview]
Message-ID: <20110414092756.a7d8b1bb.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <BANLkTi=z5F40qWgHWmzpJ6jseeGyBJ+fAQ@mail.gmail.com>
On Wed, 13 Apr 2011 11:40:26 -0700
Ying Han <yinghan@google.com> wrote:
> On Wed, Apr 13, 2011 at 1:25 AM, KAMEZAWA Hiroyuki <
> kamezawa.hiroyu@jp.fujitsu.com> wrote:
>
> > On Wed, 13 Apr 2011 00:03:02 -0700
> > Ying Han <yinghan@google.com> wrote:
> > > +static void setup_per_memcg_wmarks(struct mem_cgroup *mem)
> > > +{
> > > + u64 limit;
> > > + unsigned long wmark_ratio;
> > > +
> > > + wmark_ratio = get_wmark_ratio(mem);
> > > + limit = mem_cgroup_get_limit(mem);
> > > + if (wmark_ratio == 0) {
> > > + res_counter_set_low_wmark_limit(&mem->res, limit);
> > > + res_counter_set_high_wmark_limit(&mem->res, limit);
> > > + } else {
> > > + unsigned long low_wmark, high_wmark;
> > > + unsigned long long tmp = (wmark_ratio * limit) / 100;
> >
> > could you make this ratio as /1000 ? percent is too big.
> > And, considering misc. cases, I don't think having per-memcg "ratio" is
> > good.
> >
> > How about following ?
> >
> > - provides an automatic wmark without knob. 0 wmark is okay, for me.
> > - provides 2 intrerfaces as
> > memory.low_wmark_distance_in_bytes, # == hard_limit - low_wmark.
> > memory.high_wmark_in_bytes, # == hard_limit - high_wmark.
> > (need to add sanity check into set_limit.)
> >
> > Hmm. Making the wmarks tunable individually make sense to me. One problem I
> do notice is that making the hard_limit as the bar might not working well on
> over-committing system. Which means the per-cgroup background reclaim might
> not be triggered before global memory pressure. Ideally, we would like to do
> more per-cgroup reclaim before triggering global memory pressure.
>
hmm.
> How about adding the two APIs but make the calculation based on:
>
> -- by default, the wmarks are equal to hard_limit. ( no background reclaim)
ok.
> -- provides 2 intrerfaces as
> memory.low_wmark_distance_in_bytes, # == min(hard_limit, soft_limit)
> - low_wmark.
> memory.high_wmark_in_bytes, # == min(hard_limit, soft_limit)
> - high_wmark.
>
Hmm, with that interface, soflimit=0(or some low value) will disable background
reclaim. (IOW, all memory will be reclaimed.)
IMHO, we don't need take care of softlimit v.s. high/low wmark. It's userland job.
And we cannot know global relcaim's run via memcg' memory uasge....because of
nodes and zones. I think low/high wmark should work against hard_limit.
> >
> > In this patch, kswapd runs while
> >
> > high_wmark < usage < low_wmark
> > ?
> >
> > Hmm, I like
> > low_wmark < usage < high_wmark.
> >
> > ;) because it's kswapd.
> >
> > I adopt the same concept of global kswapd where low_wmark triggers the
> kswpd and hight_wmark stop it. And here, we have
>
> (limit - high_wmark) < free < (limit - low_wmark)
>
Hm, ok. please add comment somewhere.
Thanks,
-Kame
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-04-14 0:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 7:03 [PATCH V3 0/7] memcg: per cgroup background reclaim Ying Han
2011-04-13 7:03 ` [PATCH V3 1/7] Add kswapd descriptor Ying Han
2011-04-13 7:03 ` [PATCH V3 2/7] Add per memcg reclaim watermarks Ying Han
2011-04-13 8:25 ` KAMEZAWA Hiroyuki
2011-04-13 18:40 ` Ying Han
2011-04-14 0:27 ` KAMEZAWA Hiroyuki [this message]
2011-04-14 8:24 ` Zhu Yanhai
2011-04-14 17:43 ` Ying Han
2011-04-13 7:03 ` [PATCH V3 3/7] New APIs to adjust per-memcg wmarks Ying Han
2011-04-13 8:30 ` KAMEZAWA Hiroyuki
2011-04-13 18:46 ` Ying Han
2011-04-13 7:03 ` [PATCH V3 4/7] Infrastructure to support per-memcg reclaim Ying Han
2011-04-14 3:57 ` Zhu Yanhai
2011-04-14 6:32 ` Ying Han
2011-04-13 7:03 ` [PATCH V3 5/7] Per-memcg background reclaim Ying Han
2011-04-13 8:58 ` KAMEZAWA Hiroyuki
2011-04-13 22:45 ` Ying Han
2011-04-13 7:03 ` [PATCH V3 6/7] Enable per-memcg " Ying Han
2011-04-13 9:05 ` KAMEZAWA Hiroyuki
2011-04-13 21:20 ` Ying Han
2011-04-14 0:30 ` KAMEZAWA Hiroyuki
2011-04-13 7:03 ` [PATCH V3 7/7] Add some per-memcg stats Ying Han
2011-04-13 7:47 ` [PATCH V3 0/7] memcg: per cgroup background reclaim KAMEZAWA Hiroyuki
2011-04-13 17:53 ` Ying Han
2011-04-14 0:14 ` KAMEZAWA Hiroyuki
2011-04-14 17:38 ` Ying Han
2011-04-14 21:59 ` 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=20110414092756.a7d8b1bb.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=cl@linux.com \
--cc=dave@linux.vnet.ibm.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=mel@csn.ul.ie \
--cc=mhocko@suse.cz \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=riel@redhat.com \
--cc=tj@kernel.org \
--cc=xemul@openvz.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox