From: Johannes Weiner <hannes@cmpxchg.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Ying Han <yinghan@google.com>, Michal Hocko <mhocko@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>,
Minchan Kim <minchan.kim@gmail.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Mel Gorman <mgorman@suse.de>, Greg Thelen <gthelen@google.com>,
Michel Lespinasse <walken@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 2/8] mm: memcg-aware global reclaim
Date: Thu, 9 Jun 2011 18:57:48 +0200 [thread overview]
Message-ID: <20110609165748.GA20333@cmpxchg.org> (raw)
In-Reply-To: <20110609092617.GB10741@infradead.org>
On Thu, Jun 09, 2011 at 05:26:17AM -0400, Christoph Hellwig wrote:
> On Wed, Jun 08, 2011 at 11:30:46AM +0200, Johannes Weiner wrote:
> > On Tue, Jun 07, 2011 at 08:25:19AM -0400, Christoph Hellwig wrote:
> > > A few small nitpicks:
> > >
> > > > +struct mem_cgroup *mem_cgroup_hierarchy_walk(struct mem_cgroup *root,
> > > > + struct mem_cgroup *prev)
> > > > +{
> > > > + struct mem_cgroup *mem;
> > > > +
> > > > + if (mem_cgroup_disabled())
> > > > + return NULL;
> > > > +
> > > > + if (!root)
> > > > + root = root_mem_cgroup;
> > > > + /*
> > > > + * Even without hierarchy explicitely enabled in the root
> > > > + * memcg, it is the ultimate parent of all memcgs.
> > > > + */
> > > > + if (!(root == root_mem_cgroup || root->use_hierarchy))
> > > > + return root;
> > >
> > > The logic here reads a bit weird, why not simply:
> > >
> > > /*
> > > * Even without hierarchy explicitely enabled in the root
> > > * memcg, it is the ultimate parent of all memcgs.
> > > */
> > > if (!root || root == root_mem_cgroup)
> > > return root_mem_cgroup;
> > > if (root->use_hierarchy)
> > > return root;
> >
> > What you are proposing is not equivalent, so... case in point! It's
> > meant to do the hierarchy walk for when foo->use_hierarchy, obviously,
> > but ALSO for root_mem_cgroup, which is parent to everyone else even
> > without use_hierarchy set. I changed it to read like this:
> >
> > if (!root)
> > root = root_mem_cgroup;
> > if (!root->use_hierarchy && root != root_mem_cgroup)
> > return root;
> > /* actually iterate hierarchy */
> >
> > Does that make more sense?
>
> It does, sorry for misparsing it. The thing that I really hated was
> the conditional assignment of root. Can we clean this up somehow
> by making the caller pass root_mem_cgroup in the case where it
> passes root right now, or at least always pass NULL when it means
> root_mem_cgroup.
>
> Note really that important in the end, it just irked me when I looked
> over it, especially the conditional assigned of root to root_mem_cgroup,
> and then a little later checking for the equality of the two.
Yeah, the assignment is an ugly interface fixup because
root_mem_cgroup is local to memcontrol.c, as is struct mem_cgroup as a
whole.
I'll look into your suggestion from the other mail of making struct
mem_cgroup and struct mem_cgroup_per_zone always available, and have
everyone operate against root_mem_cgroup per default.
> Thinking about it it's probably better left as-is for now to not
> complicate the series, and maybe revisit it later once things have
> settled a bit.
I may take you up on that if this approach turns out to require more
change than is sensible to add to this series.
I'll at least add an
/* XXX: until vmscan.c knows about root_mem_cgroup */
or so, if this is the case, to explain the temporary nastiness.
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Ying Han <yinghan@google.com>, Michal Hocko <mhocko@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>,
Minchan Kim <minchan.kim@gmail.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Mel Gorman <mgorman@suse.de>, Greg Thelen <gthelen@google.com>,
Michel Lespinasse <walken@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 2/8] mm: memcg-aware global reclaim
Date: Thu, 9 Jun 2011 18:57:48 +0200 [thread overview]
Message-ID: <20110609165748.GA20333@cmpxchg.org> (raw)
In-Reply-To: <20110609092617.GB10741@infradead.org>
On Thu, Jun 09, 2011 at 05:26:17AM -0400, Christoph Hellwig wrote:
> On Wed, Jun 08, 2011 at 11:30:46AM +0200, Johannes Weiner wrote:
> > On Tue, Jun 07, 2011 at 08:25:19AM -0400, Christoph Hellwig wrote:
> > > A few small nitpicks:
> > >
> > > > +struct mem_cgroup *mem_cgroup_hierarchy_walk(struct mem_cgroup *root,
> > > > + struct mem_cgroup *prev)
> > > > +{
> > > > + struct mem_cgroup *mem;
> > > > +
> > > > + if (mem_cgroup_disabled())
> > > > + return NULL;
> > > > +
> > > > + if (!root)
> > > > + root = root_mem_cgroup;
> > > > + /*
> > > > + * Even without hierarchy explicitely enabled in the root
> > > > + * memcg, it is the ultimate parent of all memcgs.
> > > > + */
> > > > + if (!(root == root_mem_cgroup || root->use_hierarchy))
> > > > + return root;
> > >
> > > The logic here reads a bit weird, why not simply:
> > >
> > > /*
> > > * Even without hierarchy explicitely enabled in the root
> > > * memcg, it is the ultimate parent of all memcgs.
> > > */
> > > if (!root || root == root_mem_cgroup)
> > > return root_mem_cgroup;
> > > if (root->use_hierarchy)
> > > return root;
> >
> > What you are proposing is not equivalent, so... case in point! It's
> > meant to do the hierarchy walk for when foo->use_hierarchy, obviously,
> > but ALSO for root_mem_cgroup, which is parent to everyone else even
> > without use_hierarchy set. I changed it to read like this:
> >
> > if (!root)
> > root = root_mem_cgroup;
> > if (!root->use_hierarchy && root != root_mem_cgroup)
> > return root;
> > /* actually iterate hierarchy */
> >
> > Does that make more sense?
>
> It does, sorry for misparsing it. The thing that I really hated was
> the conditional assignment of root. Can we clean this up somehow
> by making the caller pass root_mem_cgroup in the case where it
> passes root right now, or at least always pass NULL when it means
> root_mem_cgroup.
>
> Note really that important in the end, it just irked me when I looked
> over it, especially the conditional assigned of root to root_mem_cgroup,
> and then a little later checking for the equality of the two.
Yeah, the assignment is an ugly interface fixup because
root_mem_cgroup is local to memcontrol.c, as is struct mem_cgroup as a
whole.
I'll look into your suggestion from the other mail of making struct
mem_cgroup and struct mem_cgroup_per_zone always available, and have
everyone operate against root_mem_cgroup per default.
> Thinking about it it's probably better left as-is for now to not
> complicate the series, and maybe revisit it later once things have
> settled a bit.
I may take you up on that if this approach turns out to require more
change than is sensible to add to this series.
I'll at least add an
/* XXX: until vmscan.c knows about root_mem_cgroup */
or so, if this is the case, to explain the temporary nastiness.
--
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-06-09 16:58 UTC|newest]
Thread overview: 214+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 6:25 [patch 0/8] mm: memcg naturalization -rc2 Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-01 6:25 ` [patch 1/8] memcg: remove unused retry signal from reclaim Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-01 6:25 ` [patch 2/8] mm: memcg-aware global reclaim Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-02 13:59 ` Hiroyuki Kamezawa
2011-06-02 13:59 ` Hiroyuki Kamezawa
2011-06-02 15:01 ` Johannes Weiner
2011-06-02 15:01 ` Johannes Weiner
2011-06-02 16:14 ` Hiroyuki Kamezawa
2011-06-02 16:14 ` Hiroyuki Kamezawa
2011-06-02 17:29 ` Johannes Weiner
2011-06-02 17:29 ` Johannes Weiner
2011-06-09 14:01 ` Michal Hocko
2011-06-09 14:01 ` Michal Hocko
2011-06-07 12:25 ` Christoph Hellwig
2011-06-07 12:25 ` Christoph Hellwig
2011-06-08 9:30 ` Johannes Weiner
2011-06-08 9:30 ` Johannes Weiner
2011-06-09 9:26 ` Christoph Hellwig
2011-06-09 9:26 ` Christoph Hellwig
2011-06-09 16:57 ` Johannes Weiner [this message]
2011-06-09 16:57 ` Johannes Weiner
2011-06-09 13:12 ` Michal Hocko
2011-06-09 13:12 ` Michal Hocko
2011-06-09 13:45 ` Johannes Weiner
2011-06-09 13:45 ` Johannes Weiner
2011-06-09 15:48 ` Minchan Kim
2011-06-09 15:48 ` Minchan Kim
2011-06-09 17:23 ` Johannes Weiner
2011-06-09 17:23 ` Johannes Weiner
2011-06-09 23:41 ` Minchan Kim
2011-06-09 23:41 ` Minchan Kim
2011-06-09 23:47 ` Minchan Kim
2011-06-09 23:47 ` Minchan Kim
2011-06-10 0:34 ` Johannes Weiner
2011-06-10 0:34 ` Johannes Weiner
2011-06-10 0:48 ` Minchan Kim
2011-06-10 0:48 ` Minchan Kim
2011-08-11 20:39 ` Ying Han
2011-08-11 21:09 ` Johannes Weiner
2011-08-11 21:09 ` Johannes Weiner
2011-08-29 7:15 ` Ying Han
2011-08-29 7:15 ` Ying Han
2011-08-29 7:22 ` Ying Han
2011-08-29 7:22 ` Ying Han
2011-08-29 7:57 ` Johannes Weiner
2011-08-29 7:57 ` Johannes Weiner
2011-08-30 6:08 ` Ying Han
2011-08-30 6:08 ` Ying Han
2011-08-29 19:04 ` Johannes Weiner
2011-08-29 19:04 ` Johannes Weiner
2011-08-29 20:36 ` Ying Han
2011-08-29 21:05 ` Johannes Weiner
2011-08-29 21:05 ` Johannes Weiner
2011-08-30 7:07 ` Ying Han
2011-08-30 7:07 ` Ying Han
2011-08-30 15:14 ` Johannes Weiner
2011-08-30 15:14 ` Johannes Weiner
2011-08-31 22:58 ` Ying Han
2011-08-31 22:58 ` Ying Han
2011-09-21 8:44 ` Johannes Weiner
2011-09-21 8:44 ` Johannes Weiner
2011-08-29 8:07 ` Johannes Weiner
2011-08-29 8:07 ` Johannes Weiner
2011-06-01 6:25 ` [patch 3/8] memcg: reclaim statistics Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-01 6:25 ` [patch 4/8] memcg: rework soft limit reclaim Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-02 5:37 ` Ying Han
2011-06-02 5:37 ` Ying Han
2011-06-02 21:55 ` Ying Han
2011-06-02 21:55 ` Ying Han
2011-06-03 5:25 ` Ying Han
2011-06-03 5:25 ` Ying Han
2011-06-09 15:00 ` Michal Hocko
2011-06-09 15:00 ` Michal Hocko
2011-06-10 7:36 ` Michal Hocko
2011-06-10 7:36 ` Michal Hocko
2011-06-15 22:57 ` Ying Han
2011-06-15 22:57 ` Ying Han
2011-06-16 0:33 ` Ying Han
2011-06-16 0:33 ` Ying Han
2011-06-16 11:45 ` Michal Hocko
2011-06-16 11:45 ` Michal Hocko
2011-06-15 22:48 ` Ying Han
2011-06-15 22:48 ` Ying Han
2011-06-16 11:41 ` Michal Hocko
2011-06-16 11:41 ` Michal Hocko
2011-06-01 6:25 ` [patch 5/8] memcg: remove unused soft limit code Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-13 9:26 ` Michal Hocko
2011-06-13 9:26 ` Michal Hocko
2011-06-01 6:25 ` [patch 6/8] vmscan: change zone_nr_lru_pages to take memcg instead of scan control Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-02 13:30 ` Hiroyuki Kamezawa
2011-06-02 13:30 ` Hiroyuki Kamezawa
2011-06-02 14:28 ` Johannes Weiner
2011-06-02 14:28 ` Johannes Weiner
2011-06-13 9:29 ` Michal Hocko
2011-06-13 9:29 ` Michal Hocko
2011-06-01 6:25 ` [patch 7/8] vmscan: memcg-aware unevictable page rescue scanner Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-02 13:27 ` Hiroyuki Kamezawa
2011-06-02 13:27 ` Hiroyuki Kamezawa
2011-06-02 14:27 ` Johannes Weiner
2011-06-02 14:27 ` Johannes Weiner
2011-06-02 21:02 ` Ying Han
2011-06-02 21:02 ` Ying Han
2011-06-02 22:01 ` Hiroyuki Kamezawa
2011-06-02 22:01 ` Hiroyuki Kamezawa
2011-06-02 22:19 ` Johannes Weiner
2011-06-02 22:19 ` Johannes Weiner
2011-06-02 23:15 ` Hiroyuki Kamezawa
2011-06-02 23:15 ` Hiroyuki Kamezawa
2011-06-03 5:08 ` Ying Han
2011-06-03 5:08 ` Ying Han
2011-06-13 9:42 ` Michal Hocko
2011-06-13 9:42 ` Michal Hocko
2011-06-13 10:30 ` Johannes Weiner
2011-06-13 10:30 ` Johannes Weiner
2011-06-13 11:18 ` Michal Hocko
2011-06-13 11:18 ` Michal Hocko
2011-07-19 22:47 ` Ying Han
2011-07-20 0:36 ` Johannes Weiner
2011-07-20 0:36 ` Johannes Weiner
2011-08-29 7:28 ` Ying Han
2011-08-29 7:28 ` Ying Han
2011-08-29 7:59 ` Johannes Weiner
2011-08-29 7:59 ` Johannes Weiner
2011-06-01 6:25 ` [patch 8/8] mm: make per-memcg lru lists exclusive Johannes Weiner
2011-06-01 6:25 ` Johannes Weiner
2011-06-02 13:16 ` Hiroyuki Kamezawa
2011-06-02 13:16 ` Hiroyuki Kamezawa
2011-06-02 14:24 ` Johannes Weiner
2011-06-02 14:24 ` Johannes Weiner
2011-06-02 15:54 ` Hiroyuki Kamezawa
2011-06-02 15:54 ` Hiroyuki Kamezawa
2011-06-02 17:57 ` Johannes Weiner
2011-06-02 17:57 ` Johannes Weiner
2011-06-08 15:04 ` Michal Hocko
2011-06-08 15:04 ` Michal Hocko
2011-06-07 12:42 ` Christoph Hellwig
2011-06-07 12:42 ` Christoph Hellwig
2011-06-08 8:54 ` Johannes Weiner
2011-06-08 8:54 ` Johannes Weiner
2011-06-09 9:23 ` Christoph Hellwig
2011-06-09 9:23 ` Christoph Hellwig
2011-08-11 20:33 ` Ying Han
2011-08-12 8:34 ` Johannes Weiner
2011-08-12 8:34 ` Johannes Weiner
2011-08-12 17:08 ` Ying Han
2011-08-12 19:17 ` Johannes Weiner
2011-08-12 19:17 ` Johannes Weiner
2011-08-15 3:01 ` Ying Han
2011-08-15 3:01 ` Ying Han
2011-08-15 1:34 ` Ying Han
2011-08-15 1:34 ` Ying Han
2011-08-15 9:39 ` Johannes Weiner
2011-08-15 9:39 ` Johannes Weiner
2011-06-01 23:52 ` [patch 0/8] mm: memcg naturalization -rc2 Hiroyuki Kamezawa
2011-06-01 23:52 ` Hiroyuki Kamezawa
2011-06-02 0:35 ` Greg Thelen
2011-06-02 0:35 ` Greg Thelen
2011-06-09 1:13 ` Rik van Riel
2011-06-09 1:13 ` Rik van Riel
2011-06-02 4:05 ` Ying Han
2011-06-02 4:05 ` Ying Han
2011-06-02 7:50 ` Johannes Weiner
2011-06-02 7:50 ` Johannes Weiner
2011-06-02 15:51 ` Ying Han
2011-06-02 15:51 ` Ying Han
2011-06-02 17:51 ` Johannes Weiner
2011-06-02 17:51 ` Johannes Weiner
2011-06-08 3:45 ` Ying Han
2011-06-08 3:53 ` Ying Han
2011-06-08 3:53 ` Ying Han
2011-06-08 15:32 ` Johannes Weiner
2011-06-08 15:32 ` Johannes Weiner
2011-06-09 3:52 ` Ying Han
2011-06-09 3:52 ` Ying Han
2011-06-09 8:35 ` Johannes Weiner
2011-06-09 8:35 ` Johannes Weiner
2011-06-09 17:36 ` Ying Han
2011-06-09 17:36 ` Ying Han
2011-06-09 18:36 ` Johannes Weiner
2011-06-09 18:36 ` Johannes Weiner
2011-06-09 21:38 ` Ying Han
2011-06-09 21:38 ` Ying Han
2011-06-09 22:30 ` Ying Han
2011-06-09 22:30 ` Ying Han
2011-06-09 23:31 ` Johannes Weiner
2011-06-09 23:31 ` Johannes Weiner
2011-06-10 0:17 ` Ying Han
2011-06-10 0:17 ` Ying Han
2011-06-02 7:33 ` Johannes Weiner
2011-06-02 7:33 ` Johannes Weiner
2011-06-02 9:06 ` Hiroyuki Kamezawa
2011-06-02 9:06 ` Hiroyuki Kamezawa
2011-06-02 10:00 ` Johannes Weiner
2011-06-02 10:00 ` Johannes Weiner
2011-06-02 12:59 ` Hiroyuki Kamezawa
2011-06-02 12:59 ` Hiroyuki Kamezawa
2011-06-09 1:15 ` Rik van Riel
2011-06-09 1:15 ` Rik van Riel
2011-06-09 8:43 ` Johannes Weiner
2011-06-09 8:43 ` Johannes Weiner
2011-06-09 9:31 ` Christoph Hellwig
2011-06-09 9:31 ` Christoph Hellwig
2011-06-13 9:47 ` Michal Hocko
2011-06-13 9:47 ` Michal Hocko
2011-06-13 10:35 ` Johannes Weiner
2011-06-13 10:35 ` Johannes Weiner
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=20110609165748.GA20333@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=gthelen@google.com \
--cc=hch@infradead.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan.kim@gmail.com \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=riel@redhat.com \
--cc=walken@google.com \
--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.