All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"xemul@openvz.org" <xemul@openvz.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 9/13] memcg: lookup page cgroup (and remove pointer from struct page)
Date: Wed, 24 Sep 2008 01:31:59 -0700	[thread overview]
Message-ID: <48D9FAFF.8070404@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080924120940.5aea6907.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki wrote:
> On Wed, 24 Sep 2008 07:39:58 +0530
> "Balbir Singh" <balbir@linux.vnet.ibm.com> wrote:
>>> I'll add FLATMEM/DISCONTIGMEM/SPARSEMEM support directly.
>>> I already have wasted a month on this not-interesting work and want to fix
>>> this soon.
>>>
>> Let's look at the basic requirement, make memory resource controller
>> not suck with 32 bit systems. I have been thinking of about removing
>> page_cgroup from struct page only for 32 bit systems (use radix tree),
>> 32 bit systems can have a maximum of 64GB if PAE is enabled, I suspect
>> radix tree should work there and let the 64 bit systems work as is. If
>> performance is an issue, I would recommend the 32 bit folks upgrade to
>> 64 bit :) Can we build consensus around this approach?
>>
> My thinking is below. (assume 64bit)
> 

assume 64 bit for the calculations below?

>   - remove page_cgroup pointer from struct page allows us to reduce
>     static memory usage at boot by 8bytes/4096bytes if memory cgroup is disabled.
>     This reaches 96MB on my 48 GB box. I think this is big.
>   - pre-allocation of page_cgroup gives us following.
>    Pros.
>       - We are not necessary to be afraid of "failure of kmalloc" and
>         "goes down to memory reclaim at kmalloc"
>         This makes memory resource controller much simpler and robust.
>       - We can know what amount of kernel memory will be used for
>         LRU pages management.
>    Cons.
>       - All page_cgroups are allocated at boot.
>         This reaches 480MB on my 48GB box.
> 
>   But I think we can ignore "Cons.". If we use up memory, we'll use tons of
>   page_cgroup. Considering memory fragmentation caused by allocating a lots of
>   very small object, pre-allocation makes memcg better.

This looks like a good patch. I'll review and test it.

-- 
	Balbir

WARNING: multiple messages have this Message-ID (diff)
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"xemul@openvz.org" <xemul@openvz.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 9/13] memcg: lookup page cgroup (and remove pointer from struct page)
Date: Wed, 24 Sep 2008 01:31:59 -0700	[thread overview]
Message-ID: <48D9FAFF.8070404@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080924120940.5aea6907.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki wrote:
> On Wed, 24 Sep 2008 07:39:58 +0530
> "Balbir Singh" <balbir@linux.vnet.ibm.com> wrote:
>>> I'll add FLATMEM/DISCONTIGMEM/SPARSEMEM support directly.
>>> I already have wasted a month on this not-interesting work and want to fix
>>> this soon.
>>>
>> Let's look at the basic requirement, make memory resource controller
>> not suck with 32 bit systems. I have been thinking of about removing
>> page_cgroup from struct page only for 32 bit systems (use radix tree),
>> 32 bit systems can have a maximum of 64GB if PAE is enabled, I suspect
>> radix tree should work there and let the 64 bit systems work as is. If
>> performance is an issue, I would recommend the 32 bit folks upgrade to
>> 64 bit :) Can we build consensus around this approach?
>>
> My thinking is below. (assume 64bit)
> 

assume 64 bit for the calculations below?

>   - remove page_cgroup pointer from struct page allows us to reduce
>     static memory usage at boot by 8bytes/4096bytes if memory cgroup is disabled.
>     This reaches 96MB on my 48 GB box. I think this is big.
>   - pre-allocation of page_cgroup gives us following.
>    Pros.
>       - We are not necessary to be afraid of "failure of kmalloc" and
>         "goes down to memory reclaim at kmalloc"
>         This makes memory resource controller much simpler and robust.
>       - We can know what amount of kernel memory will be used for
>         LRU pages management.
>    Cons.
>       - All page_cgroups are allocated at boot.
>         This reaches 480MB on my 48GB box.
> 
>   But I think we can ignore "Cons.". If we use up memory, we'll use tons of
>   page_cgroup. Considering memory fragmentation caused by allocating a lots of
>   very small object, pre-allocation makes memcg better.

This looks like a good patch. I'll review and test it.

