linux/include
KAMEZAWA Hiroyuki 52d4b9ac0b memcg: allocate all page_cgroup at boot
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.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20 08:52:39 -07:00
..
acpi include: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
asm-arm
asm-cris container freezer: add TIF_FREEZE flag to all architectures 2008-10-20 08:52:33 -07:00
asm-frv FRV: Switch unaligned access to the packed-struct implementation 2008-10-16 15:06:54 -07:00
asm-generic Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
asm-h8300 h8300: update timer handler - new files 2008-10-16 11:21:29 -07:00
asm-m32r [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
asm-m68k container freezer: add TIF_FREEZE flag to all architectures 2008-10-20 08:52:33 -07:00
asm-mn10300 [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
asm-parisc container freezer: add TIF_FREEZE flag to all architectures 2008-10-20 08:52:33 -07:00
asm-um container freezer: add TIF_FREEZE flag to all architectures 2008-10-20 08:52:33 -07:00
asm-x86 Merge branch 'kvm-updates/2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm 2008-10-16 15:36:00 -07:00
asm-xtensa container freezer: add TIF_FREEZE flag to all architectures 2008-10-20 08:52:33 -07:00
crypto
drm radeon: fix PCI bus mastering support enables. 2008-10-18 07:10:54 +10:00
keys
linux memcg: allocate all page_cgroup at boot 2008-10-20 08:52:39 -07:00
math-emu
media V4L/DVB (9276): videobuf-dvb: two functions are now static 2008-10-17 17:39:14 -03:00
mtd
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-16 11:26:26 -07:00
pcmcia
rdma
rxrpc
scsi [SCSI] iscsi_tcp: return a descriptive error value during connection errors 2008-10-13 09:29:00 -04:00
sound Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2008-10-13 14:03:59 -07:00
video fbdev: allow more chip revisions in Epson s1d13... video driver 2008-10-16 11:21:45 -07:00
xen
Kbuild