From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, yamamoto@valinux.co.jp, lizf@cn.fujitsu.com,
kosaki.motohiro@jp.fujitsu.com, riel@redhat.com,
kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH 3/4] Memory controller soft limit organize cgroups (v5)
Date: Fri, 13 Mar 2009 10:33:25 +0530 [thread overview]
Message-ID: <20090313050325.GD16897@balbir.in.ibm.com> (raw)
In-Reply-To: <20090312160424.7d6f146c.akpm@linux-foundation.org>
* Andrew Morton <akpm@linux-foundation.org> [2009-03-12 16:04:24]:
> On Thu, 12 Mar 2009 23:26:25 +0530
> Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
>
> > Feature: Organize cgroups over soft limit in a RB-Tree
> >
> > From: Balbir Singh <balbir@linux.vnet.ibm.com>
> >
> > Changelog v5...v4
> > 1. res_counter_uncharge has an additional parameter to indicate if the
> > counter was over its soft limit, before uncharge.
> >
> > Changelog v4...v3
> > 1. Optimizations to ensure we don't uncessarily get res_counter values
> > 2. Fixed a bug in usage of time_after()
> >
> > Changelog v3...v2
> > 1. Add only the ancestor to the RB-Tree
> > 2. Use css_tryget/css_put instead of mem_cgroup_get/mem_cgroup_put
> >
> > Changelog v2...v1
> > 1. Add support for hierarchies
> > 2. The res_counter that is highest in the hierarchy is returned on soft
> > limit being exceeded. Since we do hierarchical reclaim and add all
> > groups exceeding their soft limits, this approach seems to work well
> > in practice.
> >
> > This patch introduces a RB-Tree for storing memory cgroups that are over their
> > soft limit. The overall goal is to
> >
> > 1. Add a memory cgroup to the RB-Tree when the soft limit is exceeded.
> > We are careful about updates, updates take place only after a particular
> > time interval has passed
> > 2. We remove the node from the RB-Tree when the usage goes below the soft
> > limit
> >
> > The next set of patches will exploit the RB-Tree to get the group that is
> > over its soft limit by the largest amount and reclaim from it, when we
> > face memory contention.
> >
> >
> > ...
> >
> > +#define MEM_CGROUP_TREE_UPDATE_INTERVAL (HZ/4)
>
> Wall-clock time is a quite poor way of tracking system activity.
> There's little correlation between the two things.
>
> >From a general design point of view it would be better to pace this
> polling activity in a manner which correlates with the amount of system
> activity. For example, "once per 100,000 pages scanned" is much more
> adaptive than "once per 250 milliseconds".
>
Good suggestion, I want to keep the tree up-to-date before we hit
scanning for reclaim. I can experiment with the idea and try.
> >
> > ...
> >> @@ -2459,6 +2561,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
> > if (cont->parent == NULL) {
> > enable_swap_cgroup();
> > parent = NULL;
> > + mem_cgroup_soft_limit_tree = RB_ROOT;
>
> This can be done at compile time?
>
As in declaring using RB_ROOT, sure can be done. I'll send a series of
fixes with review comments incorporated.
--
Balbir
--
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:[~2009-03-13 5:03 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 17:56 [PATCH 0/4] Memory controller soft limit patches (v5) Balbir Singh
2009-03-12 17:56 ` [PATCH 1/4] Memory controller soft limit documentation (v5) Balbir Singh
2009-03-12 17:56 ` [PATCH 2/4] Memory controller soft limit interface (v5) Balbir Singh
2009-03-12 22:59 ` Andrew Morton
2009-03-13 4:58 ` Balbir Singh
2009-03-12 17:56 ` [PATCH 3/4] Memory controller soft limit organize cgroups (v5) Balbir Singh
2009-03-12 23:04 ` Andrew Morton
2009-03-13 5:03 ` Balbir Singh [this message]
2009-03-13 0:47 ` KOSAKI Motohiro
2009-03-13 5:04 ` Balbir Singh
2009-03-13 5:22 ` KOSAKI Motohiro
2009-03-13 8:20 ` Balbir Singh
2009-03-13 6:59 ` KAMEZAWA Hiroyuki
2009-03-13 7:09 ` Balbir Singh
2009-03-12 17:56 ` [PATCH 4/4] Memory controller soft limit reclaim on contention (v5) Balbir Singh
2009-03-12 23:34 ` Andrew Morton
2009-03-13 7:53 ` Balbir Singh
2009-03-13 1:36 ` KOSAKI Motohiro
2009-03-13 4:13 ` Balbir Singh
2009-03-13 4:31 ` KOSAKI Motohiro
2009-03-13 4:50 ` KOSAKI Motohiro
2009-03-13 5:07 ` Balbir Singh
2009-03-13 6:54 ` KOSAKI Motohiro
2009-03-13 7:03 ` Balbir Singh
2009-03-13 7:17 ` KOSAKI Motohiro
2009-03-13 7:26 ` Balbir Singh
2009-03-13 8:37 ` KAMEZAWA Hiroyuki
2009-03-13 5:26 ` Balbir Singh
2009-03-13 5:34 ` KOSAKI Motohiro
2009-03-13 4:58 ` Balbir Singh
2009-03-13 6:51 ` KAMEZAWA Hiroyuki
2009-03-13 7:15 ` Balbir Singh
2009-03-13 8:41 ` KAMEZAWA Hiroyuki
2009-03-13 7:02 ` [PATCH 0/4] Memory controller soft limit patches (v5) KAMEZAWA Hiroyuki
2009-03-13 7:07 ` KAMEZAWA Hiroyuki
2009-03-13 7:15 ` Andrew Morton
2009-03-13 7:29 ` Balbir Singh
2009-03-13 7:18 ` Balbir Singh
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=20090313050325.GD16897@balbir.in.ibm.com \
--to=balbir@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=riel@redhat.com \
--cc=yamamoto@valinux.co.jp \
/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