diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2009-06-12 03:33:53 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-06-12 04:00:54 -0400 |
commit | ca371c0d7e23d0d0afae65fc83a0e91cf7399573 (patch) | |
tree | 20ca26fbdceefe25d1c362dc23a2152c1aac8b4c /include/linux/page_cgroup.h | |
parent | 8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff) |
memcg: fix page_cgroup fatal error in FLATMEM
Now, SLAB is configured in very early stage and it can be used in
init routine now.
But replacing alloc_bootmem() in FLAT/DISCONTIGMEM's page_cgroup()
initialization breaks the allocation, now.
(Works well in SPARSEMEM case...it supports MEMORY_HOTPLUG and
size of page_cgroup is in reasonable size (< 1 << MAX_ORDER.)
This patch revive FLATMEM+memory cgroup by using alloc_bootmem.
In future,
We stop to support FLATMEM (if no users) or rewrite codes for flatmem
completely.But this will adds more messy codes and overheads.
Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Tested-by: Li Zefan <lizf@cn.fujitsu.com>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'include/linux/page_cgroup.h')
-rw-r--r-- | include/linux/page_cgroup.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 7339c7bf7331..13f126c89ae8 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -18,7 +18,19 @@ struct page_cgroup { | |||
18 | }; | 18 | }; |
19 | 19 | ||
20 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); | 20 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); |
21 | void __init page_cgroup_init(void); | 21 | |
22 | #ifdef CONFIG_SPARSEMEM | ||
23 | static inline void __init page_cgroup_init_flatmem(void) | ||
24 | { | ||
25 | } | ||
26 | extern void __init page_cgroup_init(void); | ||
27 | #else | ||
28 | void __init page_cgroup_init_flatmem(void); | ||
29 | static inline void __init page_cgroup_init(void) | ||
30 | { | ||
31 | } | ||
32 | #endif | ||
33 | |||
22 | struct page_cgroup *lookup_page_cgroup(struct page *page); | 34 | struct page_cgroup *lookup_page_cgroup(struct page *page); |
23 | 35 | ||
24 | enum { | 36 | enum { |
@@ -87,6 +99,10 @@ static inline void page_cgroup_init(void) | |||
87 | { | 99 | { |
88 | } | 100 | } |
89 | 101 | ||
102 | static inline void __init page_cgroup_init_flatmem(void) | ||
103 | { | ||
104 | } | ||
105 | |||
90 | #endif | 106 | #endif |
91 | 107 | ||
92 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 108 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |