From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757271AbZCAGao (ORCPT ); Sun, 1 Mar 2009 01:30:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752366AbZCAGaP (ORCPT ); Sun, 1 Mar 2009 01:30:15 -0500 Received: from e28smtp03.in.ibm.com ([59.145.155.3]:43878 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbZCAGaN (ORCPT ); Sun, 1 Mar 2009 01:30:13 -0500 From: Balbir Singh To: linux-mm@kvack.org Cc: Sudhir Kumar , YAMAMOTO Takashi , Bharata B Rao , Paul Menage , lizf@cn.fujitsu.com, linux-kernel@vger.kernel.org, KOSAKI Motohiro , David Rientjes , Pavel Emelianov , Dhaval Giani , Balbir Singh , Rik van Riel , Andrew Morton , KAMEZAWA Hiroyuki Date: Sun, 01 Mar 2009 12:00:05 +0530 Message-Id: <20090301063005.31557.1071.sendpatchset@localhost.localdomain> In-Reply-To: <20090301062959.31557.31079.sendpatchset@localhost.localdomain> References: <20090301062959.31557.31079.sendpatchset@localhost.localdomain> Subject: [PATCH 1/4] Memory controller soft limit documentation (v3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add documentation for soft limit feature support. From: Balbir Singh Signed-off-by: Balbir Singh --- Documentation/cgroups/memory.txt | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index a98a7fe..812cb74 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -360,7 +360,32 @@ 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 (kswapd is woken up) +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 + + +8. TODO 1. Add support for accounting huge pages (as a separate controller) 2. Make per-cgroup scanner reclaim not-shared pages first -- Balbir