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>,
LKML <linux-kernel@vger.kernel.org>,
"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [PATCH 2/6] memcg: allocate page_cgroup at boot
Date: Mon, 6 Oct 2008 15:41:41 +0530 [thread overview]
Message-ID: <20081006101141.GB1202@balbir.in.ibm.com> (raw)
In-Reply-To: <20081001165603.a6e73c0d.kamezawa.hiroyu@jp.fujitsu.com>
* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2008-10-01 16:56:03]:
> Allocate all page_cgroup at boot and remove page_cgroup poitner
> from struct page. This patch adds an interface as
>
> struct page_cgroup *lookup_page_cgroup(struct page*)
>
> All FLATMEM/DISCONTIGMEM/SPARSEMEM and MEMORY_HOTPLUG is supported.
>
> Remove page_cgroup pointer reduces the amount of memory by
> - 4 bytes per PAGE_SIZE.
> - 8 bytes per PAGE_SIZE
> if memory controller is disabled. (even if configured.)
>
> On usual 8GB x86-32 server, this saves 8MB of NORMAL_ZONE memory.
> On my x86-64 server with 48GB of memory, this saves 96MB of memory.
> I think this reduction makes sense.
>
> By pre-allocation, kmalloc/kfree in charge/uncharge are removed.
> This means
> - we're not necessary to be afraid of kmalloc faiulre.
> (this can happen because of gfp_mask type.)
> - we can avoid calling kmalloc/kfree.
> - we can avoid allocating tons of small objects which can be fragmented.
> - we can know what amount of memory will be used for this extra-lru handling.
>
> I added printk message as
>
> "allocated %ld bytes of page_cgroup"
> "please try cgroup_disable=memory option if you don't want"
>
> maybe enough informative for users.
>
> Changelog: v5 -> v6.
> * reflected comments.
> * coding style fixes.
> * removed "ctype" from uncharge.
> * improved comment to show FLAT_NODE_MEM_MAP == !SPARSEMEM
> * fixed errors in !SPARSEMEM codes
> * removed unused function in !SPARSEMEM codes.
> (start from v5 because of series..)
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
I like this patch very much
Reviewed-by: Balbir Singh <balbir@linux.vnet.ibm.com>
--
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>
next prev parent reply other threads:[~2008-10-06 10:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 7:52 [PATCH 0/6] memcg update v6 (for review and discuss) KAMEZAWA Hiroyuki
2008-10-01 7:55 ` [PATCH 1/6] atomic page_cgroup flags KAMEZAWA Hiroyuki
2008-10-06 7:42 ` Balbir Singh
2008-10-01 7:56 ` [PATCH 2/6] memcg: allocate page_cgroup at boot KAMEZAWA Hiroyuki
2008-10-02 8:49 ` [PATCH 2/6] memcg: allocate page_cgroup at boot (hunk fix) KAMEZAWA Hiroyuki
2008-10-06 16:32 ` Balbir Singh
2008-10-06 10:11 ` Balbir Singh [this message]
2008-10-01 7:57 ` [PATCH 3/6] memcg: charge-commit-cancel protocl KAMEZAWA Hiroyuki
2008-10-01 8:33 ` Daisuke Nishimura
2008-10-01 10:04 ` kamezawa.hiroyu
2008-10-03 10:05 ` Daisuke Nishimura
2008-10-03 15:15 ` kamezawa.hiroyu
2008-10-03 15:25 ` Daisuke Nishimura
2008-10-08 9:05 ` [RFC] memcg: handle migration by charge-commit-cancel (was " KAMEZAWA Hiroyuki
2008-10-01 7:59 ` [PATCH 4/6] memcg: new force_empty and move_account KAMEZAWA Hiroyuki
2008-10-01 16:38 ` Randy Dunlap
2008-10-02 5:13 ` KAMEZAWA Hiroyuki
2008-10-01 8:00 ` [PATCH 5/6] memcg: lazy lru freeing KAMEZAWA Hiroyuki
2008-10-09 5:39 ` Daisuke Nishimura
2008-10-09 6:26 ` KAMEZAWA Hiroyuki
2008-10-01 8:01 ` [PATCH 6/6] memcg: lazy lru addition KAMEZAWA Hiroyuki
2008-10-09 6:21 ` Daisuke Nishimura
2008-10-09 6:51 ` KAMEZAWA Hiroyuki
2008-10-02 9:02 ` [PATCH 0/6] memcg update v6 (for review and discuss) KAMEZAWA Hiroyuki
2008-10-06 17:26 ` Balbir Singh
2008-10-07 1:22 ` 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=20081006101141.GB1202@balbir.in.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 \
/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