From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758138Ab2CSHf7 (ORCPT ); Mon, 19 Mar 2012 03:35:59 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:36543 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298Ab2CSHf5 (ORCPT ); Mon, 19 Mar 2012 03:35:57 -0400 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <4F66E169.5000909@jp.fujitsu.com> Date: Mon, 19 Mar 2012 16:34:01 +0900 From: KAMEZAWA Hiroyuki User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: "Aneesh Kumar K.V" CC: linux-mm@kvack.org, mgorman@suse.de, dhillf@gmail.com, aarcange@redhat.com, mhocko@suse.cz, akpm@linux-foundation.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Tejun Heo Subject: Re: [PATCH -V4 07/10] hugetlbfs: Add memcg control files for hugetlbfs References: <1331919570-2264-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1331919570-2264-8-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <4F66A059.20801@jp.fujitsu.com> <87wr6hjc58.fsf@linux.vnet.ibm.com> In-Reply-To: <87wr6hjc58.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (2012/03/19 16:14), Aneesh Kumar K.V wrote: > On Mon, 19 Mar 2012 11:56:25 +0900, KAMEZAWA Hiroyuki wrote: >> (2012/03/17 2:39), Aneesh Kumar K.V wrote: >> >>> From: "Aneesh Kumar K.V" >>> >>> This add control files for hugetlbfs in memcg >>> >>> Signed-off-by: Aneesh Kumar K.V >> >> >> I have a question. When a user does >> >> 1. create memory cgroup as >> /cgroup/A >> 2. insmod hugetlb.ko >> 3. ls /cgroup/A >> >> and then, files can be shown ? Don't we have any problem at rmdir A ? >> >> I'm sorry if hugetlb never be used as module. > > HUGETLBFS cannot be build as kernel module > > >> >> a comment below. >> >>> --- >>> include/linux/hugetlb.h | 17 +++++++++++++++ >>> include/linux/memcontrol.h | 7 ++++++ >>> mm/hugetlb.c | 25 ++++++++++++++++++++++- >>> mm/memcontrol.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ >>> 4 files changed, 96 insertions(+), 1 deletions(-) > > > ...... > >>> >>> +#ifdef CONFIG_MEM_RES_CTLR_HUGETLB >>> +static char *mem_fmt(char *buf, unsigned long n) >>> +{ >>> + if (n >= (1UL << 30)) >>> + sprintf(buf, "%luGB", n >> 30); >>> + else if (n >= (1UL << 20)) >>> + sprintf(buf, "%luMB", n >> 20); >>> + else >>> + sprintf(buf, "%luKB", n >> 10); >>> + return buf; >>> +} >>> + >>> +int mem_cgroup_hugetlb_file_init(int idx) >>> +{ >> >> >> __init ? > > Added . > >> And... do we have guarantee that this function is called before >> creating root mem cgroup even if CONFIG_HUGETLBFS=y ? >> > > Yes. This should be called before creating root mem cgroup. > O.K. BTW, please read Tejun's recent post.. https://lkml.org/lkml/2012/3/16/522 Can you use his methods ? I guess you can write... CGROUP_SUBSYS_CFTYLES_COND(mem_cgroup_subsys, hugetlb_cgroup_files, if XXXXMB hugetlb is allowed); Hmm. Thanks, -Kame From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx119.postini.com [74.125.245.119]) by kanga.kvack.org (Postfix) with SMTP id A29F06B004A for ; Mon, 19 Mar 2012 03:35:57 -0400 (EDT) Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 2F71D3EE0BD for ; Mon, 19 Mar 2012 16:35:56 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 1595E45DE52 for ; Mon, 19 Mar 2012 16:35:56 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id F3FC245DE4D for ; Mon, 19 Mar 2012 16:35:55 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id E556A1DB803A for ; Mon, 19 Mar 2012 16:35:55 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.240.81.145]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 9E2D91DB8040 for ; Mon, 19 Mar 2012 16:35:55 +0900 (JST) Message-ID: <4F66E169.5000909@jp.fujitsu.com> Date: Mon, 19 Mar 2012 16:34:01 +0900 From: KAMEZAWA Hiroyuki MIME-Version: 1.0 Subject: Re: [PATCH -V4 07/10] hugetlbfs: Add memcg control files for hugetlbfs References: <1331919570-2264-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1331919570-2264-8-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <4F66A059.20801@jp.fujitsu.com> <87wr6hjc58.fsf@linux.vnet.ibm.com> In-Reply-To: <87wr6hjc58.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Aneesh Kumar K.V" Cc: linux-mm@kvack.org, mgorman@suse.de, dhillf@gmail.com, aarcange@redhat.com, mhocko@suse.cz, akpm@linux-foundation.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Tejun Heo (2012/03/19 16:14), Aneesh Kumar K.V wrote: > On Mon, 19 Mar 2012 11:56:25 +0900, KAMEZAWA Hiroyuki wrote: >> (2012/03/17 2:39), Aneesh Kumar K.V wrote: >> >>> From: "Aneesh Kumar K.V" >>> >>> This add control files for hugetlbfs in memcg >>> >>> Signed-off-by: Aneesh Kumar K.V >> >> >> I have a question. When a user does >> >> 1. create memory cgroup as >> /cgroup/A >> 2. insmod hugetlb.ko >> 3. ls /cgroup/A >> >> and then, files can be shown ? Don't we have any problem at rmdir A ? >> >> I'm sorry if hugetlb never be used as module. > > HUGETLBFS cannot be build as kernel module > > >> >> a comment below. >> >>> --- >>> include/linux/hugetlb.h | 17 +++++++++++++++ >>> include/linux/memcontrol.h | 7 ++++++ >>> mm/hugetlb.c | 25 ++++++++++++++++++++++- >>> mm/memcontrol.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ >>> 4 files changed, 96 insertions(+), 1 deletions(-) > > > ...... > >>> >>> +#ifdef CONFIG_MEM_RES_CTLR_HUGETLB >>> +static char *mem_fmt(char *buf, unsigned long n) >>> +{ >>> + if (n >= (1UL << 30)) >>> + sprintf(buf, "%luGB", n >> 30); >>> + else if (n >= (1UL << 20)) >>> + sprintf(buf, "%luMB", n >> 20); >>> + else >>> + sprintf(buf, "%luKB", n >> 10); >>> + return buf; >>> +} >>> + >>> +int mem_cgroup_hugetlb_file_init(int idx) >>> +{ >> >> >> __init ? > > Added . > >> And... do we have guarantee that this function is called before >> creating root mem cgroup even if CONFIG_HUGETLBFS=y ? >> > > Yes. This should be called before creating root mem cgroup. > O.K. BTW, please read Tejun's recent post.. https://lkml.org/lkml/2012/3/16/522 Can you use his methods ? I guess you can write... CGROUP_SUBSYS_CFTYLES_COND(mem_cgroup_subsys, hugetlb_cgroup_files, if XXXXMB hugetlb is allowed); Hmm. Thanks, -Kame -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH -V4 07/10] hugetlbfs: Add memcg control files for hugetlbfs Date: Mon, 19 Mar 2012 16:34:01 +0900 Message-ID: <4F66E169.5000909@jp.fujitsu.com> References: <1331919570-2264-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1331919570-2264-8-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <4F66A059.20801@jp.fujitsu.com> <87wr6hjc58.fsf@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <87wr6hjc58.fsf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: "Aneesh Kumar K.V" Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, mgorman-l3A5Bk7waGM@public.gmane.org, dhillf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, aarcange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, mhocko-AlSwsSmVLrQ@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tejun Heo (2012/03/19 16:14), Aneesh Kumar K.V wrote: > On Mon, 19 Mar 2012 11:56:25 +0900, KAMEZAWA Hiroyuki wrote: >> (2012/03/17 2:39), Aneesh Kumar K.V wrote: >> >>> From: "Aneesh Kumar K.V" >>> >>> This add control files for hugetlbfs in memcg >>> >>> Signed-off-by: Aneesh Kumar K.V >> >> >> I have a question. When a user does >> >> 1. create memory cgroup as >> /cgroup/A >> 2. insmod hugetlb.ko >> 3. ls /cgroup/A >> >> and then, files can be shown ? Don't we have any problem at rmdir A ? >> >> I'm sorry if hugetlb never be used as module. > > HUGETLBFS cannot be build as kernel module > > >> >> a comment below. >> >>> --- >>> include/linux/hugetlb.h | 17 +++++++++++++++ >>> include/linux/memcontrol.h | 7 ++++++ >>> mm/hugetlb.c | 25 ++++++++++++++++++++++- >>> mm/memcontrol.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ >>> 4 files changed, 96 insertions(+), 1 deletions(-) > > > ...... > >>> >>> +#ifdef CONFIG_MEM_RES_CTLR_HUGETLB >>> +static char *mem_fmt(char *buf, unsigned long n) >>> +{ >>> + if (n >= (1UL << 30)) >>> + sprintf(buf, "%luGB", n >> 30); >>> + else if (n >= (1UL << 20)) >>> + sprintf(buf, "%luMB", n >> 20); >>> + else >>> + sprintf(buf, "%luKB", n >> 10); >>> + return buf; >>> +} >>> + >>> +int mem_cgroup_hugetlb_file_init(int idx) >>> +{ >> >> >> __init ? > > Added . > >> And... do we have guarantee that this function is called before >> creating root mem cgroup even if CONFIG_HUGETLBFS=y ? >> > > Yes. This should be called before creating root mem cgroup. > O.K. BTW, please read Tejun's recent post.. https://lkml.org/lkml/2012/3/16/522 Can you use his methods ? I guess you can write... CGROUP_SUBSYS_CFTYLES_COND(mem_cgroup_subsys, hugetlb_cgroup_files, if XXXXMB hugetlb is allowed); Hmm. Thanks, -Kame