-- 
	Balbir

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-09-24  8:33 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 10:51 [PATCH 0/13] memory cgroup updates v4 KAMEZAWA Hiroyuki
2008-09-22 10:51 ` KAMEZAWA Hiroyuki
2008-09-22 10:55 ` [PATCH 1/13] memcg: avoid accounting special mapping KAMEZAWA Hiroyuki
2008-09-22 10:55   ` KAMEZAWA Hiroyuki
2008-09-22 10:57 ` [PATCH 2/13] memcg: account fault-in swap under lock KAMEZAWA Hiroyuki
2008-09-22 10:57   ` KAMEZAWA Hiroyuki
2008-09-22 10:58 ` [PATCH 3/13] memcg: nolimit root cgroup KAMEZAWA Hiroyuki
2008-09-22 10:58   ` KAMEZAWA Hiroyuki
2008-09-22 11:00 ` [PATCH 4/13] memcg: force_empty moving account KAMEZAWA Hiroyuki
2008-09-22 11:00   ` KAMEZAWA Hiroyuki
2008-09-22 14:23   ` Peter Zijlstra
2008-09-22 14:23     ` Peter Zijlstra
2008-09-22 14:50     ` kamezawa.hiroyu
2008-09-22 14:50       ` kamezawa.hiroyu
2008-09-22 14:56       ` Peter Zijlstra
2008-09-22 14:56         ` Peter Zijlstra
2008-09-22 15:06         ` kamezawa.hiroyu
2008-09-22 15:06           ` kamezawa.hiroyu
2008-09-22 15:32           ` Peter Zijlstra
2008-09-22 15:32             ` Peter Zijlstra
2008-09-22 15:43             ` kamezawa.hiroyu
2008-09-22 15:43               ` kamezawa.hiroyu
2008-09-22 11:02 ` [PATCH 5/13] memcg: cleanup to make mapping null before unchage KAMEZAWA Hiroyuki
2008-09-22 11:02   ` KAMEZAWA Hiroyuki
2008-09-22 11:03 ` [PATCH 6/13] memcg: optimze per cpu accounting for memcg KAMEZAWA Hiroyuki
2008-09-22 11:03   ` KAMEZAWA Hiroyuki
2008-09-22 11:05 ` [PATCH 3.5/13] memcg: make page_cgroup flags to be atomic KAMEZAWA Hiroyuki
2008-09-22 11:05   ` KAMEZAWA Hiroyuki
2008-09-22 11:09 ` [PATCH 3.6/13] memcg: add function to move account KAMEZAWA Hiroyuki
2008-09-22 11:09   ` KAMEZAWA Hiroyuki
2008-09-24  6:50   ` Daisuke Nishimura
2008-09-24  6:50     ` Daisuke Nishimura
2008-09-24  7:11     ` KAMEZAWA Hiroyuki
2008-09-24  7:11       ` KAMEZAWA Hiroyuki
2008-09-22 11:12 ` [PATCH 9/13] memcg: lookup page cgroup (and remove pointer from struct page) KAMEZAWA Hiroyuki
2008-09-22 11:12   ` KAMEZAWA Hiroyuki
2008-09-22 14:52   ` Dave Hansen
2008-09-22 14:52     ` Dave Hansen
2008-09-22 15:14     ` kamezawa.hiroyu
2008-09-22 15:14       ` kamezawa.hiroyu
2008-09-22 15:47       ` Dave Hansen
2008-09-22 15:47         ` Dave Hansen
2008-09-22 15:57         ` kamezawa.hiroyu
2008-09-22 15:57           ` kamezawa.hiroyu
2008-09-22 16:10           ` Dave Hansen
2008-09-22 16:10             ` Dave Hansen
2008-09-22 17:34             ` kamezawa.hiroyu
2008-09-22 17:34               ` kamezawa.hiroyu
2008-09-22 15:47   ` Peter Zijlstra
2008-09-22 15:47     ` Peter Zijlstra
2008-09-22 16:04     ` kamezawa.hiroyu
2008-09-22 16:04       ` kamezawa.hiroyu
2008-09-22 16:06       ` Peter Zijlstra
2008-09-22 16:06         ` Peter Zijlstra
2008-09-23 23:48   ` KAMEZAWA Hiroyuki
2008-09-23 23:48     ` KAMEZAWA Hiroyuki
2008-09-24  2:09     ` Balbir Singh
2008-09-24  2:09       ` Balbir Singh
2008-09-24  3:09       ` KAMEZAWA Hiroyuki
2008-09-24  3:09         ` KAMEZAWA Hiroyuki
2008-09-24  8:31         ` Balbir Singh [this message]
2008-09-24  8:31           ` Balbir Singh
2008-09-24  8:46           ` KAMEZAWA Hiroyuki
2008-09-24  8:46             ` KAMEZAWA Hiroyuki
2008-09-22 11:13 ` [PATCH 10/13] memcg: page_cgroup look aside table KAMEZAWA Hiroyuki
2008-09-22 11:13   ` KAMEZAWA Hiroyuki
2008-09-22 11:17 ` [PATCH 11/13] memcg: lazy LRU free (NEW) KAMEZAWA Hiroyuki
2008-09-22 11:17   ` KAMEZAWA Hiroyuki
2008-09-22 11:22 ` [PATCH 12/13] memcg: lazy LRU add KAMEZAWA Hiroyuki
2008-09-22 11:22   ` KAMEZAWA Hiroyuki
2008-09-22 11:24 ` [PATCH 13/13] memcg: swap accounting fix KAMEZAWA Hiroyuki
2008-09-22 11:24   ` KAMEZAWA Hiroyuki
2008-09-22 11:28 ` [PATCH 0/13] memory cgroup updates v4 KAMEZAWA Hiroyuki
2008-09-22 11:28   ` KAMEZAWA Hiroyuki

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=48D9FAFF.8070404@linux.vnet.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=xemul@openvz.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.