cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: linux-mm@kvack.org, mgorman@suse.de,
	kamezawa.hiroyu@jp.fujitsu.com, dhillf@gmail.com,
	aarcange@redhat.com, mhocko@suse.cz, akpm@linux-foundation.org,
	hannes@cmpxchg.org
Cc: linux-kernel@vger.kernel.org, cgroups@kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [PATCH -V1 9/9] hugetlbfs: Add HugeTLB controller documentation
Date: Mon, 20 Feb 2012 16:51:42 +0530	[thread overview]
Message-ID: <1329736902-26870-10-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)
In-Reply-To: <1329736902-26870-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 Documentation/cgroups/hugetlb.txt |   54 +++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/cgroups/hugetlb.txt

diff --git a/Documentation/cgroups/hugetlb.txt b/Documentation/cgroups/hugetlb.txt
new file mode 100644
index 0000000..722aa8e
--- /dev/null
+++ b/Documentation/cgroups/hugetlb.txt
@@ -0,0 +1,54 @@
+HugeTLB controller
+-----------------
+
+The HugetTLB controller is used to group tasks using cgroups and
+limit the HugeTLB pages used by these groups of tasks. HugetTLB cgroup
+enforce the limit during mmap(2). This enables application to fall back
+to allocation using smaller page size if the cgroup resource limit prevented
+them from allocating HugeTLB pages.
+
+
+The HugetTLB controller supports multi-hierarchy groups and task migration
+across cgroups.
+
+HugeTLB groups can be created by first mounting the cgroup filesystem.
+
+# mount -t cgroup -o hugetlb none /sys/fs/cgroup
+
+With the above step, the initial or the root HugeTLB cgroup becomes
+visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
+the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup. HugeTLB
+cgroup create seperate limit, usage and max_usage files for each huge page
+size supported. An example listing is given below
+
+hugetlb.16GB.limit_in_bytes
+hugetlb.16GB.max_usage_in_bytes
+hugetlb.16GB.usage_in_bytes
+hugetlb.16MB.limit_in_bytes
+hugetlb.16MB.max_usage_in_bytes
+hugetlb.16MB.usage_in_bytes
+
+/sys/fs/cgroup/hugetlb.<pagesize>.usage_in_bytes  gives the HugeTLB usage
+by this group which is essentially the total size HugeTLB pages obtained
+by all the tasks in the system.
+
+New cgroup can be created under root HugeTLB cgroup /sys/fs/cgroup
+
+# cd /sys/fs/cgroup
+# mkdir g1
+# echo $$ > g1/tasks
+
+The above steps create a new group g1 and move the current shell
+process (bash) into it. 16MB HugeTLB pages consumed by this bash and its
+children can be obtained from g1/hugetlb.16MB.usage_in_bytes and the same
+is accumulated in /sys/fs/cgroup/hugetlb.16MB.usage_in_bytes.
+
+We can limit the usage of 16MB hugepage by a hugeTLB cgroup using
+hugetlb.16MB.limit_in_bytes
+
+# echo 16M > /sys/fs/cgroup/g1/hugetlb.16MB.limit_in_bytes
+# hugectl  --heap=16M /root/heap
+libhugetlbfs: WARNING: New heap segment map at 0x20000000000 failed: Cannot allocate memory
+# echo -1 > /sys/fs/cgroup/g1/hugetlb.16MB.limit_in_bytes
+# hugectl  --heap=16M /root/heap
+#
-- 
1.7.9

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2012-02-20 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 11:21 [PATCH -V1 0/9] hugetlbfs: Add cgroup resource controller for hugetlbfs Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 1/9] hugetlbfs: Add new HugeTLB cgroup Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 2/9] hugetlbfs: Add usage and max usage files to hugetlb cgroup Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 3/9] hugetlbfs: Add new region handling functions Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 4/9] hugetlbfs: Add controller support for shared mapping Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 5/9] hugetlbfs: Add controller support for private mapping Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 6/9] hugetlbfs: Switch to new region APIs Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 7/9] hugetlbfs: Add truncate region functions Aneesh Kumar K.V
2012-02-20 11:21 ` [PATCH -V1 8/9] hugetlbfs: Add task migration support Aneesh Kumar K.V
2012-02-20 11:21 ` Aneesh Kumar K.V [this message]

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=1329736902-26870-10-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@kernel.org \
    --cc=dhillf@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    /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).