From: Vladimir Davydov <vdavydov@parallels.com>
To: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.cz>, Greg Thelen <gthelen@google.com>,
Hugh Dickins <hughd@google.com>,
Motohiro Kosaki <Motohiro.Kosaki@us.fujitsu.com>,
Glauber Costa <glommer@gmail.com>, Tejun Heo <tj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Pavel Emelianov <xemul@parallels.com>,
Konstantin Khorenko <khorenko@parallels.com>,
LKML-MM <linux-mm@kvack.org>,
LKML-cgroups <cgroups@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] memory cgroup: my thoughts on memsw
Date: Thu, 11 Sep 2014 11:03:53 +0400 [thread overview]
Message-ID: <20140911070353.GA4151@esperanza> (raw)
In-Reply-To: <5410F96B.1020308@jp.fujitsu.com>
On Thu, Sep 11, 2014 at 10:22:51AM +0900, Kamezawa Hiroyuki wrote:
> (2014/09/10 21:01), Vladimir Davydov wrote:
> >On Mon, Sep 08, 2014 at 10:53:48PM +0900, Kamezawa Hiroyuki wrote:
> >>(2014/09/08 20:01), Vladimir Davydov wrote:
> >>>On Sat, Sep 06, 2014 at 08:15:44AM +0900, Kamezawa Hiroyuki wrote:
> >>>>As you noticed, hitting anon+swap limit just means oom-kill.
> >>>>My point is that using oom-killer for "server management" just seems crazy.
> >>>>
> >>>>Let my clarify things. your proposal was.
> >>>> 1. soft-limit will be a main feature for server management.
> >>>> 2. Because of soft-limit, global memory reclaim runs.
> >>>> 3. Using swap at global memory reclaim can cause poor performance.
> >>>> 4. So, making use of OOM-Killer for avoiding swap.
> >>>>
> >>>>I can't agree "4". I think
> >>>>
> >>>> - don't configure swap.
> >>>
> >>>Suppose there are two containers, each having soft limit set to 50% of
> >>>total system RAM. One of the containers eats 90% of the system RAM by
> >>>allocating anonymous pages. Another starts using file caches and wants
> >>>more than 10% of RAM to work w/o issuing disk reads. So what should we
> >>>do then?
> >>>We won't be able to shrink the first container to its soft
> >>>limit, because there's no swap. Leaving it as is would be unfair from
> >>>the second container's point of view. Kill it? But the whole system is
> >>>going OK, because the working set of the second container is easily
> >>>shrinkable. Besides there may be some progress in shrinking file caches
> >>>from the first container.
> >>>
> >>>> - use zram
> >>>
> >>>In fact this isn't different from the previous proposal (working w/o
> >>>swap). ZRAM only compresses data while still storing them in RAM so we
> >>>eventually may get into a situation where almost all RAM is full of
> >>>compressed anon pages.
> >>>
> >>
> >>In above 2 cases, "vmpressure" works fine.
> >
> >What if a container allocates memory so fast that the userspace thread
> >handling its threshold notifications won't have time to react before it
> >eats all memory?
> >
>
> Softlimit is for avoiding such unfair memory scheduling, isn't it ?
Yeah, and we're returning back to the very beginning. Anonymous memory
reclaim triggered by soft limit may be impossible due to lack of swap
space or really sluggish. The whole system will be dragging its feet
until it finally realizes the container must be killed. It's a kind of
DOS attack...
Thanks,
Vladimir
--
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-09-11 7:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 14:30 [RFC] memory cgroup: my thoughts on memsw Vladimir Davydov
2014-09-04 22:03 ` Kamezawa Hiroyuki
2014-09-05 8:28 ` Vladimir Davydov
2014-09-05 14:20 ` Kamezawa Hiroyuki
2014-09-05 16:00 ` Vladimir Davydov
2014-09-05 23:15 ` Kamezawa Hiroyuki
2014-09-08 11:01 ` Vladimir Davydov
2014-09-08 13:53 ` Kamezawa Hiroyuki
2014-09-09 10:39 ` Vladimir Davydov
2014-09-11 2:04 ` Kamezawa Hiroyuki
2014-09-11 8:23 ` Vladimir Davydov
2014-09-11 8:53 ` Kamezawa Hiroyuki
2014-09-11 9:50 ` Vladimir Davydov
2014-09-10 12:01 ` Vladimir Davydov
2014-09-11 1:22 ` Kamezawa Hiroyuki
2014-09-11 7:03 ` Vladimir Davydov [this message]
2014-09-15 19:14 ` Johannes Weiner
2014-09-16 1:34 ` Kamezawa Hiroyuki
2014-09-17 15:59 ` 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=20140911070353.GA4151@esperanza \
--to=vdavydov@parallels.com \
--cc=Motohiro.Kosaki@us.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=glommer@gmail.com \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=khorenko@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=tj@kernel.org \
--cc=xemul@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).