On Fri, 25 Jul 2008 17:46:45 +0100 (BST) Hugh Dickins <hugh@xxxxxxxxxxx> wrote: > IIRC Rik expressed the same by pointing out that a cgroup at its > swap limit would then be forced to grow in mem (until it hits its > mem limit): so controlling the less precious resource would increase > pressure on the more precious resource. (Actually, that probably > bears little relation to what he said - sorry, Rik!) I don't recall > what answer he got, perhaps I'd be persuaded if I heard it again. > Added Nishimura to CC. IMHO, from user point of view, both of - having 2 controls as mem controller + swap controller - mem + swap controller doesn't have much difference. The users will use as they like. >From memory controller's point of view, treating mem+swap by the same controller makes sense. Because memory controller can check wheter we can use more swap or not, we can avoid hopeless-scanning of Anon at swap-shortage. (By split-lru, I think we can do this avoidance.) Another-Topic? In recent servers, memory is big, swap is (relatively) small. And under memory resource controller, the whole swap is easily occupied by a group. I want to avoid it. For users, swap is not precious because it's not fast. But for memory reclaiming, swap is precious resource to page out anonymous/shmem/tmpfs memory. I think usual system-admin considers swap as some emergency spare of memory. I'd like to allow this "emergency spare" to each cgroup. (For example, swap is used even if vm.swappiness==0. This is for avoiding OOM-Killer under some situation, this behavior is added by Rik.) == following is another use case I explained to Rik at 23/May/08 == IIRC, a man shown his motivation to controll swap in OLS2007/BOF as following. Consider following system. (and there is no swap controller.) Memory 4G. Swap 1G. with 2 cgroups A, B. state 1) swap is not used. A....memory limit to be 1G no swap usage memory_usage=0M B....memory limit to be 1G no swap usage memory_usage=0M state 2) Run a big program on A. A....memory limit to be 1G and try to use 1.7G. uses 700MBytes of swap. memory_usage=1G swap_usage=700M B....memory_usage=0M state 3) A some of programs ends in 'A' A....memory_usage=500M swap_usage=700M B....memory_usage=0M. state 4) Run a big program on B. A...memory_usage=500M swap_usage=700M. B...memory_usage=1G swap_usage=300M Group B can only use 1.3G because of unfair swap use of group A. But users think why A uses 700M of swap with 500M of free memory.... == Thanks, -Kame _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers