From: Michal Hocko <mhocko@suse.cz>
To: Vladimir Davydov <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch 4/5] mm: memcontrol: continue cache reclaim from offlined groups
Date: Fri, 17 Oct 2014 16:00:22 +0200 [thread overview]
Message-ID: <20141017140022.GF8076@dhcp22.suse.cz> (raw)
In-Reply-To: <20141017084011.GC5641@esperanza>
On Fri 17-10-14 10:40:11, Vladimir Davydov wrote:
> On Tue, Oct 14, 2014 at 12:20:36PM -0400, Johannes Weiner wrote:
> > On cgroup deletion, outstanding page cache charges are moved to the
> > parent group so that they're not lost and can be reclaimed during
> > pressure on/inside said parent. But this reparenting is fairly tricky
> > and its synchroneous nature has led to several lock-ups in the past.
> >
> > Since css iterators now also include offlined css, memcg iterators can
> > be changed to include offlined children during reclaim of a group, and
> > leftover cache can just stay put.
> >
> > There is a slight change of behavior in that charges of deleted groups
> > no longer show up as local charges in the parent. But they are still
> > included in the parent's hierarchical statistics.
> >
> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> > ---
> > mm/memcontrol.c | 218 +-------------------------------------------------------
> > 1 file changed, 1 insertion(+), 217 deletions(-)
>
> I do like the stats :-) However, as I've already mentioned, on big
> machines we can end up with hundred of thousands of dead css's.
css->id is bound to the css life so this is bound to the maximum number
of allowed cgroups AFAIR. It is true that dead memcgs might block
creation of new. This is a good point. It would be a problem either when
there is no reclaim (global or memcg) or when groups are very short
lived. One possible way out would be counting dead memcgs and kick
background mem_cgroup_force_empty loop over those that are dead once we
hit a threshold. This should be pretty trivial to implement.
> Iterating over all of them during reclaim may result in noticeable lags.
> One day we'll have to do something about that I guess.
>
> Another issue is that AFAICT currently we can't have more than 64K
> cgroups due to the MEM_CGROUP_ID_MAX limit.The limit exists, because we
> use css ids for tagging swap entries and we don't want to spend too much
> memory on this. May be, we should simply use the mem_cgroup pointer
> instead of the css id?
We are using the id to reduce the memory footprint. We cannot effort 8B
per each swappage (we can have GBs of swap space in the system).
> OTOH, the reparenting code looks really ugly. And we can't easily
> reparent swap and kmem. So I think it's a reasonable change.
At least swap shouldn't be a big deal. Hugh already had a patch for
that. You would simply have to go over all swap entries and change the
id. kmem should be doable as well as you have already shown in your
patches. The main question is. Do we really need it? I think we are good
now and should make the code more complicated once this starts being a
practical problem.
> Acked-by: Vladimir Davydov <vdavydov@parallels.com>
>
> --
> 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>
--
Michal Hocko
SUSE Labs
--
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:[~2014-10-17 14:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-14 16:20 [patch 0/5] mm: memcontrol: eliminate charge reparenting v2 Johannes Weiner
2014-10-14 16:20 ` [patch 1/5] mm: memcontrol: convert reclaim iterator to simple css refcounting Johannes Weiner
2014-10-15 15:02 ` Michal Hocko
2014-10-15 18:31 ` Johannes Weiner
2014-10-14 16:20 ` [patch 2/5] mm: memcontrol: take a css reference for each charged page Johannes Weiner
2014-10-15 15:18 ` Michal Hocko
2014-10-15 18:44 ` Johannes Weiner
2014-10-14 16:20 ` [patch 3/5] mm: memcontrol: remove obsolete kmemcg pinning tricks Johannes Weiner
2014-10-15 15:21 ` Michal Hocko
2014-10-14 16:20 ` [patch 4/5] mm: memcontrol: continue cache reclaim from offlined groups Johannes Weiner
2014-10-15 15:25 ` Michal Hocko
2014-10-17 3:02 ` Johannes Weiner
2014-10-17 4:42 ` Andrew Morton
2014-10-17 8:40 ` Vladimir Davydov
2014-10-17 14:00 ` Michal Hocko [this message]
2014-10-17 15:20 ` Vladimir Davydov
2014-10-14 16:20 ` [patch 5/5] mm: memcontrol: remove synchroneous stock draining code Johannes Weiner
2014-10-15 15:28 ` Michal Hocko
2014-10-17 8:48 ` Vladimir Davydov
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=20141017140022.GF8076@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=vdavydov@parallels.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;
as well as URLs for NNTP newsgroup(s).