aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-07-31 19:42:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:41 -0400
commitabb8206cb07734d0b7bf033c715995d6371a94c3 (patch)
treea27a55420bd6fad941c559bb80176f10931deb60 /mm/hugetlb.c
parentda1def55919f4852c4759249a78d63a0c5d2d8f9 (diff)
hugetlb/cgroup: add hugetlb cgroup control files
Add the control files for hugetlb controller [akpm@linux-foundation.org: s/CONFIG_CGROUP_HUGETLB_RES_CTLR/CONFIG_MEMCG_HUGETLB/g] [akpm@linux-foundation.org: s/CONFIG_MEMCG_HUGETLB/CONFIG_CGROUP_HUGETLB/] Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: David Rientjes <rientjes@google.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Hillf Danton <dhillf@gmail.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 16a0f32c4820..c57740bb203a 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -30,6 +30,7 @@
30#include <linux/hugetlb.h> 30#include <linux/hugetlb.h>
31#include <linux/hugetlb_cgroup.h> 31#include <linux/hugetlb_cgroup.h>
32#include <linux/node.h> 32#include <linux/node.h>
33#include <linux/hugetlb_cgroup.h>
33#include "internal.h" 34#include "internal.h"
34 35
35const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; 36const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
@@ -1930,6 +1931,13 @@ void __init hugetlb_add_hstate(unsigned order)
1930 h->next_nid_to_free = first_node(node_states[N_HIGH_MEMORY]); 1931 h->next_nid_to_free = first_node(node_states[N_HIGH_MEMORY]);
1931 snprintf(h->name, HSTATE_NAME_LEN, "hugepages-%lukB", 1932 snprintf(h->name, HSTATE_NAME_LEN, "hugepages-%lukB",
1932 huge_page_size(h)/1024); 1933 huge_page_size(h)/1024);
1934 /*
1935 * Add cgroup control files only if the huge page consists
1936 * of more than two normal pages. This is because we use
1937 * page[2].lru.next for storing cgoup details.
1938 */
1939 if (order >= HUGETLB_CGROUP_MIN_ORDER)
1940 hugetlb_cgroup_file_init(hugetlb_max_hstate - 1);
1933 1941
1934 parsed_hstate = h; 1942 parsed_hstate = h;
1935} 1943}