From: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
To: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
Cc: Michel Lespinasse
<walken-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Balbir Singh
<bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
KAMEZAWA Hiroyuki
<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
Hugh Dickins <hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Ying Han <yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: memcg: softlimit on internal nodes
Date: Tue, 23 Apr 2013 13:40:20 +0200 [thread overview]
Message-ID: <20130423114020.GC8001@dhcp22.suse.cz> (raw)
In-Reply-To: <51765FB2.3070506-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
On Tue 23-04-13 14:17:22, Glauber Costa wrote:
> On 04/23/2013 01:58 PM, Michel Lespinasse wrote:
> > On Mon, Apr 22, 2013 at 8:54 AM, Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org> wrote:
> >> On Mon 22-04-13 08:46:20, Tejun Heo wrote:
> >>> Oh, if so, I'm happy. Sorry about being brash on the thread; however,
> >>> please talk with google memcg people. They have very different
> >>> interpretation of what "softlimit" is and are using it according to
> >>> that interpretation. If it *is* an actual soft limit, there is no
> >>> inherent isolation coming from it and that should be clear to
> >>> everyone.
> >>
> >> We have discussed that for a long time. I will not speak for Greg & Ying
> >> but from my POV we have agreed that the current implementation will work
> >> for them with some (minor) changes in their layout.
> >> As I have said already with a careful configuration (e.i. setting the
> >> soft limit only where it matters - where it protects an important
> >> memory which is usually in the leaf nodes)
> >
> > I don't like your argument that soft limits work if you only set them
> > on leaves. To me this is just a fancy way of saying that hierarchical
> > soft limits don't work.
> >
> > Also it is somewhat problematic to assume that important memory can
> > easily be placed in leaves. This is difficult to ensure when
> > subcontainer destruction, for example, moves the memory back into the
> > parent.
> >
>
> Michal,
>
> For the most part, I am siding with you in this discussion.
> But with this only-in-leaves thing, I am forced to flip (at least for this).
>
> You are right when you say that in a configuration with A being parent
> of B and C, A being over its hard limit will affect reclaim in B and C,
> and soft limits should work the same.
>
> However, "will affect reclaim" is a big vague. More specifically, if the
> sum of B and C's hard limit is smaller or equal A's hard limit, the only
> way of either B or C to trigger A's hard limit is for them, themselves,
> to go over their hard limit.
Which is an expectation that you cannot guarantee. You can have B+C>A.
> *This* is the case you you are breaking when you try to establish a
> comparison between soft and hard limits - which is, per se, sane.
>
> Translating this to the soft limit speech, if the sum of B and C's soft
> limit is smaller or equal A's soft limit, and one of them is over the
> soft limit, that one should be reclaimed. The other should be left alone.
And yet again. Nothing will prevent you from setting B+C>A. Sure if you
configure your hierarchy sanely then everything will just work.
> I understand perfectly fine that soft limit is a best effort, not a
> guarantee. But if we don't do that, I understand that we are doing
> effort, not best effort.
>
> This would only be attempted in our first pass. In the second pass, we
> reclaim from whoever.
>
> It is also not that hard to do it: Flatten the tree in a list, with the
> leaves always being placed before the inner nodes.
Glauber, I have already pointed out that bottom-up reclaim doesn't make
much sense because it is a bigger chance that useful data is stored in
the leaf nodes rather than inner nodes which usually contain mostly
reparented pages.
> Start reclaiming from nodes over the soft limit, hierarchically. This
> means that whenever we reach an inner node and it is *still* over
> the soft limit, we are guaranteed to have scanned their children
> already. In the case I described, the children over its soft limit
> would have been reclaimed, without the well behaving children being
> touched. Now all three are okay.
>
> If we reached an inner node and we still have a soft limit problem, then
> we are effectively talking about the case you have been describing.
> Reclaim from whoever you want.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2013-04-23 11:40 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-20 0:26 memcg: softlimit on internal nodes Tejun Heo
[not found] ` <20130420002620.GA17179-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-04-20 0:42 ` Tejun Heo
2013-04-20 3:35 ` Greg Thelen
2013-04-21 1:53 ` Tejun Heo
2013-04-20 3:16 ` Michal Hocko
2013-04-21 2:23 ` Tejun Heo
[not found] ` <20130421022321.GE19097-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-04-21 8:55 ` Michel Lespinasse
[not found] ` <CANN689GuN_5QdgPBjr7h6paVmPeCvLHYfLWNLsJMWib9V9G_Fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-22 4:24 ` Tejun Heo
[not found] ` <20130422042445.GA25089-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-04-22 7:14 ` Michel Lespinasse
2013-04-22 14:48 ` Tejun Heo
2013-04-22 15:37 ` Michal Hocko
2013-04-22 15:46 ` Tejun Heo
[not found] ` <20130422154620.GB12543-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-04-22 15:54 ` Michal Hocko
[not found] ` <20130422155454.GH18286-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-22 16:01 ` Tejun Heo
2013-04-23 9:58 ` Michel Lespinasse
2013-04-23 10:17 ` Glauber Costa
[not found] ` <51765FB2.3070506-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-04-23 11:40 ` Michal Hocko [this message]
[not found] ` <20130423114020.GC8001-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-23 11:54 ` Glauber Costa
2013-04-23 12:51 ` Michel Lespinasse
[not found] ` <CANN689FaGBi+LmdoSGBf3D9HmLD8Emma1_M3T1dARSD6=75B0w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-23 13:06 ` Michal Hocko
[not found] ` <20130423130627.GG8001-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-23 13:13 ` Glauber Costa
2013-04-23 13:28 ` Michal Hocko
[not found] ` <CANN689Hz5A+iMM3T76-8RCh8YDnoGrYBvtjL_+cXaYRR0OkGRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-23 11:32 ` Michal Hocko
[not found] ` <20130423113216.GB8001-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-23 12:45 ` Michel Lespinasse
[not found] ` <CANN689G47EFiSpH-d=yQSiUxPcHXveBi_aCL=o3yoHSa8K7LbQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-23 12:59 ` Michal Hocko
2013-04-23 12:51 ` Michal Hocko
2013-04-21 12:46 ` Michal Hocko
2013-04-22 4:39 ` Tejun Heo
2013-04-22 15:19 ` Michal Hocko
[not found] ` <20130422151908.GF18286-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-22 15:57 ` Tejun Heo
[not found] ` <20130422155703.GC12543-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-04-22 15:57 ` Tejun Heo
2013-04-22 16:20 ` Michal Hocko
[not found] ` <20130422162012.GI18286-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-22 18:30 ` Tejun Heo
2013-04-23 9:33 ` [RFC v2 0/4] soft limit rework Michal Hocko
[not found] ` <1366709639-10240-1-git-send-email-mhocko-AlSwsSmVLrQ@public.gmane.org>
2013-04-23 9:33 ` [RFC v2 1/4] memcg: integrate soft reclaim tighter with zone shrinking code Michal Hocko
2013-04-23 9:33 ` [RFC v2 2/4] memcg: Get rid of soft-limit tree infrastructure Michal Hocko
2013-04-23 9:33 ` [RFC v2 3/4] vmscan, memcg: Do softlimit reclaim also for targeted reclaim Michal Hocko
2013-04-23 9:33 ` [RFC v2 4/4] memcg: Ignore soft limit until it is explicitly specified Michal Hocko
[not found] ` <20130422183020.GF12543-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-04-23 9:29 ` memcg: softlimit on internal nodes Michal Hocko
2013-04-23 17:09 ` Tejun Heo
2013-04-26 11:51 ` Michal Hocko
[not found] ` <20130426115120.GG31157-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-04-26 18:37 ` Tejun Heo
[not found] ` <20130426183741.GA25940-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-04-29 15:27 ` Michal Hocko
2013-04-24 21:45 ` Johannes Weiner
2013-04-25 0:33 ` Tejun Heo
[not found] ` <20130425003335.GA32353-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-04-29 18:39 ` 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=20130423114020.GC8001@dhcp22.suse.cz \
--to=mhocko-alswssmvlrq@public.gmane.org \
--cc=bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
--cc=gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=hughd-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=walken-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=yinghan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
/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