lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F66E169.5000909@jp.fujitsu.com>
Date:	Mon, 19 Mar 2012 16:34:01 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
CC:	linux-mm@...ck.org, mgorman@...e.de, dhillf@...il.com,
	aarcange@...hat.com, mhocko@...e.cz, akpm@...ux-foundation.org,
	hannes@...xchg.org, linux-kernel@...r.kernel.org,
	cgroups@...r.kernel.org, Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH -V4 07/10] hugetlbfs: Add memcg control files for hugetlbfs

(2012/03/19 16:14), Aneesh Kumar K.V wrote:

> On Mon, 19 Mar 2012 11:56:25 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> wrote:
>> (2012/03/17 2:39), Aneesh Kumar K.V wrote:
>>
>>> From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
>>>
>>> This add control files for hugetlbfs in memcg
>>>
>>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
>>
>>
>> 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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