From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with ESMTP id A0D866B0047 for ; Sat, 14 Mar 2009 13:31:00 -0400 (EDT) Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by e28smtp05.in.ibm.com (8.13.1/8.13.1) with ESMTP id n2EHUs1v024518 for ; Sat, 14 Mar 2009 23:00:54 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n2EHRcFK3526792 for ; Sat, 14 Mar 2009 22:57:39 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.13.1/8.13.3) with ESMTP id n2EHUrlB021624 for ; Sat, 14 Mar 2009 23:00:54 +0530 From: Balbir Singh Date: Sat, 14 Mar 2009 23:00:49 +0530 Message-Id: <20090314173049.16591.84676.sendpatchset@localhost.localdomain> In-Reply-To: <20090314173043.16591.18336.sendpatchset@localhost.localdomain> References: <20090314173043.16591.18336.sendpatchset@localhost.localdomain> Subject: [PATCH 1/4] Memory controller soft limit documentation (v6) Sender: owner-linux-mm@kvack.org To: linux-mm@kvack.org Cc: YAMAMOTO Takashi , lizf@cn.fujitsu.com, KOSAKI Motohiro , Balbir Singh , Rik van Riel , Andrew Morton , KAMEZAWA Hiroyuki List-ID: Feature: Add documentation for soft limits From: Balbir Singh Signed-off-by: Balbir Singh --- Documentation/cgroups/memory.txt | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index a98a7fe..c5f73d9 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -360,7 +360,36 @@ cgroups created below it. NOTE2: This feature can be enabled/disabled per subtree. -7. TODO +7. Soft limits + +Soft limits allow for greater sharing of memory. The idea behind soft limits +is to allow control groups to use as much of the memory as needed, provided + +a. There is no memory contention +b. They do not exceed their hard limit + +When the system detects memory contention or low memory control groups +are pushed back to their soft limits. If the soft limit of each control +group is very high, they are pushed back as much as possible to make +sure that one control group does not starve the others of memory. + +7.1 Interface + +Soft limits can be setup by using the following commands (in this example we +assume a soft limit of 256 megabytes) + +# echo 256M > memory.soft_limit_in_bytes + +If we want to change this to 1G, we can at any time use + +# echo 1G > memory.soft_limit_in_bytes + +NOTE1: Soft limits take effect over a long period of time, since they involve + reclaiming memory for balancing between memory cgroups +NOTE2: It is recommended to set the soft limit always below the hard limit, + otherwise the hard limit will take precedence. + +8. TODO 1. Add support for accounting huge pages (as a separate controller) 2. Make per-cgroup scanner reclaim not-shared pages first -- Balbir -- 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: email@kvack.org