Thread (19 messages) 19 messages, 3 authors, 2014-09-17

Re: [RFC] memory cgroup: my thoughts on memsw

From: Vladimir Davydov <hidden>
Date: 2014-09-11 07:04:11
Also in: linux-mm, lkml

On Thu, Sep 11, 2014 at 10:22:51AM +0900, Kamezawa Hiroyuki wrote:
(2014/09/10 21:01), Vladimir Davydov wrote:
quoted
On Mon, Sep 08, 2014 at 10:53:48PM +0900, Kamezawa Hiroyuki wrote:
quoted
(2014/09/08 20:01), Vladimir Davydov wrote:
quoted
On Sat, Sep 06, 2014 at 08:15:44AM +0900, Kamezawa Hiroyuki wrote:
quoted
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.
quoted
 - 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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help