Files
kernel_arpi/include/linux
KAMEZAWA Hiroyuki a3b2d69269 cgroups: use css id in swap cgroup for saving memory v5
Try to use CSS ID for records in swap_cgroup.  By this, on 64bit machine,
size of swap_cgroup goes down to 2 bytes from 8bytes.

This means, when 2GB of swap is equipped, (assume the page size is 4096bytes)

	From size of swap_cgroup = 2G/4k * 8 = 4Mbytes.
	To   size of swap_cgroup = 2G/4k * 2 = 1Mbytes.

Reduction is large.  Of course, there are trade-offs.  This CSS ID will
add overhead to swap-in/swap-out/swap-free.

But in general,
  - swap is a resource which the user tend to avoid use.
  - If swap is never used, swap_cgroup area is not used.
  - Reading traditional manuals, size of swap should be proportional to
    size of memory. Memory size of machine is increasing now.

I think reducing size of swap_cgroup makes sense.

Note:
  - ID->CSS lookup routine has no locks, it's under RCU-Read-Side.
  - memcg can be obsolete at rmdir() but not freed while refcnt from
    swap_cgroup is available.

Changelog v4->v5:
 - reworked on to memcg-charge-swapcache-to-proper-memcg.patch
Changlog ->v4:
 - fixed not configured case.
 - deleted unnecessary comments.
 - fixed NULL pointer bug.
 - fixed message in dmesg.

[nishimura@mxp.nes.nec.co.jp: css_tryget can be called twice in !PageCgroupUsed case]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Paul Menage <menage@google.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: 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>
2009-04-02 19:04:56 -07:00
..
2009-01-30 19:50:25 +05:30
2009-03-18 19:45:11 -07:00
2009-01-09 12:37:15 -08:00
2009-01-30 23:30:42 +05:30
2009-01-30 23:32:45 +05:30
2009-03-05 14:39:32 -05:00
2009-01-30 23:38:03 +05:30
2009-01-21 14:02:19 -08:00
2009-01-30 23:38:37 +05:30
2009-02-12 09:40:14 +11:00
2009-04-01 08:59:23 -07:00
2009-01-30 23:39:42 +05:30
2009-04-01 08:59:23 -07:00
2009-01-30 23:40:06 +05:30
2009-01-30 23:44:08 +05:30
2009-04-02 19:04:55 -07:00
2009-03-27 14:43:57 -04:00
2009-03-27 14:43:59 -04:00
2009-03-01 00:19:35 -08:00
2009-01-30 23:46:03 +05:30
2009-01-30 23:46:40 +05:30
2009-01-30 23:48:33 +05:30
2009-02-10 00:41:26 +01:00
2009-03-16 08:32:27 -06:00
2009-04-02 19:04:52 -07:00
2009-04-01 08:59:29 -07:00
2009-02-18 15:37:56 -08:00
2009-03-24 12:35:17 +01:00
2009-01-30 23:50:37 +05:30
2009-01-30 23:51:17 +05:30
2009-04-01 08:59:14 -07:00
2009-01-30 23:51:41 +05:30
2009-03-31 20:15:33 +02:00
2009-04-02 19:04:53 -07:00
2009-01-30 23:52:16 +05:30
2009-01-30 23:53:12 +05:30
2009-01-30 23:53:40 +05:30
2009-01-30 23:54:53 +05:30
2009-01-30 23:55:45 +05:30
2009-01-30 23:56:13 +05:30
2009-01-30 23:56:48 +05:30
2009-01-30 23:57:16 +05:30
2009-02-11 15:27:15 +11:00
2009-02-02 21:40:58 +05:30
2009-01-30 23:58:41 +05:30
2009-01-30 23:59:44 +05:30
2009-01-31 00:00:06 +05:30
2009-03-13 14:32:29 +01:00
2009-01-15 16:39:37 -08:00
2009-04-02 19:04:49 -07:00
2009-01-22 10:18:58 +01:00
2009-04-01 08:59:18 -07:00
2009-03-24 22:52:39 -04:00
2009-04-01 08:59:17 -07:00
2009-01-21 10:39:51 +01:00
2009-01-31 00:00:35 +05:30
2009-04-02 19:04:48 -07:00
2009-03-26 10:56:35 -07:00
2009-01-31 00:01:11 +05:30
2009-03-20 10:48:14 -07:00
2009-01-14 18:09:02 +01:00
2009-03-15 19:59:13 -07:00
2009-04-01 13:28:15 -04:00
2009-04-01 13:28:15 -04:00
2009-03-10 20:33:18 -04:00
2009-04-01 08:59:13 -07:00
2009-04-01 08:59:13 -07:00
2009-01-31 00:02:54 +05:30
2009-01-08 08:31:12 -08:00
2009-01-31 00:03:40 +05:30
2009-04-01 08:59:13 -07:00
2009-03-13 16:09:12 -07:00
2009-03-26 02:18:35 +01:00
2009-01-31 00:05:59 +05:30
2009-02-26 23:42:11 -08:00
2009-03-30 14:28:58 -07:00
2009-04-01 08:59:24 -07:00
2009-04-02 19:04:51 -07:00
2009-02-16 00:03:10 -08:00
2009-01-29 16:56:32 +09:00
2009-02-27 16:53:50 +09:00
2009-01-31 00:06:33 +05:30
2009-02-20 17:57:48 -08:00
2009-01-31 00:07:00 +05:30
2009-04-01 08:59:13 -07:00
2009-04-01 08:59:15 -07:00
2009-01-31 00:07:31 +05:30
2009-02-11 14:25:36 -08:00
2009-02-18 15:37:53 -08:00
2009-02-03 11:23:12 +11:00
2009-03-26 18:14:21 +01:00